Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Andrew Cagney <ac131313@cygnus.com>
To: gdb@sources.redhat.com
Subject: think-o: dwarf2 CFA != frame->frame (x86-64)
Date: Mon, 08 Apr 2002 22:45:00 -0000	[thread overview]
Message-ID: <3CB27FF0.8050407@cygnus.com> (raw)

Hello,

The x86-64 port, being the first to try to use dwarf2 cfa, is in the fun 
position of having to figure out how to integrate some of this stuff 
into gdb.  Just noticed this one...

x86-64 sets the function read_fp() to:

   set_gdbarch_read_fp (gdbarch, cfi_read_fp);

And the corresponding code:

/* Return the frame address.  */
CORE_ADDR
cfi_read_fp ()
{
   struct context *context;
   struct frame_state *fs;
   CORE_ADDR cfa;

   context = context_alloc ();
   fs = frame_state_alloc ();

   context->ra = read_pc () + 1;

   frame_state_for (context, fs);
   update_context (context, fs, 0);

   cfa = context->cfa;
   unwind_tmp_obstack_free ();
   return cfa;
}

Going through the dwarf2++ spec, I've seen CFA (Call Frame Address) and 
frame_base.  While they might turn out to have the same value, they are, 
I think, very different.

The CFA is a CFI specific concept (all about how to unwind stack frames 
and find register values) that, as far as I can tell, isn't intended for 
``public consumption''.  It is used by the stack unwind code as a base 
address for the frame being unwound.  As far as

Separate to this is the frame_base attribute of a function. My 
interpretation of this attribute is that it defines the traditional 
``frame pointer''.

I don't think x86-64-tdep.c should be using the CFA for frame->frame. 
Instead it should be computing frame_base.,

I'll likely bug-report this.

enjoy,
Andrew


             reply	other threads:[~2002-04-09  5:45 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-04-08 22:45 Andrew Cagney [this message]
2002-04-08 23:43 ` Daniel Berlin
2002-04-09  9:12   ` Andrew Cagney
2002-04-09 10:03     ` Daniel Berlin
2002-04-09 10:32       ` Andrew Cagney
2002-04-09 10:58         ` Daniel Berlin
2002-04-09 12:17           ` Andrew Cagney
2002-04-09 12:42             ` Daniel Berlin
2002-04-09 10:58       ` Andrew Cagney
2002-04-09 11:00         ` Daniel Berlin
2002-04-09 11:52           ` 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=3CB27FF0.8050407@cygnus.com \
    --to=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