commit 3abaeacd1f1f52b1415feaee0309a0bb0e0b8c07
parent 2459709ee594bb99c0ebc759c36d6a3a8d89df03
Author: Drew DeVault <sir@cmpwn.com>
Date: Sun, 5 Jan 2025 13:23:56 +0100
debug: swap in default abort handler on begin_fatal
Signed-off-by: Drew DeVault <sir@cmpwn.com>
Diffstat:
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/debug/abort.ha b/debug/abort.ha
@@ -5,8 +5,10 @@ use debug::image;
use fmt;
use rt;
+let default_abort = null: *rt::abort_handler;
+
@init fn init_abort() void = {
- rt::onabort(&debug_abort);
+ default_abort = rt::onabort(&debug_abort);
};
// Note: take care not to get into an abort loop when working on this code
diff --git a/debug/malloc.ha b/debug/malloc.ha
@@ -13,6 +13,7 @@ let heap = rt::EMPTY_HEAP;
fn begin_fatal() void = {
signal::resetall();
rt::setheap(&heap);
+ rt::onabort(default_abort);
};
// Enables the debug:: heap.