Show crash reports on SIGSYS

This will help make it easier to troubleshoot ABI breakages with on
operating systems that, unlike Linux don't have ironclad guarantees
to not break userspace.
This commit is contained in:
Justine Tunney 2022-06-23 13:01:01 -07:00
parent a4601a24d3
commit 44da16255a
11 changed files with 83 additions and 19 deletions

View file

@ -164,8 +164,17 @@ systemfive_bsdscrub:
systemfive_bsd:
cmp $0xfff,%ax
je systemfive_enosys
mov %rcx,%r10 # note: we do not create a stack frame
mov %rcx,%r10
push %rbx
push 32(%rsp)
push 24(%rsp)
push 16(%rsp)
mov %rax,%rbx # save ordinal for SIGSYS crash report
syscall # bsd will need arg on stack sometimes
pop %rbx
pop %rbx
pop %rbx
pop %rbx
jc systemfive_errno # bsd sets carry flag if %rax is errno
ret
.endfn systemfive_bsd