From 2cf36a1ca232f0e296ea81fb6870d823a33ebdf0 Mon Sep 17 00:00:00 2001 From: Timon Kruiper Date: Tue, 3 May 2022 02:08:47 +0200 Subject: Kernel: Panic when an assertion is failed in aarch64 Kernel This in turn makes sure that we get a nice backtrace when an assertion failed, or when a VERIFY_NOT_REACHED() is hit. --- Kernel/Arch/aarch64/init.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'Kernel') diff --git a/Kernel/Arch/aarch64/init.cpp b/Kernel/Arch/aarch64/init.cpp index ddbe4308e7..19577ea37b 100644 --- a/Kernel/Arch/aarch64/init.cpp +++ b/Kernel/Arch/aarch64/init.cpp @@ -19,6 +19,7 @@ #include #include #include +#include static void draw_logo(); static u32 query_firmware_version(); @@ -91,12 +92,15 @@ void __stack_chk_fail() Prekernel::halt(); } +using namespace Kernel; + [[noreturn]] void __assertion_failed(char const* msg, char const* file, unsigned line, char const* func) { critical_dmesgln("ASSERTION FAILED: {}", msg); critical_dmesgln("{}:{} in {}", file, line, func); - Prekernel::halt(); + // Used for printing a nice backtrace! + PANIC("Aborted"); } extern "C" void exception_common(TrapFrame const* const trap_frame) -- cgit v1.2.3