elf loading and userland

This commit is contained in:
Matheus
2022-08-14 20:19:38 -03:00
parent 33a516a611
commit 261d7d3743
13 changed files with 243 additions and 31 deletions
+5 -3
View File
@@ -8,7 +8,6 @@
#define TRACE_MAXDEPTH 10
static void tracestack(uint64_t** addr){
for(size_t depth = 0; depth < TRACE_MAXDEPTH; ++depth){
uint64_t *calleeaddr = *(addr + 1);
@@ -34,8 +33,11 @@ __attribute((noreturn)) void _panic(char* reason, arch_regs *reg){
);
printf("Panic location: %p\n", reg->rip);
printf("Stack trace:\n");
tracestack((uint64_t**)reg->rbp);
if(reg->rbp != 0){
printf("Stack trace:\n");
tracestack((uint64_t**)reg->rbp);
}
}