FreeBSD: add mcontext_t for aarch64

What isn't disabled for test-std mostly passes, except for the copysign
and signbit tests for f16. Seemingly related to #14366.
This commit is contained in:
Stephen Gregoratto
2023-01-19 00:55:51 +11:00
committed by Veikka Tuominen
parent 38eebf3c4d
commit 7f635ae7bd
3 changed files with 93 additions and 51 deletions

View File

@@ -1986,12 +1986,14 @@ fn handleSegfaultPosix(sig: i32, info: *const os.siginfo_t, ctx_ptr: ?*const any
const ip = switch (native_os) {
.macos => @intCast(usize, ctx.mcontext.ss.pc),
.netbsd => @intCast(usize, ctx.mcontext.gregs[os.REG.PC]),
.freebsd => @intCast(usize, ctx.mcontext.gpregs.elr),
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]),
.freebsd => @intCast(usize, ctx.mcontext.gpregs.x[os.REG.FP]),
else => @intCast(usize, ctx.mcontext.regs[29]),
};
dumpStackTraceFromBase(bp, ip);