From 7656ad6be1c6b2c2ebf6542bdc97b91837b80867 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20F=C3=A4rber?= Date: Sun, 27 Jun 2010 21:34:31 +0000 Subject: [PATCH] kernel_ppc: Use saved register state for stack trace of current thread Suggested by Ingo in ticket #6139. This shortens the stack trace and makes it independent of whether called implicitly on KDL entry or manually from the kernel debugger prompt. For a kernel panic, "panic" is now the top-most frame printed. Closes ticket #6160. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37282 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/system/kernel/arch/ppc/arch_debug.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/system/kernel/arch/ppc/arch_debug.cpp b/src/system/kernel/arch/ppc/arch_debug.cpp index 0080111f97..e472fa28d6 100644 --- a/src/system/kernel/arch/ppc/arch_debug.cpp +++ b/src/system/kernel/arch/ppc/arch_debug.cpp @@ -124,7 +124,8 @@ stack_trace(int argc, char **argv) if (argc < 2) { thread = thread_get_current_thread(); - framePointer = (addr_t)get_current_stack_frame()->previous; + int32 cpu = smp_get_current_cpu(); + framePointer = debug_get_debug_registers(cpu)->r1; } else { // TODO: Add support for stack traces of other threads. /* thread_id id = strtoul(argv[1], NULL, 0);