Discrepency between gdbarch_frame_locals_address and get_frame_locals_address?
Andrew Cagney
ac131313@redhat.com
Mon Jun 23 19:47:00 GMT 2003
> Andrew,
>
> Whilst poking around on related things, I observed that, at least on
> Linux,
Um, which GNU/Linux, which architecture, and how recent a GDB? Lets
assume i386 and gdb_6_0-branch.
> the values of gdbarch_frame_locals_address and
> get_frame_locals_address disagree. The latter appears to be correct,
> since it is used in read_var_value in what I assume is the intended
> way (add SYMBOL_VALUE to get_frame_locals_address (frame) to get
> variable address).
Yes. get_frame_locals_address returns what debug info thinks of as the
frame base. Local variables being specified as offsets from that
address. Just don't confuse it with gdb's [deprecated] get_frame_base :-(
> Would you like a patch, or is there a subtle
> point here that I am missing?
There is likely a subtle point^D^D^Dproblem vis: The backward
compatible path is
get_frame_locals_address
-> [deprecated] gdbarch_frame_locals_address
-> get_frame_base
-> get_frame_id.stack_addr
and, so pre-frame code has identical values for both. New code,
however, has a different frame ID .stack_addr and frame-locals-address.
You've probably found code using the wrong one.
Andrew
More information about the Gdb
mailing list