diff options
| author | Michael Dusan <michael.dusan@gmail.com> | 2023-01-17 18:14:53 -0500 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2023-01-18 02:50:11 -0500 |
| commit | c9f7b32fbd4ea99da7fdf435b83ce0e582f33c08 (patch) | |
| tree | 0d777b728b0ae376990048059f99a42fa535a7fe /lib/std/debug.zig | |
| parent | 7f604b6f48905faf0bbe1ad795b53aeb11332063 (diff) | |
| download | zig-c9f7b32fbd4ea99da7fdf435b83ce0e582f33c08.tar.gz zig-c9f7b32fbd4ea99da7fdf435b83ce0e582f33c08.zip | |
netbsd: add mcontext_t for aarch64
- test `lib/std/std.zig` passes
- stack traces work
Diffstat (limited to 'lib/std/debug.zig')
| -rw-r--r-- | lib/std/debug.zig | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/std/debug.zig b/lib/std/debug.zig index 4d9907672d..f498cb4807 100644 --- a/lib/std/debug.zig +++ b/lib/std/debug.zig @@ -1985,11 +1985,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]), }; dumpStackTraceFromBase(bp, ip); |
