From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25268 invoked by alias); 19 Jun 2013 10:40:31 -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 25243 invoked by uid 89); 19 Jun 2013 10:40:25 -0000 X-Spam-SWARE-Status: No, score=-8.1 required=5.0 tests=AWL,BAYES_00,KHOP_THREADED,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.1 Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Wed, 19 Jun 2013 10:40:24 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r5JAeLwj015839 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 19 Jun 2013 06:40:21 -0400 Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r5JAeJJT009457; Wed, 19 Jun 2013 06:40:19 -0400 Message-ID: <51C18A92.7030109@redhat.com> Date: Wed, 19 Jun 2013 10:56:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130514 Thunderbird/17.0.6 MIME-Version: 1.0 To: Sergio Durigan Junior CC: GDB Patches , Eli Zaretskii , Doug Evans , Pedro Alves Subject: Re: [PATCH v2] Add convenience variable $_exitsignal References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-SW-Source: 2013-06/txt/msg00481.txt.bz2 On 06/18/2013 07:46 PM, Sergio Durigan Junior wrote: > Hi, > > This is the second version of the patch which adds the convenience > variable "$_exitsignal". You can look at the first version here: > > > > I have made the proposed modifications suggested by Eli, Doug and > Pedro. > > Doug, please take a look at tell me what you think. Eli, I have > rewritten the doc entry for $_exitcode in order to make it explain which > variable is set and which is cleared depending on the situation. And > Pedro, I've made the test more complete. Thanks. > OK to apply? Hmm. This is still exposing the GDB signal numbers instead of the target's? > diff --git a/gdb/testsuite/gdb.base/exitsignal.c b/gdb/testsuite/gdb.base/exitsignal.c > new file mode 100644 > index 0000000..d2b479b > --- /dev/null > +++ b/gdb/testsuite/gdb.base/exitsignal.c > @@ -0,0 +1,37 @@ ... > + You should have received a copy of the GNU General Public License > + along with this program. If not, see . > + > +*/ Spurious empty line. > + > +/* This test can be used just to generate a SIGSEGV. */ > + > +#include This include looks unnecessary. > + > +int > +main (int argc, char *argv[]) > +{ > + char *p = NULL; > + > +#ifdef GENSEGV > + /* Generating a SIGSEGV. */ > + *p = 1; > +#else > + /* Just do a normal return. */ > + (void) p; > + return 0; > +#endif > +} The amount of shared code between GENSEGV and !GENSEGV is so little (just boilerplate), that I'd suggest just splitting them into two files. Then the "This test can be used just to generate a SIGSEGV" comment at the top wouldn't be incorrect. :-) > + > +# Now we test the behaviour of $_exit{code,signal} during a normal > +# inferior execution. > +gdb_rename_execfile $binfile ${binfile}x Please don't rename like this. Instead generate distinct executables from the get go. See e.g., gdb.multi/multi-arch.exp. > +if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile}] } { > + return -1 > +} -- Pedro Alves