Re: [PATCH 16/18] gdbserver/linux: Always wake up event loop after resume

Pedro Alves
2015-11-25T15:31:27Z

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