From da4c496a55b73e2a768d3b1c6cee44b43144bcc8 Mon Sep 17 00:00:00 2001 From: "Frank Ch. Eigler" Date: Wed, 10 Sep 2008 17:18:41 -0400 Subject: backtrace fix for i386 with neither frame pointers nor dwarf unwinding --- runtime/ChangeLog | 8 ++++++++ runtime/runtime.h | 4 +--- runtime/stack-i386.c | 6 +++++- 3 files changed, 14 insertions(+), 4 deletions(-) (limited to 'runtime') diff --git a/runtime/ChangeLog b/runtime/ChangeLog index 2438ee5e..97b1a0c0 100644 --- a/runtime/ChangeLog +++ b/runtime/ChangeLog @@ -1,3 +1,11 @@ +2008-09-10 Frank Ch. Eigler + + * 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 * sym.h (_stp_module): Rename module_base to dwarf_module_base. 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 } -- cgit