From: Simon Marchi via Gdb-patches <gdb-patches@sourceware.org>
To: Patrick Monnerat <patrick@monnerat.net>, gdb-patches@sourceware.org
Subject: Re: [PATCH] Replace deprecated_target_wait_hook by an observer
Date: Mon, 23 Aug 2021 13:48:23 -0400 [thread overview]
Message-ID: <5697ed83-dd71-c977-9f04-cffa75751c23@polymtl.ca> (raw)
In-Reply-To: <934649d9-1f4a-0b3c-a6de-5641c49bb0c6@monnerat.net>
On 2021-08-23 1:36 p.m., Patrick Monnerat wrote:
>
> On 8/23/21 6:26 PM, Simon Marchi wrote:
>> Can you show to the
>> corresponding change in Insight? I'm curious to see how Insight uses
>> this.
>>
> Hi Simon,
>
> Sure! Here is the important part of the Insight diff:
>
> -----
>
> --- a/gdbtk/generic/gdbtk-hooks.c
> +++ b/gdbtk/generic/gdbtk-hooks.c
>
> @@ -685,16 +685,19 @@ gdbtk_post_add_symbol (void)
> /* This hook function is called whenever we want to wait for the
> target. */
>
> -static ptid_t
> -gdbtk_wait (ptid_t ptid, struct target_waitstatus *ourstatus, void *options)
> +static void
> +gdbtk_waiting_for_target (bool enter, ptid_t ptid)
> {
> - gdbtk_force_detach = 0;
> - gdbtk_start_timer ();
> - ptid = target_wait (ptid, ourstatus, *(target_wait_flags *) options);
> - gdbtk_stop_timer ();
> - gdbtk_ptid = ptid;
> -
> - return ptid;
> + if (enter)
> + {
> + gdbtk_force_detach = 0;
> + gdbtk_start_timer ();
> + }
> + else
> + {
> + gdbtk_stop_timer ();
> + gdbtk_ptid = ptid;
> + }
> }
>
> /*
> -----
>
> For more details, see Insight commit https://sourceware.org/git/?p=insight.git;a=commit;h=16042bf
Thanks, that clarifies why you need it to be called both before and
after.
I think it would be good to add some comment above where the obsserver
is notified to say that this is used by Insight, otherwise someone might
be tempted to remove it, as it is unused in the GDB project itself.
I suggest leaving the review up for a week, if nobody has objections,
I'll merge your patch (and I can add the comment myself).
Thanks,
Simon
next prev parent reply other threads:[~2021-08-23 17:50 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-22 16:42 Patrick Monnerat via Gdb-patches
2021-08-23 16:26 ` Simon Marchi via Gdb-patches
2021-08-23 17:36 ` Patrick Monnerat via Gdb-patches
2021-08-23 17:48 ` Simon Marchi via Gdb-patches [this message]
2021-08-23 18:01 ` Patrick Monnerat via Gdb-patches
2021-08-24 16:14 ` Andrew Burgess
2021-08-25 13:30 ` Patrick Monnerat via Gdb-patches
2021-08-25 16:19 ` Andrew Burgess
2021-08-26 2:41 ` Simon Marchi via Gdb-patches
2021-08-26 10:53 ` Patrick Monnerat 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=5697ed83-dd71-c977-9f04-cffa75751c23@polymtl.ca \
--to=gdb-patches@sourceware.org \
--cc=patrick@monnerat.net \
--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