diff options
author | Tom Tromey <tromey@redhat.com> | 2013-01-16 17:31:40 +0000 |
---|---|---|
committer | Tom Tromey <tromey@redhat.com> | 2013-01-16 17:31:40 +0000 |
commit | ab04a2af2bacfc1062c907630bee6e345dbd2ea9 (patch) | |
tree | 12d3019d08999c1decb65cab0a6f1496f8daaf94 /gdb/doc | |
parent | 8ac3646fbbb5f1e0442caa55559513d593136f8c (diff) | |
download | gdb-ab04a2af2bacfc1062c907630bee6e345dbd2ea9.zip gdb-ab04a2af2bacfc1062c907630bee6e345dbd2ea9.tar.gz gdb-ab04a2af2bacfc1062c907630bee6e345dbd2ea9.tar.bz2 |
2013-01-03 Pedro Alves <palves@redhat.com>
Tom Tromey <tromey@redhat.com>
PR cli/7221:
* NEWS: Add "catch signal".
* breakpoint.c (base_breakpoint_ops): No longer static.
(bpstat_explains_signal): New function.
(init_catchpoint): No longer static.
(base_breakpoint_explains_signal): New function.
(base_breakpoint_ops): Initialize new field.
* breakpoint.h (enum bpstat_signal_value): New.
(struct breakpoint_ops) <explains_signal>: New field.
(bpstat_explains_signal): Remove macro, declare as function.
(base_breakpoint_ops, init_catchpoint): Declare.
* break-catch-sig.c: New file.
* inferior.h (signal_catch_update): Declare.
* infrun.c (signal_catch): New global.
(handle_syscall_event): Update for change to
bpstat_explains_signal.
(handle_inferior_event): Likewise. Always handle random signals
via bpstats.
(signal_cache_update): Check signal_catch.
(signal_catch_update): New function.
(_initialize_infrun): Initialize signal_catch.
* Makefile.in (SFILES): Add break-catch-sig.c.
(COMMON_OBS): Add break-catch-sig.o.
gdb/doc
* gdb.texinfo (Set Catchpoints): Document "catch signal".
(Signals): Likewise.
gdb/testsuite
* gdb.base/catch-signal.c: New file.
* gdb.base/catch-signal.exp: New file.
Diffstat (limited to 'gdb/doc')
-rw-r--r-- | gdb/doc/ChangeLog | 5 | ||||
-rw-r--r-- | gdb/doc/gdb.texinfo | 29 |
2 files changed, 34 insertions, 0 deletions
diff --git a/gdb/doc/ChangeLog b/gdb/doc/ChangeLog index 906e56f..5281095 100644 --- a/gdb/doc/ChangeLog +++ b/gdb/doc/ChangeLog @@ -1,5 +1,10 @@ 2013-01-16 Tom Tromey <tromey@redhat.com> + * gdb.texinfo (Set Catchpoints): Document "catch signal". + (Signals): Likewise. + +2013-01-16 Tom Tromey <tromey@redhat.com> + * gdb.texinfo (GDB/MI Breakpoint Information): Document "catch-type" field. (GDB/MI Catchpoint Commands): Add "catch-type" to examples. diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo index 89dc010..0fb6601 100644 --- a/gdb/doc/gdb.texinfo +++ b/gdb/doc/gdb.texinfo @@ -4234,6 +4234,31 @@ The loading or unloading of a shared library. If @var{regexp} is given, then the catchpoint will stop only if the regular expression matches one of the affected libraries. +@item signal @r{[}@var{signal}@dots{} @r{|} @samp{all}@r{]} +The delivery of a signal. + +With no arguments, this catchpoint will catch any signal that is not +used internally by @value{GDBN}, specifically, all signals except +@samp{SIGTRAP} and @samp{SIGINT}. + +With the argument @samp{all}, all signals, including those used by +@value{GDBN}, will be caught. This argument cannot be used with other +signal names. + +Otherwise, the arguments are a list of signal names as given to +@code{handle} (@pxref{Signals}). Only signals specified in this list +will be caught. + +One reason that @code{catch signal} can be more useful than +@code{handle} is that you can attach commands and conditions to the +catchpoint. + +When a signal is caught by a catchpoint, the signal's @code{stop} and +@code{print} settings, as specified by @code{handle}, are ignored. +However, whether the signal is still delivered to the inferior depends +on the @code{pass} setting; this can be changed in the catchpoint's +commands. + @end table @item tcatch @var{event} @@ -5326,6 +5351,10 @@ Similar, but print information only about the specified signal number. @code{info handle} is an alias for @code{info signals}. +@item catch signal @r{[}@var{signal}@dots{} @r{|} @samp{all}@r{]} +Set a catchpoint for the indicated signals. @xref{Set Catchpoints}, +for details about this command. + @kindex handle @item handle @var{signal} @r{[}@var{keywords}@dots{}@r{]} Change the way @value{GDBN} handles signal @var{signal}. @var{signal} |