From ab04a2af2bacfc1062c907630bee6e345dbd2ea9 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Wed, 16 Jan 2013 17:31:40 +0000 Subject: 2013-01-03 Pedro Alves Tom Tromey 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) : 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. --- gdb/doc/gdb.texinfo | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'gdb/doc/gdb.texinfo') 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} -- cgit v1.1