Tuesday, December 21, 2010

Gdb Tips #2

Signals

info signals

info handle

Print a table of all the kinds of signal and how Gdb has been told to hanlde each one.

handle signal [keywords...]

Change the way Gdb handles signal signal.

The keywords allowed by handle are:

nostop – Not stop the program when this signal happens

stop - Stop the program when this signal happens

print - Print a message when this signal happens

noprint – Not mention the occurrence of the signal at all

pass/noignore – Allow your program to see this signal and handle it

nopass/ignore – Not allow your program to see this signal


When a signal stops your program, the signal is not visible to the program until you continue.

Your program sees the signal then , if pass is in effect for the signal in question.

So after Gdb reports a signal, you can use the handle command with pass or nopass to control whether your program sees that signal when you continue.