mirror of
https://github.com/Mathewnd/Astral.git
synced 2026-10-27 12:48:22 +00:00
dbg: map addresses to file+function+offset
Add support for mapping kernel .text addresses into file + function + offset for debugging purposes. Make the backtrace use this new feature.
This commit is contained in:
@@ -4,11 +4,17 @@
|
||||
#include <printf.h>
|
||||
#include <kernel/interrupt.h>
|
||||
#include <arch/backtrace.h>
|
||||
#include <dbg.h>
|
||||
|
||||
static bool paniced = false;
|
||||
|
||||
static bool step_backtrace(void *, void *ip) {
|
||||
printf("%p\n", ip);
|
||||
char *fn, *file;
|
||||
size_t off;
|
||||
|
||||
dbg_get_symbol(ip, &fn, &file, &off);
|
||||
|
||||
printf("%p: %s:%s+%x\n", ip, file, fn, off);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user