From: Andrew Cagney <ac131313@cygnus.com>
To: Jim Ingham <jingham@apple.com>
Cc: gdb-patches@sources.redhat.com
Subject: Re: infrun.c:restore_selected_frame???
Date: Tue, 16 Apr 2002 08:02:00 -0000 [thread overview]
Message-ID: <3CBC3CE3.1020102@cygnus.com> (raw)
In-Reply-To: <3CB35C2F.10003@cygnus.com>
I wrote:
> Hmm, to more robustly identify a frame, should we save both the frame->frame and frame->pc (or containing function)? This is separate / independant - I've always wondered if frame->frame was sufficient.
>
> We do this in Project Builder, but there we do it because a GUI has to present the WHOLE stack frame every time you step, which is slow, so we optimize this by sending frame+pc duples to PB using a special purpose command that just gets these and doesn't reconstruct the whole stack.
>
> Don't know if you need this in gdb though. When did you think this might be a problem?
Jim wrote:
>> When did you think this might be a problem?
I think I've I figured it out.
To safely identify a frame, I think the ->addr/base and the ->func/pc
are needed. The dwarf2cfi stuff drops the hint as to why.
Consider a function that doesn't create a frame. A call through that
function can result in two stack frames having the same ->frame value.
They can only be differentiated by using the ->pc.
I think, the correct way to identify a frame is to save:
->frame
as before, a constant value that doesn't
change through out the lifetime of the function
->func
i.e. function_containing(->pc)
(It turns out that, whenever a frame is created
this is computed anyway!)
I think ->func and not ->pc is needed so that it is possible to identify
a frame at different points in its execution (eg stepping through the
inner-most frame).
--
dwarf2cfi doesn't allow for a (mutually) recursive frameless function
(where both ->frame and ->func would be identical).
enjoy,
Andrew
prev parent reply other threads:[~2002-04-16 15:02 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-04-03 15:50 infrun.c:restore_selected_frame??? Jim Ingham
2002-04-08 16:26 ` infrun.c:restore_selected_frame??? Andrew Cagney
2002-04-09 13:18 ` infrun.c:restore_selected_frame??? Jim Ingham
2002-04-09 14:25 ` infrun.c:restore_selected_frame??? Andrew Cagney
2002-04-16 8:02 ` Andrew Cagney [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=3CBC3CE3.1020102@cygnus.com \
--to=ac131313@cygnus.com \
--cc=gdb-patches@sources.redhat.com \
--cc=jingham@apple.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