From 199b4314efbd419d6957e366e13a14cd87cea5e4 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Fri, 12 Jul 2019 10:45:34 -0600 Subject: Change map_matching_symbols to take a symbol_found_callback_ftype This changes map_matching_symbols to take a symbol_found_callback_ftype, rather than separate callback and data parameters. This enables a future patch to clean up some existing code so that it can more readily be shared. gdb/ChangeLog 2019-09-10 Tom Tromey * ada-lang.c (aux_add_nonlocal_symbols): Change type. (add_nonlocal_symbols): Update. * dwarf2read.c (dw2_map_matching_symbols): Change type. * psymtab.c (map_block, psym_map_matching_symbols): Change type. * symfile-debug.c (debug_qf_map_matching_symbols): Change type. * symfile.h (struct quick_symbol_functions) : Change type of "callback". Remove "data". --- gdb/symfile-debug.c | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) (limited to 'gdb/symfile-debug.c') diff --git a/gdb/symfile-debug.c b/gdb/symfile-debug.c index c5b565f..d36c192 100644 --- a/gdb/symfile-debug.c +++ b/gdb/symfile-debug.c @@ -228,30 +228,27 @@ debug_qf_expand_symtabs_with_fullname (struct objfile *objfile, } static void -debug_qf_map_matching_symbols (struct objfile *objfile, - const char *name, domain_enum domain, - int global, - int (*callback) (const struct block *, - struct symbol *, void *), - void *data, - symbol_name_match_type match, - symbol_compare_ftype *ordered_compare) +debug_qf_map_matching_symbols + (struct objfile *objfile, + const char *name, domain_enum domain, + int global, + gdb::function_view callback, + symbol_name_match_type match, + symbol_compare_ftype *ordered_compare) { const struct debug_sym_fns_data *debug_data = symfile_debug_objfile_data_key.get (objfile); fprintf_filtered (gdb_stdlog, - "qf->map_matching_symbols (%s, \"%s\", %s, %d, %s, %s, %s, %s)\n", + "qf->map_matching_symbols (%s, \"%s\", %s, %d, %s, %s)\n", objfile_debug_name (objfile), name, domain_name (domain), global, - host_address_to_string (callback), - host_address_to_string (data), plongest ((LONGEST) match), host_address_to_string (ordered_compare)); debug_data->real_sf->qf->map_matching_symbols (objfile, name, domain, global, - callback, data, + callback, match, ordered_compare); } -- cgit v1.1