From b3176b32e62b7615908fa58c99167abbeb58bbc6 Mon Sep 17 00:00:00 2001 From: CJ van den Berg Date: Thu, 3 Jul 2025 15:58:41 +0200 Subject: [PATCH] feat: export debugging signal handlers to zig --- include/thespian/backtrace.h | 4 ++++ src/thespian.zig | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/include/thespian/backtrace.h b/include/thespian/backtrace.h index 3f5a031..c93a082 100644 --- a/include/thespian/backtrace.h +++ b/include/thespian/backtrace.h @@ -12,6 +12,10 @@ void install_remote_debugger(); void install_backtrace(); void install_jitdebugger(); +void sighdl_debugger(int no, siginfo_t * /*sigi*/, void * /*uco*/); +void sighdl_remote_debugger(int no, siginfo_t * /*sigi*/, void * /*uco*/); +void sighdl_backtrace(int no, siginfo_t * /*sigi*/, void * /*uco*/); + #ifdef __cplusplus } #endif diff --git a/src/thespian.zig b/src/thespian.zig index 5097e5a..825f97b 100644 --- a/src/thespian.zig +++ b/src/thespian.zig @@ -21,6 +21,11 @@ pub const install_debugger = c.install_debugger; pub const install_remote_debugger = c.install_remote_debugger; pub const install_backtrace = c.install_backtrace; pub const install_jitdebugger = c.install_jitdebugger; + +pub const sighdl_debugger = c.sighdl_debugger; +pub const sighdl_remote_debugger = c.sighdl_remote_debugger; +pub const sighdl_backtrace = c.sighdl_backtrace; + pub const max_message_size = 8 * 4096; const message_buf_allocator = std.heap.c_allocator; threadlocal var message_buffer: std.ArrayList(u8) = std.ArrayList(u8).init(message_buf_allocator);