netbsd: add mcontext_t for aarch64
- test `lib/std/std.zig` passes - stack traces work
This commit is contained in:
committed by
Andrew Kelley
parent
7f604b6f48
commit
c9f7b32fbd
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user