Access to siginfo for the signal from debugger

Kostik Belousov kostikbel at gmail.com
Thu Jul 1 21:27:44 UTC 2010


On Thu, Jul 01, 2010 at 05:05:26PM -0400, John Baldwin wrote:
> On Thursday 01 July 2010 09:42:17 am Kostik Belousov wrote:
> > Hi,
> > below is the patch that provides the debugger with access to siginfo
> > of the signal that stopped the debuggee. This allows to see a lot more
> > details for the cause of the process stop. E.g. you can see a fault
> > address if process get SIGSEGV or SIGBUS, you can distinguish between
> > breakpoint-generated SIGTRAP and non-breakpoint, whether the signal
> > was send due to external event etc.
> > 
> > The change to struct ptrace_lwpinfo is backward-compatible in the sense
> > that programs that were compiled with old definition for the struct will
> > work on new kernels.
> 
> Nice!  Does gdb "just work" with these changes or does it need patching as 
> well?
It should "just work", and my testing seems to confirm this. gdb uses
PT_LWPINFO to enumerate the thread ids, and I checked it on mt process.

As I said, the change is ABI backward-compatible, i.e. you do not need
even to recompile the old program for new kernel.

Sure, gdb cannot show additional available information without
modifications.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-arch/attachments/20100701/3ac22e76/attachment.pgp


More information about the freebsd-arch mailing list