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

* Re: [RFC] add offset support to DWARF2_FRAME_REG_CFA
  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
  0 siblings, 1 reply; 9+ messages in thread
From: Mark Kettenis @ 2005-11-22 19:32 UTC (permalink / raw)
  To: christophe.lyon; +Cc: gdb-patches

> Date: Tue, 22 Nov 2005 10:32:32 +0100
> From: Christophe LYON <christophe.lyon@st.com>
> 
> 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.

Hmm, I can't really remember the discussion.  Do you have a pointer
into the list archives for me?

Mark


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

* Re: [RFC] add offset support to DWARF2_FRAME_REG_CFA
  2005-11-22 19:32 ` Mark Kettenis
@ 2005-11-23 15:59   ` Christophe LYON
  2005-11-25  8:27     ` Mark Kettenis
  0 siblings, 1 reply; 9+ messages in thread
From: Christophe LYON @ 2005-11-23 15:59 UTC (permalink / raw)
  To: Mark Kettenis; +Cc: gdb-patches

Mark Kettenis wrote:
>>Date: Tue, 22 Nov 2005 10:32:32 +0100
>>From: Christophe LYON <christophe.lyon@st.com>
>>
>>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.
> 
> 
> Hmm, I can't really remember the discussion.  Do you have a pointer
> into the list archives for me?
> 
Of course. It starts here:
http://sources.redhat.com/ml/gdb/2005-07/msg00113.html

Christophe.


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

* Re: [RFC] add offset support to DWARF2_FRAME_REG_CFA
  2005-11-23 15:59   ` Christophe LYON
@ 2005-11-25  8:27     ` Mark Kettenis
  2005-11-25 17:54       ` Christophe LYON
  2005-11-25 18:17       ` Daniel Jacobowitz
  0 siblings, 2 replies; 9+ messages in thread
From: Mark Kettenis @ 2005-11-25  8:27 UTC (permalink / raw)
  To: christophe.lyon; +Cc: gdb-patches

> Date: Wed, 23 Nov 2005 09:46:07 +0100
> From: Christophe LYON <christophe.lyon@st.com>
> 
> Mark Kettenis wrote:
> >>Date: Tue, 22 Nov 2005 10:32:32 +0100
> >>From: Christophe LYON <christophe.lyon@st.com>
> >>
> >>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.
> > 
> > 
> > Hmm, I can't really remember the discussion.  Do you have a pointer
> > into the list archives for me?
> > 
> Of course. It starts here:
> http://sources.redhat.com/ml/gdb/2005-07/msg00113.html

Thanks!  You seemed to have forgotten about my suggestion to introduce
DWARF2_FRAME_REG_CFA_OFFSET.  The problem is that as-is, your patch
seems to break sparc64 and cris.  By introducing
DWARF2_FRAME_CFA_OFFSET all existing code will be safe.

Mark


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

* Re: [RFC] add offset support to DWARF2_FRAME_REG_CFA
  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-25 18:17       ` Daniel Jacobowitz
  1 sibling, 2 replies; 9+ messages in thread
From: Christophe LYON @ 2005-11-25 17:54 UTC (permalink / raw)
  To: gdb-patches


> Thanks!  You seemed to have forgotten about my suggestion to introduce
> DWARF2_FRAME_REG_CFA_OFFSET.  The problem is that as-is, your patch
> seems to break sparc64 and cris.  By introducing
> DWARF2_FRAME_CFA_OFFSET all existing code will be safe.
> 

I see.

So here is an updated patch.

Is it OK now?

Thanks,

Christophe.


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

     * dwarf2-frame.c: (dwarf2_frame_prev_register): handle 
DWARF2_FRAME_REG_CFA_OFFSET
     * dwarf2-frame.h: add DWARF2_FRAME_REG_CFA_OFFSET
  to enum dwarf2_frame_reg_rule

Index: dwarf2-frame.c
===================================================================
--- dwarf2-frame.c	(revision 96)
+++ dwarf2-frame.c	(working copy)
@@ -918,6 +921,19 @@
  	}
        break;

+    case DWARF2_FRAME_REG_CFA_OFFSET:
+      *optimizedp = 0;
+      *lvalp = not_lval;
+      *addrp = 0;
+      *realnump = -1;
+      if (valuep)
+	{
+	  /* Store the value.  */
+	  store_typed_address (valuep, builtin_type_void_data_ptr,
+			       cache->cfa + cache->reg[regnum].loc.offset);
+	}
+      break;
+
      case DWARF2_FRAME_REG_RA_OFFSET:
        *optimizedp = 0;
        *lvalp = not_lval;

Index: dwarf2-frame.h
===================================================================
--- dwarf2-frame.h	(revision 96)
+++ dwarf2-frame.h	(working copy)
@@ -55,7 +55,8 @@
       used internally by GDB.  */
    DWARF2_FRAME_REG_RA,		/* Return Address.  */
    DWARF2_FRAME_REG_RA_OFFSET,	/* Return Address with offset.  */
-  DWARF2_FRAME_REG_CFA		/* Call Frame Address.  */
+  DWARF2_FRAME_REG_CFA,	/* Call Frame Address.  */
+  DWARF2_FRAME_REG_CFA_OFFSET	/* Call Frame Address with offset.  */
  };

  /* Register state.  */


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

* Re: [RFC] add offset support to DWARF2_FRAME_REG_CFA
  2005-11-25 17:54       ` Christophe LYON
@ 2005-11-25 17:57         ` M.M. Kettenis
  2005-11-25 18:25         ` Daniel Jacobowitz
  1 sibling, 0 replies; 9+ messages in thread
From: M.M. Kettenis @ 2005-11-25 17:57 UTC (permalink / raw)
  To: Christophe LYON, gdb-patches

Christophe LYON <christophe.lyon@st.com> wrote:

>
> > Thanks!  You seemed to have forgotten about my suggestion to introduce
> > DWARF2_FRAME_REG_CFA_OFFSET.  The problem is that as-is, your patch
> > seems to break sparc64 and cris.  By introducing
> > DWARF2_FRAME_CFA_OFFSET all existing code will be safe.
> >
>
> I see.
>
> So here is an updated patch.
>
> Is it OK now?

Yes, thanks.  But please make sure your ChangeLog is formatted correctly.  The one in your email didn't look right (the *'s were in column 0), but that's probably your mailer.

Mark


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

* Re: [RFC] add offset support to DWARF2_FRAME_REG_CFA
  2005-11-25  8:27     ` Mark Kettenis
  2005-11-25 17:54       ` Christophe LYON
@ 2005-11-25 18:17       ` Daniel Jacobowitz
  1 sibling, 0 replies; 9+ messages in thread
From: Daniel Jacobowitz @ 2005-11-25 18:17 UTC (permalink / raw)
  To: Mark Kettenis; +Cc: christophe.lyon, gdb-patches

On Thu, Nov 24, 2005 at 11:37:51PM +0100, Mark Kettenis wrote:
> Thanks!  You seemed to have forgotten about my suggestion to introduce
> DWARF2_FRAME_REG_CFA_OFFSET.  The problem is that as-is, your patch
> seems to break sparc64 and cris.  By introducing
> DWARF2_FRAME_CFA_OFFSET all existing code will be safe.

You've already approved the patch with this change, so that's fine, but
I don't follow your reasoning; why not just fix sparc64 and cris?

-- 
Daniel Jacobowitz
CodeSourcery, LLC


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

* Re: [RFC] add offset support to DWARF2_FRAME_REG_CFA
  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
  1 sibling, 1 reply; 9+ messages in thread
From: Daniel Jacobowitz @ 2005-11-25 18:25 UTC (permalink / raw)
  To: Christophe LYON; +Cc: gdb-patches

On Fri, Nov 25, 2005 at 02:50:12PM +0100, Christophe LYON wrote:
> 2005-11-25    Christophe Lyon <christophe.lyon@st.com>
> 
>     * dwarf2-frame.c: (dwarf2_frame_prev_register): handle 
> DWARF2_FRAME_REG_CFA_OFFSET
>     * dwarf2-frame.h: add DWARF2_FRAME_REG_CFA_OFFSET
>  to enum dwarf2_frame_reg_rule

FYI, a correct changelog for this patch would look like this:

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

	* dwarf2-frame.c (dwarf2_frame_prev_register): Handle
	DWARF2_FRAME_REG_CFA_OFFSET.
	* dwarf2-frame.h (enum dwarf2_frame_reg_rule): Add
	DWARF2_FRAME_REG_CFA_OFFSET.

Do you need someone to commit this patch for you?

-- 
Daniel Jacobowitz
CodeSourcery, LLC


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

* Re: [RFC] add offset support to DWARF2_FRAME_REG_CFA
  2005-11-25 18:25         ` Daniel Jacobowitz
@ 2005-11-28 21:32           ` Christophe LYON
  0 siblings, 0 replies; 9+ messages in thread
From: Christophe LYON @ 2005-11-28 21:32 UTC (permalink / raw)
  To: Daniel Jacobowitz; +Cc: gdb-patches


> FYI, a correct changelog for this patch would look like this:
> 
> 2005-11-25  Christophe Lyon  <christophe.lyon@st.com>
> 
> 	* dwarf2-frame.c (dwarf2_frame_prev_register): Handle
> 	DWARF2_FRAME_REG_CFA_OFFSET.
> 	* dwarf2-frame.h (enum dwarf2_frame_reg_rule): Add
> 	DWARF2_FRAME_REG_CFA_OFFSET.

OK, thanks for this remark.

> Do you need someone to commit this patch for you?
I have no account to do this, but Frederic Riss is a colleague of mine, 
and will commit it for me.
Thanks.

Christophe.




^ 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