public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: "Kévin Le Gouguec" <legouguec@adacore.com>
To: Tom Tromey <tromey@adacore.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH 2/2] Add return value to DAP scope
Date: Tue, 13 Feb 2024 23:16:55 +0100	[thread overview]
Message-ID: <87jzn8dn6w.fsf@adacore.com> (raw)
In-Reply-To: <87mss45mur.fsf@tromey.com> (Tom Tromey's message of "Tue, 13 Feb 2024 09:51:24 -0700")

Tom Tromey <tromey@adacore.com> writes:

>>>>>> "Kévin" == Kévin Le Gouguec <legouguec@adacore.com> writes:
>
>>> +    def fetch_one_child(self, idx):
>>> +        global _last_return_value
>>> +        if _last_return_value is not None:
>>> +            if idx == 0:
>>> +                return ("(return)", _last_return_value)
>>> +            idx = idx - 1
>>> +        return super().fetch_one_child(idx)
>
> Kévin> If scopes are cleared whenever the inferior is resumed (my paraphrasing
> Kévin> of § Lifetime of Objects References), can this method be called after
> Kévin> _last_return_value has been reset to None?
>
> Kévin> Wondering if the outer 'if' is necessary, since we only create a
> Kévin> _FinishScopeReference when _last_return_value is not None:
>
> Ah yeah -- that 'if' is a leftover from an earlier iteration.  Thanks.

Pleasure's mine - v2 looks A-OK 👌

> Kévin> Tangentially, wondering if capturing _last_return_value as a
> Kévin> _FinishScopeReference.__init__ parameter would make sense.
>
> It doesn't really matter, because all these objects are only valid
> during a single stop.

Fair; plus I guess adding an attribute would add a second source of
truth, so not a win overall.

      reply	other threads:[~2024-02-13 22:16 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-12 18:47 [PATCH 0/2] Add "finish" return value to DAP Tom Tromey
2024-02-12 18:47 ` [PATCH 1/2] Export "finish" return value to Python Tom Tromey
2024-02-12 19:24   ` Eli Zaretskii
2024-02-12 18:47 ` [PATCH 2/2] Add return value to DAP scope Tom Tromey
2024-02-13 15:01   ` Kévin Le Gouguec
2024-02-13 16:51     ` Tom Tromey
2024-02-13 22:16       ` Kévin Le Gouguec [this message]

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=87jzn8dn6w.fsf@adacore.com \
    --to=legouguec@adacore.com \
    --cc=gdb-patches@sourceware.org \
    --cc=tromey@adacore.com \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).