From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 73660 invoked by alias); 27 Oct 2015 09:49:01 -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 73634 invoked by uid 89); 27 Oct 2015 09:48:58 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-pa0-f52.google.com Received: from mail-pa0-f52.google.com (HELO mail-pa0-f52.google.com) (209.85.220.52) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Tue, 27 Oct 2015 09:48:57 +0000 Received: by pabla5 with SMTP id la5so24902513pab.0 for ; Tue, 27 Oct 2015 02:48:55 -0700 (PDT) X-Received: by 10.66.193.134 with SMTP id ho6mr27416549pac.52.1445939335690; Tue, 27 Oct 2015 02:48:55 -0700 (PDT) Received: from E107787-LIN (gcc2-power8.osuosl.org. [140.211.9.43]) by smtp.gmail.com with ESMTPSA id ve8sm38612030pbc.48.2015.10.27.02.48.53 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Tue, 27 Oct 2015 02:48:54 -0700 (PDT) From: Yao Qi To: Pedro Alves Cc: gdb-patches@sourceware.org Subject: Re: [PATCH 11/18] gdbserver: fix killed-outside.exp References: <1444836486-25679-1-git-send-email-palves@redhat.com> <1444836486-25679-12-git-send-email-palves@redhat.com> Date: Tue, 27 Oct 2015 12:02:00 -0000 In-Reply-To: <1444836486-25679-12-git-send-email-palves@redhat.com> (Pedro Alves's message of "Wed, 14 Oct 2015 16:27:59 +0100") Message-ID: <86ziz4zlof.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2015-10/txt/msg00601.txt.bz2 Pedro Alves writes: > diff --git a/gdb/gdbserver/linux-low.c b/gdb/gdbserver/linux-low.c > index 1c447c2..af9ca22 100644 > --- a/gdb/gdbserver/linux-low.c > +++ b/gdb/gdbserver/linux-low.c > @@ -1535,12 +1535,6 @@ thread_still_has_status_pending_p (struct thread_i= nfo *thread) > if (!lp->status_pending_p) > return 0; >=20=20 > - /* If we got a `vCont;t', but we haven't reported a stop yet, do > - report any status pending the LWP may have. */ > - if (thread->last_resume_kind =3D=3D resume_stop > - && thread->last_status.kind !=3D TARGET_WAITKIND_IGNORE) > - return 0; > - Shouldn't we return 1 instead of 0 here? This is consistent with the comments above. > if (thread->last_resume_kind !=3D resume_stop > && (lp->stop_reason =3D=3D TARGET_STOPPED_BY_SW_BREAKPOINT > || lp->stop_reason =3D=3D TARGET_STOPPED_BY_HW_BREAKPOINT)) > @@ -1597,6 +1591,24 @@ thread_still_has_status_pending_p (struct thread_i= nfo *thread) > return 1; > } >=20=20 > +/* Returns true if LWP is resumed from the client's perspective. */ > + > +static int > +lwp_resumed (struct lwp_info *lwp) > +{ > + struct thread_info *thread =3D get_lwp_thread (lwp); > + > + if (thread->last_resume_kind !=3D resume_stop) > + return 1; > + > + /* Did we get a `vCont;t', but we haven't reported a stop yet? */ > + if (thread->last_resume_kind =3D=3D resume_stop > + && thread->last_status.kind =3D=3D TARGET_WAITKIND_IGNORE) > + return 1; > + I feel "reported" isn't precise. Is "got" better? The code means GDBserver has already got vCont;t and sent SIGSTOP, but hasn't *got* stop event out of event loop. After GDBserver got this event, it then reports the event back to GDB if needed. --=20 Yao (=E9=BD=90=E5=B0=A7)