This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 16/18] gdbserver/linux: Always wake up event loop after resume
- From: Pedro Alves <palves at redhat dot com>
- To: Yao Qi <qiyaoltc at gmail dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Wed, 25 Nov 2015 15:31:23 +0000
- Subject: Re: [PATCH 16/18] gdbserver/linux: Always wake up event loop after resume
- Authentication-results: sourceware.org; auth=none
- References: <1444836486-25679-1-git-send-email-palves at redhat dot com> <1444836486-25679-17-git-send-email-palves at redhat dot com> <864mhd1z16 dot fsf at gmail dot com>
On 10/26/2015 02:32 PM, Yao Qi wrote:
> Pedro Alves <palves@redhat.com> writes:
>
>> Handle this in the same way nat/linux-nat.c:linux_nat_resume handles
>> this.
>
> Nit, it is linux-nat.c instead of nat/linux-nat.c. In linux_nat_resume,
> async_file_mark is guarded by lwp_status_pending_p (lp), so we need to
> check whether there is an event pending in GDBserver too.
I don't think we can just check whether there is an event pending
in the current thread -- the pending event may be in any
other thread that is now resumed from the client's perspective.
As we'd have to walk all threads anyway, seems simplest to just
unconditionally mark the event loop and let linux_wait & friends
handle that.
On the native side, we may have a latent bug and things work anyhow
because something else always wakes up the event loop once. (E.g.,
nowadays target_async always marks infrun's event source.)
Thanks,
Pedro Alves