2 * Copyright 2008, Ingo Weinhold, ingo_weinhold@gmx.de
3 * Distributed under the terms of the MIT License.
5 #ifndef _KERNEL_DEBUG_COMMANDS_H
6 #define _KERNEL_DEBUG_COMMANDS_H
9 #include <SupportDefs.h>
12 #define MAX_DEBUGGER_COMMAND_PIPE_LENGTH 8
15 typedef struct debugger_command
{
16 struct debugger_command
* next
;
17 int (*func
)(int, char **);
19 const char* description
;
24 typedef struct debugger_command_pipe_segment
{
26 debugger_command
* command
;
30 uint32 user_data
[8]; // can be used by the command
31 } debugger_command_pipe_segment
;
33 typedef struct debugger_command_pipe
{
35 debugger_command_pipe_segment segments
[MAX_DEBUGGER_COMMAND_PIPE_LENGTH
];
37 } debugger_command_pipe
;
39 extern bool gInvokeCommandDirectly
;
45 debugger_command
* next_debugger_command(debugger_command
* command
,
46 const char* prefix
, int prefixLen
);
47 debugger_command
* find_debugger_command(const char* name
, bool partialMatch
,
49 bool in_command_invocation(void);
51 int invoke_debugger_command(struct debugger_command
*command
, int argc
,
53 void abort_debugger_command();
55 int invoke_debugger_command_pipe(debugger_command_pipe
* pipe
);
56 debugger_command_pipe
* get_current_debugger_command_pipe();
57 debugger_command_pipe_segment
* get_current_debugger_command_pipe_segment();
59 debugger_command
* get_debugger_commands();
60 void sort_debugger_commands();
67 #endif // _KERNEL_DEBUG_COMMANDS_H