From: Guinevere Larsen <guinevere@redhat.com>
To: Tom Tromey <tom@tromey.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH v2] gdb: modernize get_frame_pc_if_available
Date: Thu, 14 Aug 2025 13:40:38 -0300 [thread overview]
Message-ID: <8fd7220e-9911-47e2-b398-eef7ec66736b@redhat.com> (raw)
In-Reply-To: <87o6shnaxr.fsf@tromey.com>
On 8/14/25 1:08 PM, Tom Tromey wrote:
>>>>>> "Guinevere" == Guinevere Larsen <guinevere@redhat.com> writes:
> Guinevere> The convenience function get_frame_pc_if_available would take a pointer
> Guinevere> to a variable that should be set if available, and would return a
> Guinevere> boolean indicating whether that action was successful or not.
>
> Thanks.
>
> Guinevere> - if (!get_frame_pc_if_available (frame, &pc))
> Guinevere> + if (!(pc = get_frame_pc_if_available (frame)))
>
> This is kind of cheating but in most spots in the patch it is cleaner
> than the alternative. So I'm inclined to let it slide.
>
> Guinevere> annotate_frame_begin (print_level ? frame_relative_level (frame) : 0,
> Guinevere> - gdbarch, pc);
> Guinevere> + gdbarch, (pc.has_value ()) ? *pc : 0);
>
> I think this can be written: pc.value_or (0).
> Ok with that change.
>
> Approved-By: Tom Tromey <tom@tromey.com>
>
> Tom
>
Thanks for the quick review! fixed and pushed!
--
Cheers,
Guinevere Larsen
She/it
prev parent reply other threads:[~2025-08-14 16:41 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-13 13:03 [PATCH] " Guinevere Larsen
2025-08-13 18:21 ` Tom Tromey
2025-08-13 19:00 ` Guinevere Larsen
2025-08-13 20:21 ` [PATCH v2] " Guinevere Larsen
2025-08-14 16:08 ` Tom Tromey
2025-08-14 16:40 ` Guinevere Larsen [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=8fd7220e-9911-47e2-b398-eef7ec66736b@redhat.com \
--to=guinevere@redhat.com \
--cc=gdb-patches@sourceware.org \
--cc=tom@tromey.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