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/kernel.o \
kernel/kmalloc.o \
kernel/Panic.o \
kernel/PIC.o \
kernel/PIT.o \
kernel/RTC.o \

View File

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

View File

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