Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [RFC] add offset support to DWARF2_FRAME_REG_CFA
@ 2005-11-22 17:07 Christophe LYON
  2005-11-22 19:32 ` Mark Kettenis
  0 siblings, 1 reply; 9+ messages in thread
From: Christophe LYON @ 2005-11-22 17:07 UTC (permalink / raw)
  To: gdb-patches


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;




^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2005-11-28 14:00 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-11-22 17:07 [RFC] add offset support to DWARF2_FRAME_REG_CFA Christophe LYON
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox