From c9f7b32fbd4ea99da7fdf435b83ce0e582f33c08 Mon Sep 17 00:00:00 2001 From: Michael Dusan Date: Tue, 17 Jan 2023 18:14:53 -0500 Subject: netbsd: add mcontext_t for aarch64 - test `lib/std/std.zig` passes - stack traces work --- src/crash_report.zig | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/crash_report.zig b/src/crash_report.zig index 6f657a9e01..1bc0dd7626 100644 --- a/src/crash_report.zig +++ b/src/crash_report.zig @@ -237,11 +237,13 @@ fn handleSegfaultPosix(sig: i32, info: *const os.siginfo_t, ctx_ptr: ?*const any const ctx = @ptrCast(*const os.ucontext_t, @alignCast(@alignOf(os.ucontext_t), ctx_ptr)); const ip = switch (native_os) { .macos => @intCast(usize, ctx.mcontext.ss.pc), + .netbsd => @intCast(usize, ctx.mcontext.gregs[os.REG.PC]), else => @intCast(usize, ctx.mcontext.pc), }; // x29 is the ABI-designated frame pointer const bp = switch (native_os) { .macos => @intCast(usize, ctx.mcontext.ss.fp), + .netbsd => @intCast(usize, ctx.mcontext.gregs[os.REG.FP]), else => @intCast(usize, ctx.mcontext.regs[29]), }; break :ctx StackContext{ .exception = .{ .bp = bp, .ip = ip } }; -- cgit v1.2.3