History log of /haiku/src/system/kernel/debug/debug_commands.cpp
Revision Date Author Comments
# 668ecf4f 21-Mar-2020 X512 <danger_mail@list.ru>

Kernel: fix operator priority warning

Pointed by clang.

Change-Id: I16aa242c94abdf1fa22c4651e63c8c236e6c1a82
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2393
Reviewed-by: John Scipione <jscipione@gmail.com>


# 0e35d5d2 12-Dec-2011 John Scipione <jscipione@gmail.com>

Change instances of wether in comments to whether. No functional change intended.


# a4c21b1c 22-Feb-2011 Philippe Houdoin <philippe.houdoin@gmail.com>

Check if the name is already used in add_debugger_command*() and reject
duplicate attempt(s).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40611 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 3ce26345 30-Dec-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

* Fixed the semantics of [v]snprintf(): If the buffer is not large enough,
the function shall nevertheless return the length of the string that would
be written, if the buffer were large enough.
Added a touch of C++ while doing that. :-)
* Fixed the instances in boot loader, kernel, and kernel modules where the
wrong semantics were expected. The majority of uses actually.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34826 a95241bf-73f2-0310-859d-f6bbb57e9c96


# ea2abd11 02-Aug-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

* Renamed the ROUNDOWN macro to ROUNDDOWN. Also changed the implementation of
ROUNDUP to use '*' and '/' -- the compiler will optimize that for powers of
two anyway and this implementation works for other numbers as well.
* The thread::fault_handler use in C[++] code was broken with gcc 4. At least
when other functions were invoked. Trying to trick the compiler wasn't a
particularly good idea anyway, since the next compiler version could break
the trick again. So the general policy is to use the fault handlers only in
assembly code where we have full control. Changed that for x86 (save for the
vm86 mode, which has a similar mechanism), but not for the other
architectures.
* Introduced fault_handler, fault_handler_stack_pointer, and fault_jump_buffer
fields in the cpu_ent structure, which must be used instead of
thread::fault_handler in the kernel debugger. Consequently user_memcpy() must
not be used in the kernel debugger either. Introduced a debug_memcpy()
instead.
* Introduced debug_call_with_fault_handler() function which calls a function
in a setjmp() and fault handler context. The architecture specific backend
arch_debug_call_with_fault_handler() has only been implemented for x86 yet.
* Introduced debug_is_kernel_memory_accessible() for use in the kernel
debugger. It determines whether a range of memory can be accessed in the
way specified. The architecture specific back end
arch_vm_translation_map_is_kernel_page_accessible() has only been implemented
for x86 yet.
* Added arch_debug_unset_current_thread() (only implemented for x86) to unset
the current thread pointer in the kernel debugger. When entering the kernel
debugger we do some basic sanity checks of the currently set thread structure
and unset it, if they fail. This allows certain commands (most importantly
the stack trace command) to avoid accessing the thread structure.
* x86: When handling a double fault, we do now install a special handler for
page faults. This allows us to gracefully catch faulting commands, even if
e.g. the thread structure is toast.

We are now in much better shape to deal with double faults. Hopefully avoiding
the triple faults that some people have been experiencing on their hardware
and ideally even allowing to use the kernel debugger normally.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32073 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 360d4974 02-Jun-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

Replaced the temporary storage used in the kernel debug command parser. We now
have a simple dedicated heap for the kernel debugger with stacked allocation
pools (deleting a pool frees all memory allocated in it). The heap should
eventually be used for all commands that need temporary storage too large for
the stack instead of each using its own static buffer.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30949 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 5b9d5a2e 10-Mar-2009 Michael Lotz <mmlr@mlotz.ch>

* Add has_debugger_command() so whether or not a debugger command is available
can be checked.
* Make the usb_keyboard module check the presence of the needed debugger
commands to avoid the error messages in case of them being unavailable.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29472 a95241bf-73f2-0310-859d-f6bbb57e9c96


# d9c6f9a9 01-Feb-2009 Michael Lotz <mmlr@mlotz.ch>

Remove separate GCC4 versions of add_debug_command()/remove_debug_command() and
add the const in any case. As Axel points out these are C functions and we do
not affect binary compatibility by changing their signature.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29124 a95241bf-73f2-0310-859d-f6bbb57e9c96


# c33667d4 01-Feb-2009 Michael Lotz <mmlr@mlotz.ch>

Fixing warnings under GCC4 in preparation to enable -Werror there as well:
* Replaced the use of offsetof() for structs that aren't PODs. Add a
offset_of_member() macro to util/khash.h because that's what it's used for
in our cases.
* Change the signature of add_debugger_command()/remove_debugger_command() on
GCC > 2 to avoid the depricated conversion from string constants to char *.
* Adding some "suggested" parenthesis. I know that not everyone likes that, but
it pointed out at least one bug that is fixed here as well.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29113 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 6179ce79 30-Oct-2008 Axel Dörfler <axeld@pinc-software.de>

* Removed the DEBUG_DEBUGGER_COMMANDS define again, and followed Ingo's
suggestion by adding a "faults" command that now sets the
gInvokeCommandDirectly variable as wished.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28382 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 9521c5ab 30-Oct-2008 Axel Dörfler <axeld@pinc-software.de>

* 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


# 945a6a41 15-Oct-2008 Michael Lotz <mmlr@mlotz.ch>

bonefish + mmlr:
* Add possibility to restart a complete pipe through B_KDEBUG_RESTART_PIPE.
* Implement tail in the kernel debugger making use of the former.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28154 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 46ec2301 12-Aug-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

When in the kernel debugger we do now record the relevant information
(fault address, pc, read/write) when a page fault occurs, and print them
in case this caused the termination of a debugger command.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26949 a95241bf-73f2-0310-859d-f6bbb57e9c96


# a8f9741c 04-Jul-2008 Michael Lotz <mmlr@mlotz.ch>

* Removed -Wno-unused from all KernelMergeObjects in kernel Jamfiles.
* Fixed most of the warnings resulting from that by removing actually not used
variables or moving declaration into the #IF. Left unused functions there
though, as I wouldn't know if they are supposed to be used again.
* Fixed two statements with no effect (clamping to MAX_ANCILLARY_DATA_LEN in
socket.cpp and unsetting fCounterSem in MessagingService.cpp).
* Some style cleanups.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26253 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 1c8de858 01-Jun-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

* Added optional spinlock contention measurement feature. Enabled when
B_DEBUG_SPINLOCK_CONTENTION is defined to 1. It typedefs spinlock to a
structure (thus breaking BeOS binary compatibility), containing a
counter which is incremented whenever a thread has to wait for the
spinlock.
* Added macros for spinlock initialization and access and changed
code using spinlocks accordingly. This breaks compilation for BeOS --
the macros should be defined in the respective compatibility wrappers.
* Added generic syscall to get the spinlock counters for the thread and
the team spinlocks.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25752 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 123dfa78 31-May-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

Enforce 80 columns maximum line length.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25746 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 31044028 31-May-2008 Rene Gollent <anevilyak@gmail.com>

gcc4 build fix.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25745 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 73aa393d 31-May-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

* Introduced pipes in the kernel debugger. The syntax is similar to
pipes in the shell, though the semantics is a little different: The
second command is invoked whenever the first command has written a
complete line. The line is passed as last argument to the second
command. The new command flag B_KDEBUG_PIPE_FINAL_RERUN causes the
second command to be invoked again (with NULL argument) after the
first command is done.
* Added kprintf_unfiltered() and kputs_unfiltered() which bypass the
pipe mechanism and directly print to the bluescreen/serial output.
* Moved most commands from debug.cpp to the new
debug_builtin_commands.cpp.
* B_KDEBUG_DONT_PARSE_ARGUMENTS commands don't get an argument anymore,
if it would consist of white space only.
* Added new debugger command return value B_KDEBUG_ERROR, which
indicates that executing the command failed. This return code will
abort a complete pipe.
* Since debugger commands can nest (i.e. one command can invoke another
one) the setjmp()/longjmp() mechanism to restore the stack after a
page fault in a command needs more than one jump buffer.
* Added abort_debugger_command(), which longjmp()s out of the currently
executed command. This will also abort the current pipe.
* When pagination is enabled pressing "a" will abort the running command
(as opposed to "q" which only disables the blue screen output, but
lets the command continue).
* Added debugger commands:
- "grep" which can be used to filter output by pattern. Removed the
"filter" command and the underlying mechanism that did that before.
- "head" which prints only the first lines of output of another
command.
- "wc" counts lines, words, and characters of another command's
output.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25744 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 90242589 20-Jan-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

Made kputs() available in the kernel and used it for printing debugger
command usage texts, which can be too long for kprintf().


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23677 a95241bf-73f2-0310-859d-f6bbb57e9c96


# e6a8dfa8 17-Jan-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

The usage string directly printed by print_debugger_command() and
invoke_debugger_command() is now automatically preceded by
"usage: <command name>", so the string passed to
add_debugger_command_etc() shouldn't contain it anymore.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23584 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 8a90d12e 16-Jan-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

* Added add_debugger_command_etc() which is similar to
add_debugger_command(), but additionally takes parameters "usage"
and "flags".
* Added add_debugger_command_alias() which creates another name for an
existing command.
* Added print_debugger_command_usage() to print a command's usage.
* invoke_debugger_command() intercepts invocations with "--help" and
prints the command's usage text, if it is known. If unknown, the
command will be called normally.
* Made use of the new functions in debug.cpp.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23573 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 06f78e9f 16-Jan-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

* Changed the way temporary variables work. They won't be unset before
a command is executed anymore. Instead the least recently used
temporary variable is overwritten, if there's no free slot for a new
temporary variable.
* Removed the special handling for the command result variable ("_"). It
just works like any other temporary variable, now.
* Individual temporary variables can be removed (e.g. using the "unset"
command).
* Added unset_all_debug_variables() and "unset_all" command to unset
all persistent and temporary variables.
* Removed remove_all_temporary_debug_variables and renamed
remove_debug_variable() to unset_debug_variable().


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23568 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 855ab2b3 16-Jan-2008 Axel Dörfler <axeld@pinc-software.de>

* 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


# 3b4fa166 15-Jan-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

* Implemented parse_expression(). The back-end is an expression parser
that is a little more powerful than BeOS'. It features:
- Persistent and temporary uint64 variables. The former kind is set
only by the user. The latter (those prefixed "_") can be set
automatically by commands, thus e.g. making it easier to access
members of a dumped structure. They are unset when the next command
is invoked. The special temporary variable "_" is defined as a
command's return value.
- Expressions can contain nested command invocations using brackets
("[ ... ]").
- Command lines are parsed by the expression parser, too. They can
contain command invocations (in brackets) and expressions (in
parentheses).
* Added debugger commands:
- expr: Evaluates the given expression and prints the result.
- unset: Undefines a variable.
- vars: Prints the values of all defined variables.
* Moved debugger command code into its own source file.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23546 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 0e35d5d2e5ef3d288e056d60ef1b16dc399eaa0c 12-Dec-2011 John Scipione <jscipione@gmail.com>

Change instances of wether in comments to whether. No functional change intended.


# a4c21b1c82a3995944b59f0a3e318cefb9c443aa 22-Feb-2011 Philippe Houdoin <philippe.houdoin@gmail.com>

Check if the name is already used in add_debugger_command*() and reject
duplicate attempt(s).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40611 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 3ce26345338e484601eb0a6598414d22cb73c9cc 30-Dec-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

* Fixed the semantics of [v]snprintf(): If the buffer is not large enough,
the function shall nevertheless return the length of the string that would
be written, if the buffer were large enough.
Added a touch of C++ while doing that. :-)
* Fixed the instances in boot loader, kernel, and kernel modules where the
wrong semantics were expected. The majority of uses actually.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34826 a95241bf-73f2-0310-859d-f6bbb57e9c96


# ea2abd110bd6a4518a954477562e2dd94a5fef9d 02-Aug-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

* Renamed the ROUNDOWN macro to ROUNDDOWN. Also changed the implementation of
ROUNDUP to use '*' and '/' -- the compiler will optimize that for powers of
two anyway and this implementation works for other numbers as well.
* The thread::fault_handler use in C[++] code was broken with gcc 4. At least
when other functions were invoked. Trying to trick the compiler wasn't a
particularly good idea anyway, since the next compiler version could break
the trick again. So the general policy is to use the fault handlers only in
assembly code where we have full control. Changed that for x86 (save for the
vm86 mode, which has a similar mechanism), but not for the other
architectures.
* Introduced fault_handler, fault_handler_stack_pointer, and fault_jump_buffer
fields in the cpu_ent structure, which must be used instead of
thread::fault_handler in the kernel debugger. Consequently user_memcpy() must
not be used in the kernel debugger either. Introduced a debug_memcpy()
instead.
* Introduced debug_call_with_fault_handler() function which calls a function
in a setjmp() and fault handler context. The architecture specific backend
arch_debug_call_with_fault_handler() has only been implemented for x86 yet.
* Introduced debug_is_kernel_memory_accessible() for use in the kernel
debugger. It determines whether a range of memory can be accessed in the
way specified. The architecture specific back end
arch_vm_translation_map_is_kernel_page_accessible() has only been implemented
for x86 yet.
* Added arch_debug_unset_current_thread() (only implemented for x86) to unset
the current thread pointer in the kernel debugger. When entering the kernel
debugger we do some basic sanity checks of the currently set thread structure
and unset it, if they fail. This allows certain commands (most importantly
the stack trace command) to avoid accessing the thread structure.
* x86: When handling a double fault, we do now install a special handler for
page faults. This allows us to gracefully catch faulting commands, even if
e.g. the thread structure is toast.

We are now in much better shape to deal with double faults. Hopefully avoiding
the triple faults that some people have been experiencing on their hardware
and ideally even allowing to use the kernel debugger normally.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32073 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 360d4974b96a6821dbf4b31e0662bfcd31f713bc 02-Jun-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

Replaced the temporary storage used in the kernel debug command parser. We now
have a simple dedicated heap for the kernel debugger with stacked allocation
pools (deleting a pool frees all memory allocated in it). The heap should
eventually be used for all commands that need temporary storage too large for
the stack instead of each using its own static buffer.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30949 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 5b9d5a2ec9b28fb9d787dc264e8903a4dbc3fb55 10-Mar-2009 Michael Lotz <mmlr@mlotz.ch>

* Add has_debugger_command() so whether or not a debugger command is available
can be checked.
* Make the usb_keyboard module check the presence of the needed debugger
commands to avoid the error messages in case of them being unavailable.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29472 a95241bf-73f2-0310-859d-f6bbb57e9c96


# d9c6f9a92c5e979d7e409a7ab577759419f7c9cd 01-Feb-2009 Michael Lotz <mmlr@mlotz.ch>

Remove separate GCC4 versions of add_debug_command()/remove_debug_command() and
add the const in any case. As Axel points out these are C functions and we do
not affect binary compatibility by changing their signature.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29124 a95241bf-73f2-0310-859d-f6bbb57e9c96


# c33667d400856680a8e0122300861eda77d1847a 01-Feb-2009 Michael Lotz <mmlr@mlotz.ch>

Fixing warnings under GCC4 in preparation to enable -Werror there as well:
* Replaced the use of offsetof() for structs that aren't PODs. Add a
offset_of_member() macro to util/khash.h because that's what it's used for
in our cases.
* Change the signature of add_debugger_command()/remove_debugger_command() on
GCC > 2 to avoid the depricated conversion from string constants to char *.
* Adding some "suggested" parenthesis. I know that not everyone likes that, but
it pointed out at least one bug that is fixed here as well.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29113 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 6179ce7957df004d50d5cae22b389ded58104d2f 30-Oct-2008 Axel Dörfler <axeld@pinc-software.de>

* Removed the DEBUG_DEBUGGER_COMMANDS define again, and followed Ingo's
suggestion by adding a "faults" command that now sets the
gInvokeCommandDirectly variable as wished.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28382 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 9521c5abb6ec6cccb2899ac749f471f6c3f39005 30-Oct-2008 Axel Dörfler <axeld@pinc-software.de>

* 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


# 945a6a41acb998632f3bdfebaa5d666db2ff4df5 15-Oct-2008 Michael Lotz <mmlr@mlotz.ch>

bonefish + mmlr:
* Add possibility to restart a complete pipe through B_KDEBUG_RESTART_PIPE.
* Implement tail in the kernel debugger making use of the former.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28154 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 46ec23016212f35b99bc1ba02b7421eb287033e1 12-Aug-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

When in the kernel debugger we do now record the relevant information
(fault address, pc, read/write) when a page fault occurs, and print them
in case this caused the termination of a debugger command.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26949 a95241bf-73f2-0310-859d-f6bbb57e9c96


# a8f9741c8c2815234e87b78167738057b976b537 04-Jul-2008 Michael Lotz <mmlr@mlotz.ch>

* Removed -Wno-unused from all KernelMergeObjects in kernel Jamfiles.
* Fixed most of the warnings resulting from that by removing actually not used
variables or moving declaration into the #IF. Left unused functions there
though, as I wouldn't know if they are supposed to be used again.
* Fixed two statements with no effect (clamping to MAX_ANCILLARY_DATA_LEN in
socket.cpp and unsetting fCounterSem in MessagingService.cpp).
* Some style cleanups.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26253 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 1c8de8581b66c14ea94bccd7ddcea99291955796 01-Jun-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

* Added optional spinlock contention measurement feature. Enabled when
B_DEBUG_SPINLOCK_CONTENTION is defined to 1. It typedefs spinlock to a
structure (thus breaking BeOS binary compatibility), containing a
counter which is incremented whenever a thread has to wait for the
spinlock.
* Added macros for spinlock initialization and access and changed
code using spinlocks accordingly. This breaks compilation for BeOS --
the macros should be defined in the respective compatibility wrappers.
* Added generic syscall to get the spinlock counters for the thread and
the team spinlocks.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25752 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 123dfa78e5d37da67237097964aa92eea06d9feb 31-May-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

Enforce 80 columns maximum line length.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25746 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 310440281524c76a75fdc4906c980ebbc37c9c1b 31-May-2008 Rene Gollent <anevilyak@gmail.com>

gcc4 build fix.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25745 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 73aa393d737b25eb29a5200d5f6e6340000affee 31-May-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

* Introduced pipes in the kernel debugger. The syntax is similar to
pipes in the shell, though the semantics is a little different: The
second command is invoked whenever the first command has written a
complete line. The line is passed as last argument to the second
command. The new command flag B_KDEBUG_PIPE_FINAL_RERUN causes the
second command to be invoked again (with NULL argument) after the
first command is done.
* Added kprintf_unfiltered() and kputs_unfiltered() which bypass the
pipe mechanism and directly print to the bluescreen/serial output.
* Moved most commands from debug.cpp to the new
debug_builtin_commands.cpp.
* B_KDEBUG_DONT_PARSE_ARGUMENTS commands don't get an argument anymore,
if it would consist of white space only.
* Added new debugger command return value B_KDEBUG_ERROR, which
indicates that executing the command failed. This return code will
abort a complete pipe.
* Since debugger commands can nest (i.e. one command can invoke another
one) the setjmp()/longjmp() mechanism to restore the stack after a
page fault in a command needs more than one jump buffer.
* Added abort_debugger_command(), which longjmp()s out of the currently
executed command. This will also abort the current pipe.
* When pagination is enabled pressing "a" will abort the running command
(as opposed to "q" which only disables the blue screen output, but
lets the command continue).
* Added debugger commands:
- "grep" which can be used to filter output by pattern. Removed the
"filter" command and the underlying mechanism that did that before.
- "head" which prints only the first lines of output of another
command.
- "wc" counts lines, words, and characters of another command's
output.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25744 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 902425896d6b7f001f68d54708884e2727b837fc 20-Jan-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

Made kputs() available in the kernel and used it for printing debugger
command usage texts, which can be too long for kprintf().


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23677 a95241bf-73f2-0310-859d-f6bbb57e9c96


# e6a8dfa805352a70636d964b29b38f3022ffc083 17-Jan-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

The usage string directly printed by print_debugger_command() and
invoke_debugger_command() is now automatically preceded by
"usage: <command name>", so the string passed to
add_debugger_command_etc() shouldn't contain it anymore.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23584 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 8a90d12e268b539b26b461a9e4e2560acdf91e2b 16-Jan-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

* Added add_debugger_command_etc() which is similar to
add_debugger_command(), but additionally takes parameters "usage"
and "flags".
* Added add_debugger_command_alias() which creates another name for an
existing command.
* Added print_debugger_command_usage() to print a command's usage.
* invoke_debugger_command() intercepts invocations with "--help" and
prints the command's usage text, if it is known. If unknown, the
command will be called normally.
* Made use of the new functions in debug.cpp.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23573 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 06f78e9fb73f0043707c177e03b976a4f94115c9 16-Jan-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

* Changed the way temporary variables work. They won't be unset before
a command is executed anymore. Instead the least recently used
temporary variable is overwritten, if there's no free slot for a new
temporary variable.
* Removed the special handling for the command result variable ("_"). It
just works like any other temporary variable, now.
* Individual temporary variables can be removed (e.g. using the "unset"
command).
* Added unset_all_debug_variables() and "unset_all" command to unset
all persistent and temporary variables.
* Removed remove_all_temporary_debug_variables and renamed
remove_debug_variable() to unset_debug_variable().


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23568 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 855ab2b31289278d801aba118ea904726ad9d8de 16-Jan-2008 Axel Dörfler <axeld@pinc-software.de>

* 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


# 3b4fa1664e6fb9ba781ee509bf725774937eeaeb 15-Jan-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

* Implemented parse_expression(). The back-end is an expression parser
that is a little more powerful than BeOS'. It features:
- Persistent and temporary uint64 variables. The former kind is set
only by the user. The latter (those prefixed "_") can be set
automatically by commands, thus e.g. making it easier to access
members of a dumped structure. They are unset when the next command
is invoked. The special temporary variable "_" is defined as a
command's return value.
- Expressions can contain nested command invocations using brackets
("[ ... ]").
- Command lines are parsed by the expression parser, too. They can
contain command invocations (in brackets) and expressions (in
parentheses).
* Added debugger commands:
- expr: Evaluates the given expression and prints the result.
- unset: Undefines a variable.
- vars: Prints the values of all defined variables.
* Moved debugger command code into its own source file.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23546 a95241bf-73f2-0310-859d-f6bbb57e9c96