diff options
author | Frank Ch. Eigler <fche@elastic.org> | 2008-09-10 17:21:51 -0400 |
---|---|---|
committer | Frank Ch. Eigler <fche@elastic.org> | 2008-09-10 17:21:51 -0400 |
commit | dd13da3b90d71b94c8dc09942fee97f8513df348 (patch) | |
tree | d490b811932be34445f3d02331b14d4f1c5b909a /runtime | |
parent | f76427a2bf80e4451e5e8d0c26b06aca65e4e2c4 (diff) | |
parent | da4c496a55b73e2a768d3b1c6cee44b43144bcc8 (diff) | |
download | systemtap-steved-dd13da3b90d71b94c8dc09942fee97f8513df348.tar.gz systemtap-steved-dd13da3b90d71b94c8dc09942fee97f8513df348.tar.xz systemtap-steved-dd13da3b90d71b94c8dc09942fee97f8513df348.zip |
Merge branch 'master' of ssh://sources.redhat.com/git/systemtap
* 'master' of ssh://sources.redhat.com/git/systemtap:
backtrace fix for i386 with neither frame pointers nor dwarf unwinding
Add network security warning for the client/server.
Check for dwarf_getelf (elfutils 0.126+).
hangeLog entries for latest commits.
Move stap-find-* script to client sub rpm.
Rename _stp_module module_base output to dwarf_module_base and document.
Remove unnecessary dependencies.
Correct man page specs in systemtap.spec
Create systemtap-client and systemtap-server sub rpms
Diffstat (limited to 'runtime')
-rw-r--r-- | runtime/ChangeLog | 13 | ||||
-rw-r--r-- | runtime/runtime.h | 4 | ||||
-rw-r--r-- | runtime/stack-i386.c | 6 | ||||
-rw-r--r-- | runtime/sym.h | 7 | ||||
-rw-r--r-- | runtime/unwind.c | 6 |
5 files changed, 28 insertions, 8 deletions
diff --git a/runtime/ChangeLog b/runtime/ChangeLog index 6ff15b8a..97b1a0c0 100644 --- a/runtime/ChangeLog +++ b/runtime/ChangeLog @@ -1,3 +1,16 @@ +2008-09-10 Frank Ch. Eigler <fche@elastic.org> + + * runtime.h (STP_USE_FRAME_POINTER): Remove architecture #if's. + All will activate it if CONFIG_FRAME_POINTER unless + STP_USE_DWARF_UNWINDER. + * stack-i386.c: (__stp_stack_print): Handle !DWARF and !FRAME + configuration. + +2008-09-10 Mark Wielaard <mjw@redhat.com> + + * sym.h (_stp_module): Rename module_base to dwarf_module_base. + * unwind.c (adjustStartLoc): Document and use dwarf_module_base. + 2008-09-10 Mark Wielaard <mjw@redhat.com> * runtime.h (CONFIG_FRAME_POINTER): Don't enable when diff --git a/runtime/runtime.h b/runtime/runtime.h index db793aa5..cd3d0b11 100644 --- a/runtime/runtime.h +++ b/runtime/runtime.h @@ -69,15 +69,13 @@ static struct #ifdef CONFIG_FRAME_POINTER /* Just because frame pointers are available does not mean we can trust them. */ #ifndef STP_USE_DWARF_UNWINDER -#if defined (__i386__) || defined (__arm__) #define STP_USE_FRAME_POINTER #endif #endif -#endif /* dwarf unwinder only tested so far on i386 and x86_64, but globally disabled for now */ -#if 0 +#if 0 // !defined(STP_USE_FRAME_BUFFER) && (defined(__i386__) || defined(__x86_64__)) #define STP_USE_DWARF_UNWINDER #endif diff --git a/runtime/stack-i386.c b/runtime/stack-i386.c index ad101889..ed7e2ce1 100644 --- a/runtime/stack-i386.c +++ b/runtime/stack-i386.c @@ -54,9 +54,10 @@ static void __stp_stack_print (struct pt_regs *regs, int verbose, int levels) fp = next_fp; } #else +#ifdef STP_USE_DWARF_UNWINDER struct unwind_frame_info info; arch_unw_init_frame_info(&info, regs); - + while (levels && !arch_unw_user_mode(&info)) { int ret = unwind(&info); dbug_unwind(1, "ret=%d PC=%lx SP=%lx\n", ret, UNW_PC(&info), UNW_SP(&info)); @@ -71,5 +72,8 @@ static void __stp_stack_print (struct pt_regs *regs, int verbose, int levels) _stp_stack_print_fallback(context, UNW_SP(&info), verbose, levels); break; } +#else /* ! STP_USE_DWARF_UNWINDER */ + _stp_stack_print_fallback(context, (unsigned long)®_SP(regs), verbose, levels); #endif /* STP_USE_FRAME_POINTER */ +#endif } diff --git a/runtime/sym.h b/runtime/sym.h index 564f4eb2..5888d2c7 100644 --- a/runtime/sym.h +++ b/runtime/sym.h @@ -33,8 +33,11 @@ struct _stp_module { /* any notifier hooks that will tell us when a module */ /* is unloading. */ unsigned long module; /* XXX: why not struct module * ? */ - - unsigned long module_base; + + /* This is to undo .debug_frame relocation performed by elfutils, */ + /* which is done during the translate phase when we encode the */ + /* unwind data into the module. See adjustStartLoc() in unwind.c. */ + unsigned long dwarf_module_base; /* the stack unwind data for this module */ void *unwind_data; diff --git a/runtime/unwind.c b/runtime/unwind.c index db8ae664..bc8a93dc 100644 --- a/runtime/unwind.c +++ b/runtime/unwind.c @@ -550,7 +550,9 @@ static int processCFI(const u8 *start, const u8 *end, unsigned long targetLoc, s return result && ptr.p8 == end && (targetLoc == 0 || state->label == NULL); } -// This is an address inside a module, adjust. +// If this is an address inside a module, adjust for section relocation +// and the elfutils base relocation done during loading of the .dwarf_frame +// in translate.cxx. static unsigned long adjustStartLoc (unsigned long startLoc, struct _stp_module *m, @@ -560,7 +562,7 @@ adjustStartLoc (unsigned long startLoc, { startLoc = _stp_module_relocate (m->name, s->name, startLoc); - startLoc -= m->module_base; + startLoc -= m->dwarf_module_base; } return startLoc; } |