
Stopping and Continuing
Motorola
GNU Debugger (GDB)
For More Information On This Product,
Go to: www.freescale.com
D-17
GDB has the ability to detect any occurrence of a signal in the program running under
GDB’s control. You can tell GDB in advance what to do for each kind of signal.
Normally, GDB is set up to ignore non-erroneous signals like SIGALRM (so as not to
interfere with their role in the functioning of the program) but to stop the program
immediately whenever an error signal happens. You can change these settings with the
‘handle’ command. You must specify which signal you are talking about with its number.
info signal
Print a table of all the kinds of signals and how GDB has been told to handle each one.
You can use this to see the signal numbers of all the defined types of signals.
handle signalnum keywords...
Change the way GDB handles signal
signalnum
. The keywords say what change to make.
To use the ‘handle’ command you must know the code number of the signal you are
concerned with. To find the code number, type ‘info signal’ which prints a table of signal
names and numbers.
The keywords allowed by the handle command can be abbreviated. Table D-4 lists their
full names:
Table D-4. Keywords
Keyword
Description
stop
GDB should stop the program when this signal happens. This implies the ‘print’ keyword as well.
print
GDB should print a message when this signal happens.
nostop
GDB should not stop the program when this signal happens. It may still print a message telling
you that the signal has come in.
noprint
GDB should not mention the occurrence of the signal at all. This implies the ‘nostop’ keyword as
well.
pass
GDB should allow the program to see this signal; the program will be able to handle the signal,
or may be terminated if the signal is fatal and not handled.
nopass
GDB should not allow the program to see this signal.When a signal has been set to stop the
program, the program cannot see the signal until you continue. It will see the signal then, if
‘pass’ is in effect for the signal in question at that time. In other words, after GDB reports a
signal, you can use the ‘handle’ command with ‘pass’ or ‘nopass’ to control whether that signal
will be seen by the program when you later continue it.You can also use the ‘signal’ command to
prevent the program from seeing a signal, or cause it to see a signal it normally would not see,
or to give it any signal at any time. See section Signaling.
F
Freescale Semiconductor, Inc.
n
.