Re: How frame command with address works

Simon Marchi via Gdb <[email protected]>
Newsgroups gmane.comp.gdb.devel
Message-ID <[email protected]>

On 2/8/23 05:01, Roger Phillips via Gdb wrote:
> Greetings,
> 
> I have to analyze a coredump on an Aarch64 system. The callstack is
> broken so I only see the bottom frame. However, if I manually unwind
> the stack via $x29 register then I see what looks like intact stack
> frames. Now I try to use the frame / frame address command with the
> addresses from the $x29 registers which should point to the bases of
> the stackframes (the location where the address of the next frame is).
> However it always tells me "No frame at address ...".
> 
> What does frame address need to correctly parse a frame?

I think you want to use the "frame view" or "select-frame view"
command, which lets you specify arbitrary SP and PC addresses.  GDB
makes a frame_info object out of those and shows it to you.

It used to be that "frame <ADDRESS>" would do that, but it was
error-prone, as explained here, so was chanted to "frame view" and
"select-frame view":

  https://gitlab.com/gnutools/binutils-gdb/-/commit/f67ffa6a785bee26bc23550670f85c6db578641f

I know a bit about that feature because it was in the way of some change
I wanted to do recently (frame_info_ptr, if someone wants to search the
git log).  I think the intent of the feature is exactly your scenario.
However, I'm under the impression that it's a bit broken right now.
When selecting an arbitrary frame with "select-frame view", you can't do
up/down to see callers of that frame, and "backtrace" shows you the
"real" stack.  I've been told that these commands used to work with
user-created frames though, probably a long time ago.  But since that
feature wasn't tested at all, I guess it got broken.

Simon
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.