From 9521c5abb6ec6cccb2899ac749f471f6c3f39005 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Thu, 30 Oct 2008 11:33:15 +0000 Subject: [PATCH] * If DEBUG_DEBUGGER_COMMANDS is 1, invoke_debugger_command() will no longer install a fault handler, allowing to debug KDL commands better. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28376 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/system/kernel/debug/debug_commands.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/system/kernel/debug/debug_commands.cpp b/src/system/kernel/debug/debug_commands.cpp index b8778a53ed..34a991c2c5 100644 --- a/src/system/kernel/debug/debug_commands.cpp +++ b/src/system/kernel/debug/debug_commands.cpp @@ -24,6 +24,10 @@ #include "debug_variables.h" +#define DEBUG_DEBUGGER_COMMANDS 0 + // Turns off the "FAULT" message to get a stack crawl + // of the failing debugger command. + #define INVOKE_COMMAND_FAULT 1 #define INVOKE_COMMAND_ERROR 2 @@ -280,11 +284,13 @@ invoke_debugger_command(struct debugger_command *command, int argc, char** argv) switch (setjmp(sInvokeCommandEnv[sInvokeCommandLevel++])) { case 0: int result; +#if DEBUG_DEBUGGER_COMMANDS thread->fault_handler = (addr_t)&&error; // Fake goto to trick the compiler not to optimize the code at the // label away. if (!thread) goto error; +#endif result = command->func(argc, argv); @@ -293,11 +299,12 @@ invoke_debugger_command(struct debugger_command *command, int argc, char** argv) sInCommand = false; return result; -error: +#if DEBUG_DEBUGGER_COMMANDS + error: // jump to INVOKE_COMMAND_FAULT case, cleaning up the stack longjmp(sInvokeCommandEnv[--sInvokeCommandLevel], INVOKE_COMMAND_FAULT); - +#endif case INVOKE_COMMAND_FAULT: { debug_page_fault_info* info = debug_get_page_fault_info();