From b316e3b3b7a9fa9890e66f2b6218b5ba7190fdfe Mon Sep 17 00:00:00 2001 From: apio Date: Fri, 16 Dec 2022 20:49:09 +0100 Subject: [PATCH] Print stack trace on assertion fail --- kernel/src/Log.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/kernel/src/Log.cpp b/kernel/src/Log.cpp index d26190b1..b9399326 100644 --- a/kernel/src/Log.cpp +++ b/kernel/src/Log.cpp @@ -118,10 +118,12 @@ static bool g_check_already_failed = false; [[noreturn]] bool __check_failed(const char* file, const char* line, const char* func, const char* expr) { + CPU::disable_interrupts(); if (!g_check_already_failed) { // Avoid endlessly failing when trying to report a failed check. g_check_already_failed = true; kerrorln("ERROR: Check failed at %s:%s, in %s: %s", file, line, func, expr); + CPU::print_stack_trace(); } CPU::efficient_halt(); } \ No newline at end of file