Original: http://peeterjoot.wordpress.com/2010/07/07/avoiding-gdb-signal-noise/
A Quick note for the future reference (recorded elsewhere and subsequently lost).
Suppose your program handles a signal this GDB intercepts by default, like the following example
(GDB) Ccontinuing.program received signal SIGUSR1, User defined signal 1. [Switching to Thread 47133440862528 (LWP 4833)]0x00002ade149d6baa in Semtimedop () from/lib64/libc.so.6(GDB) c
You can hit ' C ' to continue at the this point, but if it happens repeatedly in various threads (as if one thread is Callin G Pthread_kill () to force each other thread in turn to dump it stack and stuff) This repeated ' C ' ing can be a bit of a PA In.
For the same SIGUSR1 example above, you can query the GDB handler rules like so:
(GDB) Info signal sigusr1signal Stop Print Pass to program DescriptionSIGUSR1 Yes Yes User defined signal 1
And if deemed to is of interest, where you just want your program to continue without prompting or spamming, something Like the following does the trick:
(GDB) handle SIGUSR1 noprint nostopsignal Stop Print Pass to program DescriptionSIGUSR1 no No Yes User defined signal 1
??