From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15161 invoked by alias); 17 Jun 2013 17:35: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 15149 invoked by uid 89); 17 Jun 2013 17:35:30 -0000 X-Spam-SWARE-Status: No, score=-6.7 required=5.0 tests=AWL,BAYES_00,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; Mon, 17 Jun 2013 17:35:30 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r5HHZTtN000819 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 17 Jun 2013 13:35:29 -0400 Received: from psique (ovpn-113-144.phx2.redhat.com [10.3.113.144]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r5HHZQVQ019018 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Mon, 17 Jun 2013 13:35:27 -0400 From: Sergio Durigan Junior To: Pedro Alves Cc: GDB Patches Subject: Re: [RFC/PATCH] New convenience variable $_exitsignal References: <51BF4550.80704@redhat.com> X-URL: http://www.redhat.com Date: Mon, 17 Jun 2013 17:41:00 -0000 In-Reply-To: <51BF4550.80704@redhat.com> (Pedro Alves's message of "Mon, 17 Jun 2013 18:20:16 +0100") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-SW-Source: 2013-06/txt/msg00389.txt.bz2 On Monday, June 17 2013, Pedro Alves wrote: > On 06/16/2013 07:25 AM, Sergio Durigan Junior wrote: >> @@ -3455,6 +3455,12 @@ handle_inferior_event (struct execution_control_state *ecs) >> set_internalvar_integer (lookup_internalvar ("_exitcode"), >> (LONGEST) ecs->ws.value.integer); >> >> + /* Clear the internal variable, since if we are here chances >> + are the inferior has not been terminated by a signal. >> + And even if it has, then GDB will get to >> + TARGET_WAITKIND_SIGNALLED in time... */ > > No it won't. The target either returns TARGET_WAITKIND_EXITED > or TARGET_WAITKIND_SIGNALLED. They're mutually exclusive. You're right, I confused the matters here, I was debugging with "debug infrun" and saw a _STOPPED then a _SIGNALLED, and my mind twisted when I wrote that comment. >> + clear_internalvar (lookup_internalvar ("_exitsignal")); >> + >> /* Also record this in the inferior itself. */ >> current_inferior ()->has_exit_code = 1; >> current_inferior ()->exit_code = (LONGEST) ecs->ws.value.integer; >> @@ -3462,7 +3468,17 @@ handle_inferior_event (struct execution_control_state *ecs) >> print_exited_reason (ecs->ws.value.integer); >> } >> else >> - print_signal_exited_reason (ecs->ws.value.sig); >> + { >> + print_signal_exited_reason (ecs->ws.value.sig); >> + /* Set the value of the internal variable $_exitsignal, >> + which holds the signal uncaught by the inferior. */ >> + set_internalvar_integer (lookup_internalvar ("_exitsignal"), >> + (LONGEST) ecs->ws.value.sig); >> + >> + /* Clear the $_exitcode internal variable, because if the >> + inferior signalled then its return code does not exist. */ > > s/the inferior signalled/the inferior died with a signal/ ? Yes, will change. I will resubmit the patch with all the modifications (by Eli, Doug and you) next. -- Sergio