From: Kevin Buettner <kevinb@redhat.com>
To: Andrew Cagney <ac131313@cygnus.com>, Richard.Earnshaw@arm.com
Cc: gdb@sources.redhat.com
Subject: Re: [rfc] frame->frame => frame->addr && frame->base()
Date: Fri, 12 Apr 2002 08:53:00 -0000 [thread overview]
Message-ID: <1020412155238.ZM7138@localhost.localdomain> (raw)
In-Reply-To: Andrew Cagney <ac131313@cygnus.com> "Re: [rfc] frame->frame => frame->addr && frame->base()" (Apr 12, 9:38am)
On Apr 12, 9:38am, Andrew Cagney wrote:
> >> // High level language concept of the base address of a frame. Often
> >> refered to as ``frame_base'' or ``frame pointer''. This value should
> >> only be computed on-demand. It is strongly recommended, though, that
> >> implementations cache the computed value in the frame cache. The method
> >> is initialized as part of the frame objects creation. The default
> >> method returns frame->addr. (see dwarf2 DW_AT_frame_base)
> >>
> >> CORE_ADDR (*base) (struct frame_info *frame);
> >
> > What would this mean in the context of a function that doesn't use a frame
> > pointer? What about a leaf function which doesn't store anything on the
> > stack? I can't see how this can have any MI interpretation (other than
> > the fact that all functions in a nested chain should have a different
> > value).
>
> The value is debug-info dependant. See section 3.3.5 of the dwarf2
> spec. For some frames this value may not even be applicable - that is
> ok because it isn't a requirement of a frame.
If the value returned by frame->base() is debug-info dependent, then
that would suggest that it could have different values for different
types of debug info. That in turn suggests that you have to know what
type of debug info you're dealing with at frame creation time so that
frame->base can be initialized correctly.
Of course, it could be done lazily. You could just initialize frame->base
to lazy_base() (or whatever). lazy_base() would determine the function
that's really required for that frame + debug info, reset the ->base
field, and then invoke the function it's just calculated to obtain the
desired value.
Implementation details aside, this dependency causes me to wonder if it's
really a good idea make this operation a member of the frame struct.
Kevin
next prev parent reply other threads:[~2002-04-12 15:53 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-04-11 13:56 Andrew Cagney
2002-04-11 15:29 ` Kevin Buettner
2002-04-11 16:42 ` Andrew Cagney
2002-04-12 5:54 ` Richard Earnshaw
2002-04-12 7:05 ` Andrew Cagney
2002-04-12 5:50 ` Richard Earnshaw
2002-04-12 6:38 ` Andrew Cagney
2002-04-12 8:53 ` Kevin Buettner [this message]
2002-04-12 9:05 ` Andrew Cagney
2002-04-12 14:59 ` Jim Blandy
2002-04-26 7:58 ` Andrew Cagney
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=1020412155238.ZM7138@localhost.localdomain \
--to=kevinb@redhat.com \
--cc=Richard.Earnshaw@arm.com \
--cc=ac131313@cygnus.com \
--cc=gdb@sources.redhat.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