forked from Bananymous/banan-os
Kernel: Move dump_stacktrace from panic -> debug
This commit is contained in:
@@ -5,6 +5,23 @@
|
||||
namespace Debug
|
||||
{
|
||||
|
||||
void DumpStackTrace()
|
||||
{
|
||||
struct stackframe
|
||||
{
|
||||
stackframe* ebp;
|
||||
uintptr_t eip;
|
||||
};
|
||||
|
||||
stackframe* frame = (stackframe*)__builtin_frame_address(0);
|
||||
BAN::Formatter::print(Debug::putchar, "\e[36mStack trace:\r\n");
|
||||
while (frame)
|
||||
{
|
||||
BAN::Formatter::print(Debug::putchar, " {}\r\n", (void*)frame->eip);
|
||||
frame = frame->ebp;
|
||||
}
|
||||
}
|
||||
|
||||
void putchar(char ch)
|
||||
{
|
||||
if (Serial::IsInitialized())
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
#include <kernel/Panic.h>
|
||||
|
||||
namespace Kernel
|
||||
{
|
||||
|
||||
void dump_stacktrace()
|
||||
{
|
||||
struct stackframe
|
||||
{
|
||||
stackframe* ebp;
|
||||
uintptr_t eip;
|
||||
};
|
||||
|
||||
stackframe* frame = (stackframe*)__builtin_frame_address(0);
|
||||
BAN::Formatter::print(Debug::putchar, "\e[36mStack trace:\r\n");
|
||||
while (frame)
|
||||
{
|
||||
BAN::Formatter::print(Debug::putchar, " {}\r\n", (void*)frame->eip);
|
||||
frame = frame->ebp;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user