summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrank Ch. Eigler <fche@elastic.org>2008-09-10 17:18:41 -0400
committerFrank Ch. Eigler <fche@elastic.org>2008-09-10 17:18:41 -0400
commitda4c496a55b73e2a768d3b1c6cee44b43144bcc8 (patch)
treec072badf8d4161ca91883d0084548a95895dd0b7
parentae8b5b85fe489b400022c339c907806fc6dc55ae (diff)
downloadsystemtap-steved-da4c496a55b73e2a768d3b1c6cee44b43144bcc8.tar.gz
systemtap-steved-da4c496a55b73e2a768d3b1c6cee44b43144bcc8.tar.xz
systemtap-steved-da4c496a55b73e2a768d3b1c6cee44b43144bcc8.zip
backtrace fix for i386 with neither frame pointers nor dwarf unwinding
-rw-r--r--runtime/ChangeLog8
-rw-r--r--runtime/runtime.h4
-rw-r--r--runtime/stack-i386.c6
3 files changed, 14 insertions, 4 deletions
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 <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.
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)&REG_SP(regs), verbose, levels);
#endif /* STP_USE_FRAME_POINTER */
+#endif
}