gdb: replace function pointer with `void *` data with function_view
authorSimon Marchi <simon.marchi@polymtl.ca>
Sun, 9 Aug 2020 22:26:48 +0000 (18:26 -0400)
committerSimon Marchi <simon.marchi@polymtl.ca>
Sun, 9 Aug 2020 22:26:48 +0000 (18:26 -0400)
commit041d9819fb0d05f55d54e2d7880a63db9fa423cb
treeb3025209375196af78ae14ade1fc60582013f519
parent0770687e1ee8205b656a71698e4680e1ef8d746f
gdb: replace function pointer with `void *` data with function_view

Replace the function pointer + `void *` parameters of
dwarf2_fetch_die_loc_sect_off and dwarf2_fetch_die_loc_cu_off with a
function_view parameter.  Change call sites to use a lambda function.
This improves type-safety, so reduces the chances of errors.

gdb/ChangeLog:

* read.h (dwarf2_fetch_die_loc_sect_off,
dwarf2_fetch_die_loc_cu_off): Replace function pointer +
`void *` parameter with function_view.
* read.c (dwarf2_fetch_die_loc_sect_off,
dwarf2_fetch_die_loc_cu_off): Likewise.
* loc.c (get_frame_pc_for_per_cu_dwarf_call): Remove.
(per_cu_dwarf_call): Adjust.
(get_frame_address_in_block_wrapper): Remove.
(indirect_synthetic_pointer): Adjust.
(get_ax_pc): Remove.
(dwarf2_compile_expr_to_ax): Adjust.

Change-Id: Ic9b6ced0c4128f2b75ca62e0ed638b0962a22859
gdb/ChangeLog
gdb/dwarf2/loc.c
gdb/dwarf2/read.c
gdb/dwarf2/read.h