diff options
author | Tom Tromey <tom@tromey.com> | 2021-03-26 13:44:24 -0600 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2021-03-26 13:44:24 -0600 |
commit | f4655dee7749516dd9f4867a58e2910a7c9610c8 (patch) | |
tree | 5c267433b9ccefa9c425905f28469604bafd9462 /gdb/dwarf2 | |
parent | 2315bb2d5764527617aef124cbcd52a13395e245 (diff) | |
download | binutils-f4655dee7749516dd9f4867a58e2910a7c9610c8.zip binutils-f4655dee7749516dd9f4867a58e2910a7c9610c8.tar.gz binutils-f4655dee7749516dd9f4867a58e2910a7c9610c8.tar.bz2 |
Use function view in quick_symbol_functions::map_symbol_filenames
This changes quick_symbol_functions::map_symbol_filenames to use a
function_view, and updates all the uses. It also changes the final
parameter to 'bool'. A couple of spots are further updated to use
operator() rather than a lambda.
gdb/ChangeLog
2021-03-26 Tom Tromey <tom@tromey.com>
* symtab.c (struct output_source_filename_data): Add 'output'
method and operator().
(output_source_filename_data::output): Rename from
output_source_filename.
(output_partial_symbol_filename): Remove.
(info_sources_command): Update.
(struct add_partial_filename_data): Add operator().
(add_partial_filename_data::operator()): Rename from
maybe_add_partial_symtab_filename.
(make_source_files_completion_list): Update.
* symfile.c (quick_symbol_functions): Update.
* symfile-debug.c (objfile::map_symbol_filenames): Update.
* quick-symbol.h (symbol_filename_ftype): Change type of 'fun' and
'need_fullname'. Remove 'data' parameter.
(struct quick_symbol_functions) <map_symbol_filenames>: Likewise.
* psymtab.c (psymbol_functions::map_symbol_filenames): Update.
* psympriv.h (struct psymbol_functions) <map_symbol_filenames>:
Change type of 'fun' and 'need_fullname'. Remove 'data'
parameter.
* objfiles.h (struct objfile) <map_symbol_filenames>: Change type
of 'fun' and 'need_fullname'. Remove 'data' parameter.
* mi/mi-cmd-file.c (print_partial_file_name): Remove 'ignore'
parameter.
(mi_cmd_file_list_exec_source_files): Update.
* dwarf2/read.c
(dwarf2_base_index_functions::map_symbol_filenames): Update.
Diffstat (limited to 'gdb/dwarf2')
-rw-r--r-- | gdb/dwarf2/read.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c index 2f4b54b..b324541 100644 --- a/gdb/dwarf2/read.c +++ b/gdb/dwarf2/read.c @@ -2230,8 +2230,8 @@ struct dwarf2_base_index_functions : public quick_symbol_functions } void map_symbol_filenames (struct objfile *objfile, - symbol_filename_ftype *fun, void *data, - int need_fullname) override; + gdb::function_view<symbol_filename_ftype> fun, + bool need_fullname) override; }; struct dwarf2_gdb_index : public dwarf2_base_index_functions @@ -4945,10 +4945,10 @@ dwarf2_base_index_functions::find_pc_sect_compunit_symtab } void -dwarf2_base_index_functions::map_symbol_filenames (struct objfile *objfile, - symbol_filename_ftype *fun, - void *data, - int need_fullname) +dwarf2_base_index_functions::map_symbol_filenames + (struct objfile *objfile, + gdb::function_view<symbol_filename_ftype> fun, + bool need_fullname) { dwarf2_per_objfile *per_objfile = get_dwarf2_per_objfile (objfile); @@ -5009,7 +5009,7 @@ dwarf2_base_index_functions::map_symbol_filenames (struct objfile *objfile, if (need_fullname) this_real_name = gdb_realpath (filename); - (*fun) (filename, this_real_name.get (), data); + fun (filename, this_real_name.get ()); }); } |