This is the mail archive of the gdb@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[RFA] fix dwarf2 unwind of pc


On Sat, May 31, 2003 at 10:48:01PM -0400, Andrew Cagney wrote:
> The loss of control is likely from a dud return address (used for 
> setting the return breakpoint) being computed when the the code is first 
> stepped into dummy().

Indeed, a problem with the new dwarf2 unwinder.  Neither of the
targets Mark tested have the return address in a register.  Ok?


r~



	* dwarf2-frame.c (dwarf2_frame_cache): Handle retaddr_column
	not overlapping PC_REGNUM.

Index: dwarf2-frame.c
===================================================================
RCS file: /cvs/src/src/gdb/dwarf2-frame.c,v
retrieving revision 1.1
diff -c -p -d -r1.1 dwarf2-frame.c
*** dwarf2-frame.c	31 May 2003 19:18:05 -0000	1.1
--- dwarf2-frame.c	1 Jun 2003 04:26:17 -0000
*************** dwarf2_frame_cache (struct frame_info *n
*** 550,558 ****
  	cache->reg[regnum] = fs->regs.reg[reg];
      }
  
!   /* Stored the location of the return addess.  */
!   if (fs->retaddr_column < fs->regs.num_regs)
      cache->reg[PC_REGNUM] = fs->regs.reg[fs->retaddr_column];
  
    do_cleanups (old_chain);
  
--- 550,570 ----
  	cache->reg[regnum] = fs->regs.reg[reg];
      }
  
!   /* Store the location of the return addess.  If the return address
!      column (adjusted) is not the same as gdb's PC_REGNUM, then this
!      implies a copy from the ra column register.  */
!   if (fs->retaddr_column < fs->regs.num_regs
!       && fs->regs.reg[fs->retaddr_column].how != REG_UNSAVED)
      cache->reg[PC_REGNUM] = fs->regs.reg[fs->retaddr_column];
+   else
+     {
+       reg = DWARF2_REG_TO_REGNUM (fs->retaddr_column);
+       if (reg != PC_REGNUM)
+ 	{
+ 	  cache->reg[PC_REGNUM].loc.reg = reg;
+ 	  cache->reg[PC_REGNUM].how = REG_SAVED_REG;
+ 	}
+     }
  
    do_cleanups (old_chain);
  


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]