More detailed panic messages

This commit is contained in:
Mark
2020-06-11 17:11:24 +03:00
parent 30f027fd2d
commit 34ece34e01
+7 -1
View File
@@ -7,6 +7,9 @@
#include "sys/debug.h"
void panicf(const char *fmt, ...) {
uintptr_t rbp;
asm volatile ("movq %%rbp, %0":"=r"(rbp));
asm volatile ("cli");
va_list args;
kfatal("--- Panic ---\n");
@@ -14,9 +17,12 @@ void panicf(const char *fmt, ...) {
va_start(args, fmt);
debugs(DEBUG_FATAL, "\033[41m");
debugfv(DEBUG_FATAL, fmt, args);
debugs(DEBUG_FATAL, "\033[0m");
debugs(DEBUG_FATAL, "\n\033[0m");
va_end(args);
kfatal("Call trace:\n");
debug_backtrace(rbp, 0, 10);
kfatal("--- Panic ---\n");
#if defined(AMD64_SMP)