dwarf2 frame unwinder assumptions on SP
Christophe LYON
christophe.lyon@st.com
Mon Jul 11 15:33:00 GMT 2005
> > 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).
I have tried to add
frame_base_set_default (gdbarch, &x_frame_base);
where
static CORE_ADDR
x_frame_base_address (struct frame_info *next_frame, void **this_cache)
{
struct lx_frame_cache *cache = x_frame_cache (next_frame, this_cache);
fprintf(stderr, "In %s\n", __FUNCTION__);
return cache->base;
}
static const struct frame_base x_frame_base =
{
&x_frame_unwind,
x_frame_base_address,
x_frame_base_address,
x_frame_base_address
};
but in my test case x_frame_base_address() is not called.
(in funcargs, I set a bkp in call6b, run, then backtrace)
Isn't this what you mean by "frame base sniffer" ?
Thanks,
Christophe.
More information about the Gdb
mailing list