dwarf2 frame unwinder assumptions on SP
Daniel Jacobowitz
drow@false.org
Mon Jul 11 15:47:00 GMT 2005
On Mon, Jul 11, 2005 at 05:32:15PM +0200, Christophe LYON wrote:
>
> > > Currently, in my x-tdep.c I have:
> > > set_gdbarch_unwind_pc(gdbarch, x_unwind_pc);
> > > frame_unwind_append_sniffer (gdbarch, dwarf2_frame_sniffer);
> >
> > It sounds like you need to set a "frame base" sniffer also, other than
> > the dwarf one. The dwarf2 frame unwinder does not set anything related
> > to the "frame base" used by symbolic debug information; it only unwinds
> > the stack pointer as best it can.
> >
> > Does "print $sp" work correctly when unwinding?
> >
>
> At frame #0, it's OK, at frame #1 it is not (it displays CFA).
Then you've got an unwinding problem. Your unwind information is not
providing adequate information to recreate the value of $sp, so
adjusting the frame base isn't going to help after all.
You probably want to provide an init_reg method which does something
clever with SP_REGNUM. You may get the easiest results by adjusting
DWARF2_FRAME_REG_CFA to support an offset, i.e., set $sp to the value
of the CFA plus some fixed offset.
--
Daniel Jacobowitz
CodeSourcery, LLC
More information about the Gdb
mailing list