This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
[RFA] fix dwarf2 unwind of pc
- From: Richard Henderson <rth at redhat dot com>
- To: Andrew Cagney <ac131313 at redhat dot com>
- Cc: gdb at sources dot redhat dot com
- Date: Sat, 31 May 2003 21:27:45 -0700
- Subject: [RFA] fix dwarf2 unwind of pc
- References: <20030601013551.GA12120@redhat.com> <3ED96961.2030401@redhat.com>
- Reply-to: rth at twiddle dot net
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);