Kernel: Move dump_backtrace() out of arch.

I discovered __builtin_frame_address()
This commit is contained in:
Bananymous 2023-01-22 03:00:13 +02:00
parent fbfb3d6b70
commit 6ec4ba3dc9
3 changed files with 3 additions and 4 deletions

View File

@ -36,6 +36,7 @@ kernel/font.o \
kernel/Input.o \ kernel/Input.o \
kernel/kernel.o \ kernel/kernel.o \
kernel/kmalloc.o \ kernel/kmalloc.o \
kernel/Panic.o \
kernel/PIC.o \ kernel/PIC.o \
kernel/PIT.o \ kernel/PIT.o \
kernel/RTC.o \ kernel/RTC.o \

View File

@ -9,6 +9,5 @@ $(ARCHDIR)/boot.o \
$(ARCHDIR)/CPUID.o \ $(ARCHDIR)/CPUID.o \
$(ARCHDIR)/IDT.o \ $(ARCHDIR)/IDT.o \
$(ARCHDIR)/MMU.o \ $(ARCHDIR)/MMU.o \
$(ARCHDIR)/Panic.o \
$(ARCHDIR)/VESA.o \ $(ARCHDIR)/VESA.o \

View File

@ -8,11 +8,10 @@ namespace Kernel
struct stackframe struct stackframe
{ {
stackframe* ebp; stackframe* ebp;
uint32_t eip; uint64_t eip;
}; };
stackframe* frame; stackframe* frame = (stackframe*)__builtin_frame_address(0);
asm volatile("movl %%ebp, %0" : "=r"(frame));
BAN::Formatter::print(Serial::serial_putc, "\e[36mStack trace:\r\n"); BAN::Formatter::print(Serial::serial_putc, "\e[36mStack trace:\r\n");
while (frame) while (frame)
{ {