From 3ac3d547884eef1bf70625dda912064228a10e93 Mon Sep 17 00:00:00 2001 From: apio Date: Tue, 10 Jan 2023 19:02:16 +0100 Subject: [PATCH] luna: Make check() and expect() output errors in userspace --- luna/src/Check.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/luna/src/Check.cpp b/luna/src/Check.cpp index b57856e7..5d706837 100644 --- a/luna/src/Check.cpp +++ b/luna/src/Check.cpp @@ -1,6 +1,11 @@ #include -_weak [[noreturn]] bool __check_failed(const char*, const char*, const char*, const char*) +#include +#include + +_weak [[noreturn]] bool __check_failed(const char* file, const char* line, const char* func, const char* expr) { - __builtin_trap(); + // FIXME: Output to standard error instead of standard output. + printf("Check failed at %s:%s in %s: %s\n", file, line, func, expr); + abort(); }