* 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
This commit is contained in:
@@ -24,6 +24,10 @@
|
|||||||
#include "debug_variables.h"
|
#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_FAULT 1
|
||||||
#define INVOKE_COMMAND_ERROR 2
|
#define INVOKE_COMMAND_ERROR 2
|
||||||
|
|
||||||
@@ -280,11 +284,13 @@ invoke_debugger_command(struct debugger_command *command, int argc, char** argv)
|
|||||||
switch (setjmp(sInvokeCommandEnv[sInvokeCommandLevel++])) {
|
switch (setjmp(sInvokeCommandEnv[sInvokeCommandLevel++])) {
|
||||||
case 0:
|
case 0:
|
||||||
int result;
|
int result;
|
||||||
|
#if DEBUG_DEBUGGER_COMMANDS
|
||||||
thread->fault_handler = (addr_t)&&error;
|
thread->fault_handler = (addr_t)&&error;
|
||||||
// Fake goto to trick the compiler not to optimize the code at the
|
// Fake goto to trick the compiler not to optimize the code at the
|
||||||
// label away.
|
// label away.
|
||||||
if (!thread)
|
if (!thread)
|
||||||
goto error;
|
goto error;
|
||||||
|
#endif
|
||||||
|
|
||||||
result = command->func(argc, argv);
|
result = command->func(argc, argv);
|
||||||
|
|
||||||
@@ -293,11 +299,12 @@ invoke_debugger_command(struct debugger_command *command, int argc, char** argv)
|
|||||||
sInCommand = false;
|
sInCommand = false;
|
||||||
return result;
|
return result;
|
||||||
|
|
||||||
error:
|
#if DEBUG_DEBUGGER_COMMANDS
|
||||||
|
error:
|
||||||
// jump to INVOKE_COMMAND_FAULT case, cleaning up the stack
|
// jump to INVOKE_COMMAND_FAULT case, cleaning up the stack
|
||||||
longjmp(sInvokeCommandEnv[--sInvokeCommandLevel],
|
longjmp(sInvokeCommandEnv[--sInvokeCommandLevel],
|
||||||
INVOKE_COMMAND_FAULT);
|
INVOKE_COMMAND_FAULT);
|
||||||
|
#endif
|
||||||
case INVOKE_COMMAND_FAULT:
|
case INVOKE_COMMAND_FAULT:
|
||||||
{
|
{
|
||||||
debug_page_fault_info* info = debug_get_page_fault_info();
|
debug_page_fault_info* info = debug_get_page_fault_info();
|
||||||
|
|||||||
Reference in New Issue
Block a user