This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
Re: dwarf2 frame unwinder assumptions on SP
- From: Christophe LYON <christophe dot lyon at st dot com>
- To: Daniel Jacobowitz <drow at false dot org>
- Cc: gdb at sources dot redhat dot com
- Date: Mon, 11 Jul 2005 17:32:15 +0200
- Subject: Re: dwarf2 frame unwinder assumptions on SP
- References: <42D285AB.9E36C062@st.com> <20050711145053.GA29229@nevyn.them.org>
> > 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.