Assuming you are connected to a running process and are not checking for a core dump, and assuming gdb can access characters, you should be able to call (via gdb) POSIX signal processing functions to determine information such as which signals are blocked and what signal handlers are registers.
For example, to determine whether a handler is registered for the SIGSEGV == 11 signal using the sigaction function, you can use the following:
(gdb) call malloc(sizeof(struct sigaction)) $1 = (void *) 0x... (gdb) call malloc(sizeof(struct sigaction)) $2 = (void *) 0x... (gdb) call memset($2, 0, sizeof(struct sigaction)) ... (gdb) call sigaction(11, $2, $1) $... = 0 (gdb) print *((struct sigaction *)$1) <prints struct sigaction info>
This information should allow you to determine the address of the handler, and then you can simply pass this to the info symbol command to determine which function is used as the handler.
Similar operations can be performed to determine which signals are blocked.
In addition, the special GDB variable $ _siginfo may be useful to you. See here for more information: http://sourceware.org/gdb/onlinedocs/gdb/Signals.html
Although I assumed $ _siginfo was not available for Apple / darwin purposes.
source share