This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFC/PATCH] New convenience variable $_exitsignal


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]