This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 02/18] Remote all-stop-on-top-of-non-stop
- From: Pedro Alves <palves at redhat dot com>
- To: Yao Qi <qiyaoltc at gmail dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Mon, 23 Nov 2015 18:39:08 +0000
- Subject: Re: [PATCH 02/18] Remote all-stop-on-top-of-non-stop
- Authentication-results: sourceware.org; auth=none
- References: <1444836486-25679-1-git-send-email-palves at redhat dot com> <1444836486-25679-3-git-send-email-palves at redhat dot com> <86vb9x1u2h dot fsf at gmail dot com> <56533372 dot 3030805 at redhat dot com>
On 11/23/2015 03:40 PM, Pedro Alves wrote:
> So I'm thinking that I should leave the original patch as is, and
> add some extra comments to remote_async. WDYT?
Like so:
diff --git i/gdb/remote.c w/gdb/remote.c
index 1618ea1..624f60d 100644
--- i/gdb/remote.c
+++ w/gdb/remote.c
@@ -13036,12 +13036,20 @@ remote_async (struct target_ops *ops, int enable)
event loop to process them. */
if (!QUEUE_is_empty (stop_reply_p, stop_reply_queue))
mark_async_event_handler (remote_async_inferior_event_token);
+ /* For simplicity, below we clear the pending events token
+ without remembering whether it is marked, so here we always
+ mark it. If there's actually no pending notification to
+ process, this ends up being a no-op (other than a spurious
+ event-loop wakeup). */
if (target_is_non_stop_p ())
mark_async_event_handler (rs->notif_state->get_pending_events_token);
}
else
{
serial_async (rs->remote_desc, NULL, NULL);
+ /* If the core is disabling async, it doesn't want to be
+ disturbed with target events. Clear all async event sources
+ too. */
clear_async_event_handler (remote_async_inferior_event_token);
if (target_is_non_stop_p ())
clear_async_event_handler (rs->notif_state->get_pending_events_token);
Thanks,
Pedro Alves