1 
2 #ifndef __KDEBUG_H__
3 #define __KDEBUG_H__
4 
5 typedef struct DebugCommand {
6     const char name[40];
7     const char description[80];
8     void (*func)(int, const char **);
9 } DebugCommand;
10 
11 #define REGISTER_DBGCMD(_NAME, _DESC, _FUNC) \
12     __attribute__((section(".kdbgcmd"))) \
13     DebugCommand cmd_##_NAME = { #_NAME, _DESC, _FUNC }
14 
15 void Debug_PrintHex(const char *data, size_t length, off_t off, size_t limit);
16 
17 // Platform Functions
18 uintptr_t db_disasm(uintptr_t loc, bool altfmt);
19 
20 // Generic Functions
21 void Debug_Prompt();
22 
23 // Helper Functions
24 uint64_t Debug_GetValue(uintptr_t addr, int size, bool isSigned);
25 void Debug_PrintSymbol(uintptr_t off, int strategy);
26 uint64_t Debug_StrToInt(const char *s);
27 uint64_t Debug_SymbolToInt(const char *s);
28 
29 #endif /* __KDEBUG_H__ */
30 
31