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

>>>>> "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.

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.

Tom

  reply	other threads:[~2024-02-13 16:51 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 [this message]
2024-02-13 22:16       ` Kévin Le Gouguec

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=87mss45mur.fsf@tromey.com \
    --to=tromey@adacore.com \
    --cc=gdb-patches@sourceware.org \
    --cc=legouguec@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).