RFC: fix bug in DW_OP_GNU_implicit_pointer

Jan Kratochvil jan.kratochvil@redhat.com
Sat Dec 1 17:53:00 GMT 2012


On Fri, 30 Nov 2012 21:03:05 +0100, Tom Tromey wrote:
> Doug pointed out to me a while ago that DW_OP_GNU_implicit_pointer is
> specified as taking a section offset as an argument, but gdb implements
> it as taking a CU offset.  See:

And how it is implemented in GCC?


> I updated the implptr-64bit test case to test the new code as well.

This is .S test so GCC is not tested there.


> +struct dwarf2_locexpr_baton dwarf2_fetch_die_location_block_section
> +  (sect_offset offset_in_cu, struct dwarf2_per_cu_data *per_cu,
> +   CORE_ADDR (*get_frame_pc) (void *baton),
> +   void *baton);
> +
>  struct dwarf2_locexpr_baton dwarf2_fetch_die_location_block

Maybe to call them now for example:
  dwarf2_fetch_die_loc_cu_off
  dwarf2_fetch_die_loc_sect_off

Also fine with it as you wrote it, it is also not a win.


[...]
> --- a/gdb/testsuite/gdb.dwarf2/implptr-64bit.exp
> +++ b/gdb/testsuite/gdb.dwarf2/implptr-64bit.exp
[...]
>  #    DWARF_VERSION OFFSET_SIZE ADDR_SIZE REF_ADDR_SIZE

Missing added TWO_CU here.


> -test 2 8 4 4
[...]
> +test 2 8 4 4 0


Thanks,
Jan



More information about the Gdb-patches mailing list