Kernel: Move dump_stacktrace from panic -> debug

This commit is contained in:
Bananymous
2023-01-25 22:28:18 +02:00
parent e87026f01d
commit aa0757e135
5 changed files with 20 additions and 28 deletions

View File

@@ -28,5 +28,6 @@
namespace Debug
{
void DumpStackTrace();
void putchar(char);
}

View File

@@ -8,15 +8,13 @@
namespace Kernel
{
void dump_stacktrace();
template<typename... Args>
__attribute__((__noreturn__))
static void PanicImpl(const char* file, int line, const char* message, Args... args)
{
kprintln("\e[31mKernel panic at {}:{}\e[m", file, line);
derrorln("Kernel panic at {}:{}", file, line);
derrorln(message, args...);
dump_stacktrace();
Debug::DumpStackTrace();
asm volatile("cli");
for (;;)
asm volatile("hlt");