feat: more improvements to panic handling

Follow on panics no longer confuse the panic output and the just in
time debugger now works properly on the local tty.
This commit is contained in:
CJ van den Berg 2025-07-03 16:23:29 +02:00
parent 14dce0a10b
commit e9735d9425
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9
5 changed files with 42 additions and 12 deletions

View file

@ -1380,7 +1380,7 @@ pub fn attachSegfaultHandler() void {
updateSegfaultHandler(&act);
}
fn resetSegfaultHandler() void {
pub fn resetSegfaultHandler() void {
if (native_os == .windows) {
if (windows_segfault_handle) |handle| {
assert(windows.kernel32.RemoveVectoredExceptionHandler(handle) != 0);
@ -1438,7 +1438,7 @@ pub fn handleSegfaultPosix(sig: i32, info: *const posix.siginfo_t, ctx_ptr: ?*an
posix.abort();
}
fn dumpSegfaultInfoPosix(sig: i32, code: i32, addr: usize, ctx_ptr: ?*anyopaque) void {
pub fn dumpSegfaultInfoPosix(sig: i32, code: i32, addr: usize, ctx_ptr: ?*anyopaque) void {
const stderr = io.getStdErr().writer();
_ = switch (sig) {
posix.SIG.SEGV => if (native_arch == .x86_64 and native_os == .linux and code == 128) // SI_KERNEL