This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Remove duplicated writes to current_inferior
- From: Pedro Alves <palves at redhat dot com>
- To: Yao Qi <yao at codesourcery dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Tue, 12 Jun 2012 14:54:36 +0100
- Subject: Re: [PATCH] Remove duplicated writes to current_inferior
- References: <1339400205-17849-1-git-send-email-yao@codesourcery.com>
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