Add symbol table handling and debug backtrace

This commit is contained in:
Mark
2020-01-29 20:12:52 +02:00
parent 977ca16f82
commit bccd620eec
7 changed files with 148 additions and 5 deletions
+4
View File
@@ -38,6 +38,10 @@
#define kfatal(f, ...) debugf(DEBUG_FATAL, "\033[41m" DEBUG_BASE_FMT f "\033[0m", DEBUG_BASE_ARGS, ##__VA_ARGS__)
#define kprint(l, f, ...) debugf(l, DEBUG_BASE_FMT f, DEBUG_BASE_ARGS, ##__VA_ARGS__)
void debug_symbol_table_set(uintptr_t symtab, uintptr_t strtab, size_t symtab_size, size_t strtab_size);
int debug_symbol_find(uintptr_t addr, const char **name, uintptr_t *base);
void debug_backtrace(uintptr_t rbp, int depth, int limit);
void fmtsiz(char *buf, size_t sz);
void debugc(int level, char c);