forked from Bananymous/banan-os
Kernel: Move dump_backtrace() out of arch.
I discovered __builtin_frame_address()
This commit is contained in:
parent
fbfb3d6b70
commit
6ec4ba3dc9
|
@ -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 \
|
||||||
|
|
|
@ -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 \
|
||||||
|
|
|
@ -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)
|
||||||
{
|
{
|
Loading…
Reference in New Issue