[PATCH] gdb: replace function pointer with `void *` data with function_view

Tom Tromey tom@tromey.com
Fri Aug 7 20:54:47 GMT 2020


>>>>> "Simon" == Simon Marchi via Gdb-patches <gdb-patches@sourceware.org> writes:

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

Simon> gdb/ChangeLog:

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

Looks good, thanks.

Tom


More information about the Gdb-patches mailing list