[Qt-interest] Handling system signals
Colin S. Miller
no-spam-thank-you at csmiller.demon.co.uk
Thu Oct 29 12:39:57 CET 2009
Scott Sibley wrote:
> No, GDB doesn't catch ctrl-c. The program does, that's why it exits. GDB
> did not stop the program. Trust me, without GDB, the program is
> crashing. And it would be a poor design for GDB to take over signal
> handling, utterly confusing the boundary between GDB and program. GDB
> should not handle any signals the program is capable of handling,
> otherwise debugging the program for signals is not possible.
>
Scott,
Au contraire, mon amie.
(gdb) inf sig SIGINT
Signal Stop Print Pass to program Description
SIGINT Yes Yes No Interrupt
(gdb) inf sig SIGTERM
Signal Stop Print Pass to program Description
SIGTERM Yes Yes Yes Terminated
GDB by default catches the SIGINT sent to the debugee,
stops the debugee, prints a message, and then eats the signal.
For SIGTERM gdb catches the signal, prints a message, stops
the debugee, but will send the signal to the debugee when
it is resumed.
This behaviour can be modified for the session using the
"handle" command, or a signal can be sent to the debugee
using the "signal" command.
"signal SIGNULL" can be used to stop any pending signal
to the debugee.
HTH,
Colin S. Miller
More information about the Qt-interest-old
mailing list