I have a debugger that I am porting over to *bsd from linux. Currently, I am working on the OpenBSD version.
Under certain conditions I would like to know the details of the signal that was delivered. For example, suppose a SIGSEGV was delivered, I'd like to know what the faulting address was, and if possible, if it was a read or write.
Another example is if I recieve a trap, was it a single step event? or maybe an INT3 opcode.
On linux I get get this information by calling:
ptrace(PTRACE_GETSIGINFO, pid, 0, &siginfo);
This works great since it lets me have access to just about everything I could possibly want to know about the signal. There does not appear to be an equivalent on OpenBSD. I took a look at kinfo_proc
and kinfo_proc2
which are accessible using the KVM API, but nothing really jumps out at me as having the same type of information as a siginfo_t does. What would be the correct way to get at this information?