50
Chapter 7. Stopping and Continuing
program gets from referencing a place in memory far away from all the areas in use;
SIGALRM
occurs
when the alarm clock timer goes off (which happens only if your program has requested an alarm).
Some signals, including
SIGALRM
, are a normal part of the functioning of your program. Others,
such as
SIGSEGV
, indicate errors; these signals are
fatal
(they kill your program immediately) if the
program has not specified in advance some other way to handle the signal.
SIGINT
does not indicate
an error in your program, but it is normally fatal so it can carry out the purpose of the interrupt: to kill
the program.
gdb has the ability to detect any occurrence of a signal in your program. You can tell gdb in advance
what to do for each kind of signal.
Normally, gdb is set up to let the non-erroneous signals like
SIGALRM
be silently passed to your pro-
gram (so as not to interfere with their role in the program’s functioning) but to stop your program
immediately whenever an error signal happens. You can change these settings with the
handle
com-
mand.
info signals
info handle
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.
info handle
is an alias for
info signals
.
handle
signal keywords
...
Change the way gdb handles signal
signal
.
signal
can be the number of a signal or its name
(with or without the
SIG
at the beginning); a list of signal numbers of the form
low
-
high
; or the
word
all
, meaning all the known signals. The
keywords
say what change to make.
The keywords allowed by the
handle
command can be abbreviated. Their full names are:
nostop
{No value for ‘
listitem>GDBN’} should not stop your program when this signal happens. It
may still print a message telling you that the signal has come in.
stop
{No value for ‘
listitem>GDBN’} should stop your program when this signal happens. This
implies the
keyword as well.
{No value for ‘
listitem>GDBN’} should print a message when this signal happens.
noprint
{No value for ‘
listitem>GDBN’} should not mention the occurrence of the signal at all. This
implies the
nostop
keyword as well.
pass
noignore
{No value for ‘
listitem>GDBN’} should allow your program to see this signal; your program
can handle the signal, or else it may terminate if the signal is fatal and not handled.
pass
and
noignore
are synonyms.
Summary of Contents for ENTERPRISE LINUX 4 - DEVELOPER TOOLS GUIDE
Page 1: ...Red Hat Enterprise Linux 4 Debugging with gdb ...
Page 12: ...2 Chapter 1 Debugging with gdb ...
Page 28: ...18 Chapter 4 Getting In and Out of gdb ...
Page 34: ...24 Chapter 5 gdb Commands ...
Page 44: ...34 Chapter 6 Running Programs Under gdb ...
Page 68: ...58 Chapter 8 Examining the Stack ...
Page 98: ...88 Chapter 10 Examining Data ...
Page 112: ...102 Chapter 12 Tracepoints ...
Page 118: ...108 Chapter 13 Debugging Programs That Use Overlays ...
Page 138: ...128 Chapter 14 Using gdb with Different Languages ...
Page 144: ...134 Chapter 15 Examining the Symbol Table ...
Page 170: ...160 Chapter 19 Debugging remote programs ...
Page 198: ...188 Chapter 21 Controlling gdb ...
Page 204: ...194 Chapter 22 Canned Sequences of Commands ...
Page 206: ...196 Chapter 23 Command Interpreters ...
Page 216: ...206 Chapter 25 Using gdb under gnu Emacs ...
Page 296: ...286 Chapter 27 gdb Annotations ...
Page 300: ...290 Chapter 28 Reporting Bugs in gdb ...
Page 322: ...312 Chapter 30 Using History Interactively ...
Page 362: ...352 Appendix D gdb Remote Serial Protocol ...
Page 380: ...370 Appendix F GNU GENERAL PUBLIC LICENSE ...
Page 386: ...376 Appendix G GNU Free Documentation License ...
Page 410: ......