[RFC] Use address_from_register in dwarf2-frame.c:read_addr_from_reg
Joel Brobecker
brobecker@adacore.com
Wed Apr 16 15:29:00 GMT 2014
> ChangeLog:
>
> * gdbarch.sh (value_from_register): Make class "m" instead of "f".
> Replace FRAME argument with FRAME_ID.
> * gdbarch.c, gdbarch.h: Regenerate.
> * findvar.c (default_value_from_register): Add GDBARCH argument;
> replace FRAME by FRAME_ID. No longer call get_frame_id.
> (value_from_register): Update call to gdbarch_value_from_register.
> * value.h (default_value_from_register): Update prototype.
> * s390-linux-tdep.c (s390_value_from_register): Update interface
> and call to default_value_from_register.
> * spu-tdep.c (spu_value_from_register): Likewise.
>
> * findvar.c (address_from_register): Remove TYPE argument.
> Do not call value_from_register; use gdbarch_value_from_register
> with null_frame_id instead.
> * value.h (address_from_register): Update prototype.
> * dwarf2-frame.c (read_addr_from_reg): Use address_from_register.
> * dwarf2loc.c (dwarf_expr_read_addr_from_reg): Update for
> address_from_register interface change.
FWIW, I am not a specialist here, but it seemed reasonable to me.
It took me a minute or two to figure out that you needed to make
value_from_register a class "m" because you don't have access to
the gdbarch via the frame anymore, so you have to have it passed
directly. Perhaps it's worth a sentence in the revision log when
you commit the patch?
Thanks for the detailed comment explaining why we use a null_frame_id
in address_from_register, and why it's OK to do so. Very helpful!
--
Joel
More information about the Gdb-patches
mailing list