From: Simon Marchi via Gdb-patches <gdb-patches@sourceware.org>
To: Pedro Alves <pedro@palves.net>,
Simon Marchi <simon.marchi@efficios.com>,
gdb-patches@sourceware.org
Subject: Re: [PATCH 2/4] gdb: make remote target clear its async event handler in wait
Date: Thu, 4 Feb 2021 13:34:04 -0500 [thread overview]
Message-ID: <f011ee21-f12b-26cc-c3ab-6e1400c92969@polymtl.ca> (raw)
In-Reply-To: <df91c2c5-8696-a16a-a8b2-268d807af6a1@palves.net>
On 2021-02-04 1:00 p.m., Pedro Alves wrote:
> On 30/11/20 16:52, Simon Marchi via Gdb-patches wrote:
>
>> However, the code in remote_async_inferior_event_handler checks for for
>
> s/for for/for/
>
>> pending events in addition to whether the stop reply queue is empty, so
>> I've made remote_target::wait check for that as well. I'm not
>> completely sure this is ok, since I don't understand very well yet how
>> the pending events mechanism works. But I figured it was safer to do
>> this in order to avoid missing events, worst case it just leads to
>> unnecessary calls to remote_target::wait.
>
> It won't hurt, but I think it shouldn't be necessary -- if putpkt_binary or
> getpkt_or_notif_sane_1 see a notification (search for '%'), we end up in
> handle_notification, which marks state->get_pending_events_token, which
> then leads us to:
>
> -> remote_async_get_pending_events_handler
> -> remote_notif_get_pending_events
> -> remote_notif_stop_ack
> -> remote_target::push_stop_reply
> -> mark_async_event_handler (rs->remote_async_inferior_event_token);
>
> which then ends up in target_target::wait.
>
> I don't recall exactly why I had to put the check for the pending
> event in remote_async_inferior_event_handler, though. Maybe it was
> necessary because events auto-cleared back then.
Ok, I'll push this patch it as-is then, but look into simplifying the code
as another patch.
> Anyhow, this LGTM. Patches #3 and #4 LGTM too.
Thanks, will push.
Simon
next prev parent reply other threads:[~2021-02-04 18:34 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-30 16:52 [PATCH 0/4] Clear target async event handlers in wait method Simon Marchi via Gdb-patches
2020-11-30 16:52 ` [PATCH 1/4] gdb: make async event handlers clear themselves Simon Marchi via Gdb-patches
2020-12-24 17:26 ` Andrew Burgess
2021-02-04 17:42 ` Pedro Alves
2021-02-04 18:15 ` Simon Marchi via Gdb-patches
2020-11-30 16:52 ` [PATCH 2/4] gdb: make remote target clear its async event handler in wait Simon Marchi via Gdb-patches
2020-12-24 17:23 ` Andrew Burgess
2020-12-24 17:44 ` Simon Marchi via Gdb-patches
2021-02-04 18:00 ` Pedro Alves
2021-02-04 18:34 ` Simon Marchi via Gdb-patches [this message]
2020-11-30 16:52 ` [PATCH 3/4] gdb: make record-btrace " Simon Marchi via Gdb-patches
2021-01-06 9:50 ` Andrew Burgess
2020-11-30 16:52 ` [PATCH 4/4] gdb: make record-full " Simon Marchi via Gdb-patches
2021-01-06 9:51 ` Andrew Burgess
2020-12-23 21:31 ` [PATCH 0/4] Clear target async event handlers in wait method Simon Marchi via Gdb-patches
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=f011ee21-f12b-26cc-c3ab-6e1400c92969@polymtl.ca \
--to=gdb-patches@sourceware.org \
--cc=pedro@palves.net \
--cc=simon.marchi@efficios.com \
--cc=simon.marchi@polymtl.ca \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox