From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5831 invoked by alias); 3 May 2013 17:39:18 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 5799 invoked by uid 89); 3 May 2013 17:39:14 -0000 X-Spam-SWARE-Status: No, score=-3.2 required=5.0 tests=AWL,BAYES_00,KHOP_THREADED,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.1 Received: from Mailrelay020.isp.belgacom.be (HELO mailrelay020.isp.belgacom.be) (195.238.6.95) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Fri, 03 May 2013 17:39:11 +0000 X-Belgacom-Dynamic: yes X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AjcDABf1g1FtgZKL/2dsb2JhbAANQ4Z6u3IDAYEPgxMBAQEEIwRSEAsOCgICJgICVwYTt3hykGGBJI0uLDMHgkCBEwOrbQ Received: from 139.146-129-109.adsl-dyn.isp.belgacom.be (HELO [192.168.1.7]) ([109.129.146.139]) by relay.skynet.be with ESMTP; 03 May 2013 19:39:08 +0200 Subject: Re: RFA: fix handling of catch signal SIGTRAP/SIGINT From: Philippe Waroquiers To: Pedro Alves Cc: gdb-patches@sourceware.org In-Reply-To: <5183C881.7030801@redhat.com> References: <1367433782.2626.142.camel@soleil> <5182B441.3000703@redhat.com> <1367531384.3007.83.camel@soleil> <5183C881.7030801@redhat.com> Content-Type: text/plain; charset="UTF-8" Date: Fri, 03 May 2013 17:39:00 -0000 Message-ID: <1367602748.2243.13.camel@soleil> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-SW-Source: 2013-05/txt/msg00059.txt.bz2 On Fri, 2013-05-03 at 15:24 +0100, Pedro Alves wrote: > Knowing the "catch signal" vs "catch signal all" difference, the updated > patch becomes obviously correct then. If you had sent it, I'd > probably okay it. ;-) Here is an updated version. Philippe Index: gdb/ChangeLog =================================================================== RCS file: /cvs/src/src/gdb/ChangeLog,v retrieving revision 1.15497 diff -u -p -r1.15497 ChangeLog --- gdb/ChangeLog 1 May 2013 14:54:18 -0000 1.15497 +++ gdb/ChangeLog 3 May 2013 17:32:48 -0000 @@ -1,3 +1,9 @@ +2013-05-03 Philippe Waroquiers + + * break-catch-sig.c (signal_catchpoint_breakpoint_hit): Do not + ignore SIGINT and SIGTRAP in case these internal signals are + caught explicitely. + 2013-05-01 Joel Brobecker * darwin-nat.c (darwin_read_write_inferior): Change types Index: gdb/break-catch-sig.c =================================================================== RCS file: /cvs/src/src/gdb/break-catch-sig.c,v retrieving revision 1.3 diff -u -p -r1.3 break-catch-sig.c --- gdb/break-catch-sig.c 12 Feb 2013 18:27:27 -0000 1.3 +++ gdb/break-catch-sig.c 3 May 2013 17:32:48 -0000 @@ -199,13 +199,13 @@ signal_catchpoint_breakpoint_hit (const VEC_iterate (gdb_signal_type, c->signals_to_be_caught, i, iter); i++) if (signal_number == iter) - break; + return 1; /* Not the same. */ - if (!iter) - return 0; + gdb_assert (!iter); + return 0; } - - return c->catch_all || !INTERNAL_SIGNAL (signal_number); + else + return c->catch_all || !INTERNAL_SIGNAL (signal_number); } /* Implement the "print_it" breakpoint_ops method for signal Index: gdb/testsuite/ChangeLog =================================================================== RCS file: /cvs/src/src/gdb/testsuite/ChangeLog,v retrieving revision 1.3641 diff -u -p -r1.3641 ChangeLog --- gdb/testsuite/ChangeLog 3 May 2013 15:43:57 -0000 1.3641 +++ gdb/testsuite/ChangeLog 3 May 2013 17:32:53 -0000 @@ -1,3 +1,8 @@ +2013-05-03 Philippe Waroquiers + + * gdb.base/catch-sig.c (main): Raise SIGINT. + * gdb.base/catch-sig.exp: Test "catch signal SIGINT". + 2013-05-03 Hafiz Abid Qadeer * status-stop.exp (test_tstart_tstart): Check for error Index: gdb/testsuite/gdb.base/catch-signal.c =================================================================== RCS file: /cvs/src/src/gdb/testsuite/gdb.base/catch-signal.c,v retrieving revision 1.2 diff -u -p -r1.2 catch-signal.c --- gdb/testsuite/gdb.base/catch-signal.c 12 Feb 2013 18:27:28 -0000 1.2 +++ gdb/testsuite/gdb.base/catch-signal.c 3 May 2013 17:32:53 -0000 @@ -42,5 +42,7 @@ main () raise (SIGHUP); /* third HUP */ raise (SIGHUP); /* fourth HUP */ + + raise (SIGINT); /* first INT */ } Index: gdb/testsuite/gdb.base/catch-signal.exp =================================================================== RCS file: /cvs/src/src/gdb/testsuite/gdb.base/catch-signal.exp,v retrieving revision 1.3 diff -u -p -r1.3 catch-signal.exp --- gdb/testsuite/gdb.base/catch-signal.exp 12 Feb 2013 18:27:28 -0000 1.3 +++ gdb/testsuite/gdb.base/catch-signal.exp 3 May 2013 17:32:53 -0000 @@ -71,6 +71,19 @@ proc test_catch_signal {signame} { gdb_breakpoint ${srcfile}:[gdb_get_line_number "fourth HUP"] gdb_continue_to_breakpoint "fourth HUP" delete_breakpoints + + # Verify an internal signal used by gdb is properly caught. + gdb_breakpoint ${srcfile}:[gdb_get_line_number "first INT"] + gdb_continue_to_breakpoint "first INT" + set test "override SIGINT to catch" + gdb_test "handle SIGINT nostop print nopass" \ + "SIGINT.*No.*Yes.*No.*" \ + "$test" \ + "SIGINT is used by the debugger.*Are you sure you want to change it.*y or n.*" \ + y + gdb_test "catch signal SIGINT" "Catchpoint .*" + gdb_test "continue" "Catchpoint .* SIGINT.*" + } }