create_new_frame() on Linux/IA64
Kevin Buettner
kevinb@redhat.com
Fri Sep 13 13:11:00 GMT 2002
On Sep 13, 5:17pm, Johan Walles wrote:
> I'm trying to insert artificial stack frames in a backtrace using
> create_new_frame(addr, pc) on Linux/IA64. The pc parameter is quite
> obvious, but what should I use for addr?
The frame pointer. You might find the following bit from ia64-tdep.c
to be useful:
/* We won't necessarily have a frame pointer and even if we do,
it winds up being extraordinarly messy when attempting to find
the frame chain. So for the purposes of creating frames (which
is all read_fp() is used for), simply use the stack pointer value
instead. */
set_gdbarch_read_fp (gdbarch, generic_target_read_sp);
However, it turns out that this isn't really sufficient since it's
possible to leave the memory stack pointer fixed, but change the
bsp value in the register stack. There have been some proposals
(and patches) for dealing with this. See:
http://sources.redhat.com/ml/gdb-patches/2002-05/msg00377.html
and the associated thread.
Kevin
More information about the Gdb
mailing list