From patchwork Mon Nov 23 18:39:08 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pedro Alves X-Patchwork-Id: 9797 Received: (qmail 107199 invoked by alias); 23 Nov 2015 18:39:13 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 107148 invoked by uid 89); 23 Nov 2015 18:39:12 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.2 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD, SPF_HELO_PASS autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Mon, 23 Nov 2015 18:39:11 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (Postfix) with ESMTPS id 673EBC0A524C; Mon, 23 Nov 2015 18:39:10 +0000 (UTC) Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id tANId8rY013443; Mon, 23 Nov 2015 13:39:09 -0500 Message-ID: <56535D4C.9030203@redhat.com> Date: Mon, 23 Nov 2015 18:39:08 +0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Yao Qi CC: gdb-patches@sourceware.org Subject: Re: [PATCH 02/18] Remote all-stop-on-top-of-non-stop References: <1444836486-25679-1-git-send-email-palves@redhat.com> <1444836486-25679-3-git-send-email-palves@redhat.com> <86vb9x1u2h.fsf@gmail.com> <56533372.3030805@redhat.com> In-Reply-To: <56533372.3030805@redhat.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: Thanks, Pedro Alves 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);