Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Christophe LYON <christophe.lyon@st.com>
To: gdb-patches@sources.redhat.com
Subject: [RFC] add offset support to DWARF2_FRAME_REG_CFA
Date: Tue, 22 Nov 2005 17:07:00 -0000	[thread overview]
Message-ID: <4382E5B0.3030702@st.com> (raw)


Hi all,

Following a discussion we had back in july, I would like to submit the 
following small patch. It enables to describe that SP = CFA + offset,
rather than only SP = CFA.

It can be used in conjonction with a customized xxx_dwarf2_frame_init_reg().

Regards,

Christophe.


2005-11-22	Christophe Lyon <christophe.lyon@st.com>

	* dwarf2-frame.c: (dwarf2_frame_default_init_reg): Ensure
	default offset between SP and CFA is 0.
	(dwarf2_frame_prev_register): add offset to CFA in order to
	compute SP


Index: dwarf2-frame.c
===================================================================
--- dwarf2-frame.c   (revision 96)
+++ dwarf2-frame.c   (working copy)
@@ -539,7 +542,10 @@
    if (regnum == PC_REGNUM)
      reg->how = DWARF2_FRAME_REG_RA;
    else if (regnum == SP_REGNUM)
-    reg->how = DWARF2_FRAME_REG_CFA;
+    {
+      reg->how = DWARF2_FRAME_REG_CFA;
+      reg->loc.offset = 0;
+    }
  }

  /* Return a default for the architecture-specific operations.  */
@@ -914,7 +920,8 @@
        if (valuep)
         {
           /* Store the value.  */
-         store_typed_address (valuep, builtin_type_void_data_ptr, 
cache->cfa);
+         store_typed_address (valuep, builtin_type_void_data_ptr,
+                              cache->cfa + cache->reg[regnum].loc.offset);
         }
        break;




             reply	other threads:[~2005-11-22  9:36 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-11-22 17:07 Christophe LYON [this message]
2005-11-22 19:32 ` Mark Kettenis
2005-11-23 15:59   ` Christophe LYON
2005-11-25  8:27     ` Mark Kettenis
2005-11-25 17:54       ` Christophe LYON
2005-11-25 17:57         ` M.M. Kettenis
2005-11-25 18:25         ` Daniel Jacobowitz
2005-11-28 21:32           ` Christophe LYON
2005-11-25 18:17       ` Daniel Jacobowitz

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=4382E5B0.3030702@st.com \
    --to=christophe.lyon@st.com \
    --cc=gdb-patches@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