Sophie

Sophie

distrib > Scientific%20Linux > 5x > x86_64 > by-pkgid > b5e52bbfb4bb11a6cbed452927fba979 > files > 118

gcc-4.1.2-50.el5.src.rpm

2009-06-04  Jakub Jelinek  <jakub@redhat.com>

	* unwind-dw2.c (struct frame_remember_state): New type.
	(execute_cfa_program): For DW_CFA_remember_state also
	remember fs->cfa_{offset,reg,exp,how} and for DW_CFA_restore_state
	restore it.

--- gcc/unwind-dw2.c.jj	2007-06-22 07:03:05.000000000 -0400
+++ gcc/unwind-dw2.c	2009-06-04 04:41:28.000000000 -0400
@@ -824,6 +824,14 @@ execute_stack_op (const unsigned char *o
   return stack[stack_elt];
 }
 
+struct frame_remember_state
+{
+  struct frame_state_reg_info regs;
+  _Unwind_Sword cfa_offset;
+  _Unwind_Word cfa_reg;
+  const unsigned char *cfa_exp;
+  int cfa_how;
+};
 
 /* Decode DWARF 2 call frame information. Takes pointers the
    instruction sequence to decode, current register information and
@@ -835,7 +843,7 @@ execute_cfa_program (const unsigned char
 		     struct _Unwind_Context *context,
 		     _Unwind_FrameState *fs)
 {
-  struct frame_state_reg_info *unused_rs = NULL;
+  struct frame_remember_state *unused_rs = NULL;
 
   /* Don't allow remember/restore between CIE and FDE programs.  */
   fs->regs.prev = NULL;
@@ -934,25 +942,34 @@ execute_cfa_program (const unsigned char
 
 	case DW_CFA_remember_state:
 	  {
-	    struct frame_state_reg_info *new_rs;
+	    struct frame_remember_state *new_rs;
 	    if (unused_rs)
 	      {
 		new_rs = unused_rs;
-		unused_rs = unused_rs->prev;
+		unused_rs = (struct frame_remember_state *) unused_rs->regs.prev;
 	      }
 	    else
-	      new_rs = alloca (sizeof (struct frame_state_reg_info));
+	      new_rs = alloca (sizeof (struct frame_remember_state));
 
-	    *new_rs = fs->regs;
-	    fs->regs.prev = new_rs;
+	    new_rs->regs = fs->regs;
+	    new_rs->cfa_offset = fs->cfa_offset;
+	    new_rs->cfa_reg = fs->cfa_reg;
+	    new_rs->cfa_exp = fs->cfa_exp;
+	    new_rs->cfa_how = fs->cfa_how;
+	    fs->regs.prev = &new_rs->regs;
 	  }
 	  break;
 
 	case DW_CFA_restore_state:
 	  {
-	    struct frame_state_reg_info *old_rs = fs->regs.prev;
-	    fs->regs = *old_rs;
-	    old_rs->prev = unused_rs;
+	    struct frame_remember_state *old_rs
+	      = (struct frame_remember_state *) fs->regs.prev;
+	    fs->regs = old_rs->regs;
+	    fs->cfa_offset = old_rs->cfa_offset;
+	    fs->cfa_reg = old_rs->cfa_reg;
+	    fs->cfa_exp = old_rs->cfa_exp;
+	    fs->cfa_how = old_rs->cfa_how;
+	    old_rs->regs.prev = &unused_rs->regs;
 	    unused_rs = old_rs;
 	  }
 	  break;