* Based on ahwayakchih's blue screen paging code (see bug #1444), I added
paging support to KDL (but not the on-screen debug output for now). * Defaults to "on", use the new "paging" KDL command to turn it off (or on again). * When pressing 'q' while it is waiting for a key, it will now eat the rest of the commands output (helpful for slow screen output of a large data set). git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23566 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Copyright 2008, Ingo Weinhold, [email protected]
|
||||
* Copyright 2002-2007, Axel Dörfler, [email protected]
|
||||
* Copyright 2002-2008, Axel Dörfler, [email protected]
|
||||
* Distributed under the terms of the MIT License.
|
||||
*
|
||||
* Copyright 2001, Travis Geiselbrecht. All rights reserved.
|
||||
@@ -27,6 +27,7 @@ static struct debugger_command *sCommands;
|
||||
|
||||
static jmp_buf sInvokeCommandEnv;
|
||||
static bool sInvokeCommandDirectly = false;
|
||||
static bool sInCommand = false;
|
||||
|
||||
|
||||
debugger_command*
|
||||
@@ -75,6 +76,15 @@ find_debugger_command(const char *name, bool partialMatch, bool& ambiguous)
|
||||
}
|
||||
|
||||
|
||||
/*! Returns wether or not a debugger command is currently being invoked.
|
||||
*/
|
||||
bool
|
||||
in_command_invocation(void)
|
||||
{
|
||||
return sInCommand;
|
||||
}
|
||||
|
||||
|
||||
/*! This function is a safe gate through which debugger commands are invoked.
|
||||
It sets a fault handler before invoking the command, so that an invalid
|
||||
memory access will not result in another KDL session on top of this one
|
||||
@@ -99,6 +109,8 @@ invoke_debugger_command(struct debugger_command *command, int argc, char** argv)
|
||||
if (sInvokeCommandDirectly)
|
||||
return command->func(argc, argv);
|
||||
|
||||
sInCommand = true;
|
||||
|
||||
if (setjmp(sInvokeCommandEnv) == 0) {
|
||||
int result;
|
||||
thread->fault_handler = (addr_t)&&error;
|
||||
@@ -108,7 +120,9 @@ invoke_debugger_command(struct debugger_command *command, int argc, char** argv)
|
||||
goto error;
|
||||
|
||||
result = command->func(argc, argv);
|
||||
|
||||
thread->fault_handler = oldFaultHandler;
|
||||
sInCommand = false;
|
||||
return result;
|
||||
|
||||
error:
|
||||
@@ -119,6 +133,7 @@ error:
|
||||
}
|
||||
|
||||
thread->fault_handler = oldFaultHandler;
|
||||
sInCommand = false;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user