From a36919860353c0f198801594d0da40bbcc214048 Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Fri, 19 Mar 2010 21:30:27 +0000 Subject: [PATCH] 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. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35920 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/system/kernel/debug/debug.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/system/kernel/debug/debug.cpp b/src/system/kernel/debug/debug.cpp index b59a7ba889..44262e0721 100644 --- a/src/system/kernel/debug/debug.cpp +++ b/src/system/kernel/debug/debug.cpp @@ -845,8 +845,13 @@ kernel_debugger_loop(const char* messagePrefix, const char* message, 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")) {