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.
Содержание ENTERPRISE LINUX 4 - DEVELOPER TOOLS GUIDE
Страница 1: ...Red Hat Enterprise Linux 4 Debugging with gdb ...
Страница 12: ...2 Chapter 1 Debugging with gdb ...
Страница 28: ...18 Chapter 4 Getting In and Out of gdb ...
Страница 34: ...24 Chapter 5 gdb Commands ...
Страница 44: ...34 Chapter 6 Running Programs Under gdb ...
Страница 68: ...58 Chapter 8 Examining the Stack ...
Страница 98: ...88 Chapter 10 Examining Data ...
Страница 112: ...102 Chapter 12 Tracepoints ...
Страница 118: ...108 Chapter 13 Debugging Programs That Use Overlays ...
Страница 138: ...128 Chapter 14 Using gdb with Different Languages ...
Страница 144: ...134 Chapter 15 Examining the Symbol Table ...
Страница 170: ...160 Chapter 19 Debugging remote programs ...
Страница 198: ...188 Chapter 21 Controlling gdb ...
Страница 204: ...194 Chapter 22 Canned Sequences of Commands ...
Страница 206: ...196 Chapter 23 Command Interpreters ...
Страница 216: ...206 Chapter 25 Using gdb under gnu Emacs ...
Страница 296: ...286 Chapter 27 gdb Annotations ...
Страница 300: ...290 Chapter 28 Reporting Bugs in gdb ...
Страница 322: ...312 Chapter 30 Using History Interactively ...
Страница 362: ...352 Appendix D gdb Remote Serial Protocol ...
Страница 380: ...370 Appendix F GNU GENERAL PUBLIC LICENSE ...
Страница 386: ...376 Appendix G GNU Free Documentation License ...
Страница 410: ......