diff options
author | Mark Wielaard <mjw@redhat.com> | 2008-12-15 18:20:04 +0100 |
---|---|---|
committer | Mark Wielaard <mjw@redhat.com> | 2008-12-15 18:20:04 +0100 |
commit | 6e44f060ffb5fff8d3987024d8facfb7997a3b25 (patch) | |
tree | 96c3ed3e16f8361cae3696498c97e177217497a7 /testsuite/systemtap.context/usymbols.c | |
parent | 3a5153c5590a89d6c0b70fc2c13554190b8c3be8 (diff) | |
download | systemtap-steved-6e44f060ffb5fff8d3987024d8facfb7997a3b25.tar.gz systemtap-steved-6e44f060ffb5fff8d3987024d8facfb7997a3b25.tar.xz systemtap-steved-6e44f060ffb5fff8d3987024d8facfb7997a3b25.zip |
Compile and use helper usymbols_lib.c library for usymbols.exp test.
Diffstat (limited to 'testsuite/systemtap.context/usymbols.c')
-rw-r--r-- | testsuite/systemtap.context/usymbols.c | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/testsuite/systemtap.context/usymbols.c b/testsuite/systemtap.context/usymbols.c index f8ee05b5..7c590724 100644 --- a/testsuite/systemtap.context/usymbols.c +++ b/testsuite/systemtap.context/usymbols.c @@ -8,34 +8,32 @@ * * Uses signal to tranfer user space addresses into the kernel where a * probe on sigaction will extract them and produce the symbols. To - * poke into the executable we get the sa_handler, to poke into glibc - * we get the sa_restorer fields in the stap script. + * poke into the executable we get the sa_handler from the main executable, + * and then the library through calling signal. * - * XXX - Seems sa_restorer isn't set on all architectures. should use - * our own shared library and set signal handler from there. Also - * need to handle @plt symbols (setting a handler in the main - * executable that is in a shared library will have the @plt address, - * not the address inside the shared library). + * FIXME. We call into the library to get the right symbol. If we + * register the handler from the main executable. We need to handle + * @plt symbols (setting a handler in the main executable that is in a + * shared library will have the @plt address, not the address inside + * the shared library). */ #include <signal.h> typedef void (*sighandler_t)(int); +// function from our library +int lib_main (void); + void -handler (int signum) +main_handler (int signum) { /* dummy handler, just used for the address... */ } -sighandler_t -libc_handler (void *func) -{ - return (sighandler_t) func; -} - int main (int argc, char *argv[], char *envp[]) { // Use SIGFPE since we never expect that to be triggered. - signal(SIGFPE, handler); + signal(SIGFPE, main_handler); + lib_main(); } |