This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFC/PATCH] New convenience variable $_exitsignal
- From: Pedro Alves <palves at redhat dot com>
- To: Sergio Durigan Junior <sergiodj at redhat dot com>
- Cc: GDB Patches <gdb-patches at sourceware dot org>
- Date: Mon, 17 Jun 2013 18:28:55 +0100
- Subject: Re: [RFC/PATCH] New convenience variable $_exitsignal
- References: <m3mwqqvagk dot fsf at redhat dot com> <51BF4550 dot 80704 at redhat dot com>
On 06/17/2013 06:20 PM, 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.
BTW, it'd be thorough if the test also exercised these clearings.
That is, check that $_exitcode is cleared when the inferior
terminates with a signal. Check that $_exitsignal is cleared
when the inferior exits normally.
--
Pedro Alves