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: [PATCH] Remove duplicated writes to current_inferior


On 06/11/2012 08:36 AM, Yao Qi wrote:

> Hi, this patch is to remove two statements [1] in the following snip
> 
>       do
> 	{
> 	  (*the_target->resume) (&resume_info, 1);
> 
>  	  last_ptid = mywait (pid_to_ptid (signal_pid), &last_status, 0, 0);
> 	  if (last_status.kind != TARGET_WAITKIND_STOPPED)
> 	    return signal_pid;
> 
> 	  current_inferior->last_resume_kind = resume_stop; <-- [2]
> 	  current_inferior->last_status = last_status;
> 	}
>       while (last_status.value.sig != GDB_SIGNAL_TRAP);
> 
>       current_inferior->last_resume_kind = resume_stop; <--- [1]
>       current_inferior->last_status = last_status;
> 
> As we can see, if [1] are executed, [2] must have been executed, so these
> two statements in [1] can be removed safely.
> 
> b.t.w, both [1] and [2] were introduced by this patch,
> 
>   [gdbserver 2/N] move a bit of code from the linux backend to common code
>   http://sourceware.org/ml/gdb-patches/2010-08/msg00433.html
> 
> It is obvious, and I'll commit it in two days.


Yes, definitely obvious.  Thanks.

-- 
Pedro Alves


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