CS350 COS
COS
Loading...
Searching...
No Matches
kdebug.h
Go to the documentation of this file.
1
2#ifndef __KDEBUG_H__
3#define __KDEBUG_H__
4
5typedef struct DebugCommand {
6 const char name[40];
7 const char description[80];
8 void (*func)(int, const char **);
10
11#define REGISTER_DBGCMD(_NAME, _DESC, _FUNC) \
12 __attribute__((section(".kdbgcmd"))) \
13 DebugCommand cmd_##_NAME = { #_NAME, _DESC, _FUNC }
14
15void Debug_PrintHex(const char *data, size_t length, off_t off, size_t limit);
16
17// Platform Functions
18uintptr_t db_disasm(uintptr_t loc, bool altfmt);
19
20// Generic Functions
21void Debug_Prompt();
22
23// Helper Functions
24uint64_t Debug_GetValue(uintptr_t addr, int size, bool isSigned);
25void Debug_PrintSymbol(uintptr_t off, int strategy);
26uint64_t Debug_StrToInt(const char *s);
27uint64_t Debug_SymbolToInt(const char *s);
28
29#endif /* __KDEBUG_H__ */
30
uintptr_t db_disasm(uintptr_t loc, bool altfmt)
Definition: disasm.c:1186
uint64_t Debug_SymbolToInt(const char *s)
Definition: debug.c:157
void Debug_PrintSymbol(uintptr_t off, int strategy)
Definition: debug.c:118
uint64_t Debug_StrToInt(const char *s)
Definition: debug.c:124
uint64_t Debug_GetValue(uintptr_t addr, int size, bool isSigned)
Definition: debug.c:81
void Debug_PrintHex(const char *data, size_t length, off_t off, size_t limit)
Definition: debug.c:30
void Debug_Prompt()
Definition: debug.c:248
uint64_t addr
Definition: multiboot.h:1
uint32_t size
Definition: multiboot.h:0
void(* func)(int, const char **)
Definition: kdebug.h:8
const char description[80]
Definition: kdebug.h:7
const char name[40]
Definition: kdebug.h:6
int64_t off_t
Definition: types.h:20
uint64_t uintptr_t
Definition: types.h:16
unsigned long uint64_t
Definition: types.h:13