From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31218 invoked by alias); 17 Jun 2013 17:20:21 -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 31201 invoked by uid 89); 17 Jun 2013 17:20:20 -0000 X-Spam-SWARE-Status: No, score=-8.0 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; Mon, 17 Jun 2013 17:20:20 +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 r5HHKIFK004780 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 17 Jun 2013 13:20:19 -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 r5HHKHbU003947; Mon, 17 Jun 2013 13:20:18 -0400 Message-ID: <51BF4550.80704@redhat.com> Date: Mon, 17 Jun 2013 17:28: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 Subject: Re: [RFC/PATCH] New 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/msg00386.txt.bz2 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. > + 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/ ? > + clear_internalvar (lookup_internalvar ("_exitcode")); > + } -- Pedro Alves