From f4655dee7749516dd9f4867a58e2910a7c9610c8 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Fri, 26 Mar 2021 13:44:24 -0600 Subject: 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 * 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) : Likewise. * psymtab.c (psymbol_functions::map_symbol_filenames): Update. * psympriv.h (struct psymbol_functions) : Change type of 'fun' and 'need_fullname'. Remove 'data' parameter. * objfiles.h (struct objfile) : 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. --- gdb/quick-symbol.h | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'gdb/quick-symbol.h') diff --git a/gdb/quick-symbol.h b/gdb/quick-symbol.h index dd2b896..d907b1d 100644 --- a/gdb/quick-symbol.h +++ b/gdb/quick-symbol.h @@ -28,7 +28,7 @@ typedef int (symbol_compare_ftype) (const char *string1, /* Callback for quick_symbol_functions->map_symbol_filenames. */ typedef void (symbol_filename_ftype) (const char *filename, - const char *fullname, void *data); + const char *fullname); /* Callback for quick_symbol_functions->expand_symtabs_matching to match a file name. */ @@ -224,12 +224,13 @@ struct quick_symbol_functions (struct objfile *objfile, CORE_ADDR address) = 0; /* Call a callback for every file defined in OBJFILE whose symtab is - not already read in. FUN is the callback. It is passed the file's - FILENAME, the file's FULLNAME (if need_fullname is non-zero), and - the DATA passed to this function. */ - virtual void map_symbol_filenames (struct objfile *objfile, - symbol_filename_ftype *fun, void *data, - int need_fullname) = 0; + not already read in. FUN is the callback. It is passed the + file's FILENAME and the file's FULLNAME (if need_fullname is + non-zero). */ + virtual void map_symbol_filenames + (struct objfile *objfile, + gdb::function_view fun, + bool need_fullname) = 0; /* This is called when the objfile is relocated. It can be used to clean up any internal caches. */ -- cgit v1.1