From: Alexandra Petlanova Hajkova <ahajkova@redhat.com>
To: Tom Tromey <tromey@adacore.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH] Use frame.name() in FrameDecorator
Date: Thu, 3 Aug 2023 15:50:17 +0200 [thread overview]
Message-ID: <CAJVr-EPW+EL8f00QwQfOuWrLgZsPrzKdMkt=BfNaaEGH0aDZ_A@mail.gmail.com> (raw)
In-Reply-To: <20230801200627.2901739-1-tromey@adacore.com>
[-- Attachment #1: Type: text/plain, Size: 1317 bytes --]
On Tue, Aug 1, 2023 at 10:07 PM Tom Tromey via Gdb-patches <
gdb-patches@sourceware.org> wrote:
> A co-worker pointed out that gdb's DAP implementation might return an
> integer for the name of a stack frame, like:
>
> {"id": 1, "name": 93824992310799, ...}
>
> This can be seen currently in the logs of the bt-nodebug.exp test
> case.
>
> What is happening is that FrameDecorator falls back on returning the
> PC when the frame's function symbol cannot be found, relying on the
> gdb core to look up the minsym and print its name.
>
> This can actually yield the wrong answer sometimes, because it falls
> into the get_frame_pc / get_frame_address_in_block problem -- if the
> frame is at a call to a noreturn function, the PC in this case might
> appear to be in the next function in memory. For more on this, see:
>
> https://sourceware.org/bugzilla/show_bug.cgi?id=8416
>
> and related bugs.
>
> However, there's a different approach we can take: the code here can
> simply use Frame.name. This handles the PC problem correctly, and
> gets us the information we need.
> ---
>
>
I tested this for Fedora-Rawhide on ppc64le. I can confirm this causes no
regressions and I can see {"id": 1, "name": "no_debug_info",
is outputted instead of {"id": 1, "name": 268501652.
next prev parent reply other threads:[~2023-08-03 13:50 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-01 20:06 Tom Tromey
2023-08-03 13:50 ` Alexandra Petlanova Hajkova [this message]
2023-08-03 15:36 ` Tom Tromey
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='CAJVr-EPW+EL8f00QwQfOuWrLgZsPrzKdMkt=BfNaaEGH0aDZ_A@mail.gmail.com' \
--to=ahajkova@redhat.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).