[haiku-commits] r35920 - haiku/trunk/src/system/kernel/debug

  • From: ingo_weinhold@xxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Fri, 19 Mar 2010 22:30:27 +0100 (CET)

Author: bonefish
Date: 2010-03-19 22:30:27 +0100 (Fri, 19 Mar 2010)
New Revision: 35920
Changeset: http://dev.haiku-os.org/changeset/35920/haiku

Modified:
   haiku/trunk/src/system/kernel/debug/debug.cpp
Log:
kernel_debugger_loop(): We need to use a dedicated jmp_buf for the call of
arch_debug_stack_trace() through debug_call_with_fault_handler(), since the
one in the CPU structure can only be used for debug_{strl,mem}cpy(), which do
not potentially have nested debug_call_with_fault_handler() calls.


Modified: haiku/trunk/src/system/kernel/debug/debug.cpp
===================================================================
--- haiku/trunk/src/system/kernel/debug/debug.cpp       2010-03-19 19:21:41 UTC 
(rev 35919)
+++ haiku/trunk/src/system/kernel/debug/debug.cpp       2010-03-19 21:30:27 UTC 
(rev 35920)
@@ -845,8 +845,13 @@
        if (!has_debugger_command("help") || message != NULL) {
                // No commands yet or we came here via a panic(). Always print 
a stack
                // trace in these cases.
-               
debug_call_with_fault_handler(gCPU[sDebuggerOnCPU].fault_jump_buffer,
-                       &stack_trace_trampoline, NULL);
+               jmp_buf* jumpBuffer = (jmp_buf*)debug_malloc(sizeof(jmp_buf));
+               if (jumpBuffer != NULL) {
+                       debug_call_with_fault_handler(*jumpBuffer, 
&stack_trace_trampoline,
+                               NULL);
+                       debug_free(jumpBuffer);
+               } else
+                       arch_debug_stack_trace();
        }
 
        if (has_debugger_command("help")) {


Other related posts:

  • » [haiku-commits] r35920 - haiku/trunk/src/system/kernel/debug - ingo_weinhold