aboutsummaryrefslogtreecommitdiff
path: root/src/lib/libc/debug.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libc/debug.c')
-rw-r--r--src/lib/libc/debug.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/lib/libc/debug.c b/src/lib/libc/debug.c
new file mode 100644
index 0000000..dc04fd3
--- /dev/null
+++ b/src/lib/libc/debug.c
@@ -0,0 +1,18 @@
+#include <stdbool.h>
+
+#include <kogata/debug.h>
+#include <kogata/syscall.h>
+
+void sys_panic(const char* msg, const char* file, int line) {
+ dbg_printf("PANIC in user process\n %s\n at %s:%d\n", msg, file, line);
+ exit(-1);
+ while(true);
+}
+
+void sys_panic_assert(const char* assert, const char* file, int line) {
+ dbg_printf("ASSERT FAILED in user process\n %s\n at %s:%d\n", assert, file, line);
+ exit(-1);
+ while(true);
+}
+
+/* vim: set ts=4 sw=4 tw=0 noet :*/