Bug 7221 - (gdb) catch signal SIGNAL
Summary: (gdb) catch signal SIGNAL
Status: RESOLVED FIXED
Alias: None
Product: gdb
Classification: Unclassified
Component: cli (show other bugs)
Version: unknown
: P3 enhancement
Target Milestone: 7.6
Assignee: Tom Tromey
URL:
Keywords:
: 8903 10588 (view as bug list)
Depends on:
Blocks:
 
Reported: 2001-07-06 19:48 UTC by ac131313
Modified: 2013-01-16 17:34 UTC (History)
6 users (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description ac131313 2001-07-07 02:48:04 UTC
[Converted from Gnats 116]

``(gdb) catch signal SIGNAL''

Overlaps with ``handle SIGNAL'' but the implied behavior is different.
You can attach commands to a catch but not a handle.  A handle has a
limited number of hardwired actions.

Release:
unknown
Comment 1 Tom Tromey 2009-08-04 21:09:38 UTC
*** Bug 8903 has been marked as a duplicate of this bug. ***
Comment 2 Tom Tromey 2009-09-02 15:29:40 UTC
*** Bug 10588 has been marked as a duplicate of this bug. ***
Comment 3 Pedro Alves 2011-09-09 16:18:49 UTC
An incomplete, but functional patch is at:

http://sourceware.org/ml/gdb-patches/2011-09/msg00164.html
Comment 4 Tom Tromey 2012-11-09 15:53:54 UTC
I picked up Pedro's patch and am working on it.
Comment 5 Sourceware Commits 2013-01-16 17:31:48 UTC
CVSROOT:	/cvs/src
Module name:	src
Changes by:	tromey@sourceware.org	2013-01-16 17:31:41

Modified files:
	gdb            : ChangeLog Makefile.in NEWS breakpoint.c 
	                 breakpoint.h inferior.h infrun.c 
	gdb/doc        : ChangeLog gdb.texinfo 
	gdb/testsuite  : ChangeLog 
Added files:
	gdb            : break-catch-sig.c 
	gdb/testsuite/gdb.base: catch-signal.c catch-signal.exp 

Log message:
	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.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/break-catch-sig.c.diff?cvsroot=src&r1=NONE&r2=1.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/ChangeLog.diff?cvsroot=src&r1=1.15021&r2=1.15022
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/Makefile.in.diff?cvsroot=src&r1=1.1228&r2=1.1229
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/NEWS.diff?cvsroot=src&r1=1.562&r2=1.563
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/breakpoint.c.diff?cvsroot=src&r1=1.734&r2=1.735
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/breakpoint.h.diff?cvsroot=src&r1=1.191&r2=1.192
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/inferior.h.diff?cvsroot=src&r1=1.183&r2=1.184
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/infrun.c.diff?cvsroot=src&r1=1.571&r2=1.572
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/doc/ChangeLog.diff?cvsroot=src&r1=1.1403&r2=1.1404
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/doc/gdb.texinfo.diff?cvsroot=src&r1=1.1041&r2=1.1042
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/testsuite/ChangeLog.diff?cvsroot=src&r1=1.3509&r2=1.3510
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/testsuite/gdb.base/catch-signal.c.diff?cvsroot=src&r1=NONE&r2=1.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/testsuite/gdb.base/catch-signal.exp.diff?cvsroot=src&r1=NONE&r2=1.1
Comment 6 Tom Tromey 2013-01-16 17:34:13 UTC
Committed.