btrfs: Attempt to fix GCC2 build.
[haiku.git] / src / system / kernel / debug / debug_commands.h
blob4b521f50a6b807d699f81907e5c89a55014074ff
1 /*
2 * Copyright 2008, Ingo Weinhold, ingo_weinhold@gmx.de
3 * Distributed under the terms of the MIT License.
4 */
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 **);
18 const char* name;
19 const char* description;
20 const char* usage;
21 uint32 flags;
22 } debugger_command;
24 typedef struct debugger_command_pipe_segment {
25 int32 index;
26 debugger_command* command;
27 int argc;
28 char** argv;
29 int32 invocations;
30 uint32 user_data[8]; // can be used by the command
31 } debugger_command_pipe_segment;
33 typedef struct debugger_command_pipe {
34 int32 segment_count;
35 debugger_command_pipe_segment segments[MAX_DEBUGGER_COMMAND_PIPE_LENGTH];
36 bool broken;
37 } debugger_command_pipe;
39 extern bool gInvokeCommandDirectly;
41 #ifdef __cplusplus
42 extern "C" {
43 #endif
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,
48 bool& ambiguous);
49 bool in_command_invocation(void);
51 int invoke_debugger_command(struct debugger_command *command, int argc,
52 char** argv);
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();
62 #ifdef __cplusplus
63 } // extern "C"
64 #endif
67 #endif // _KERNEL_DEBUG_COMMANDS_H