]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
gdb: move "gdb:function_view" into quick-symbol.h typedefs
authorSimon Marchi <simon.marchi@polymtl.ca>
Tue, 25 Feb 2025 21:28:38 +0000 (16:28 -0500)
committerSimon Marchi <simon.marchi@polymtl.ca>
Wed, 26 Feb 2025 03:22:52 +0000 (22:22 -0500)
All users of these typedefs use them inside a gdb::function_view.  Move
the gdb::function_view in the typedefs themselves.  This shortens the
types in function signatures and helps with readability, IMO.

Rename them to remove the `_ftype` suffix: this suffix is not as
relevant in C++ as it was in C.  With function_view, the caller can pass
more than just a simple "function".  Anyway, I think it's clearer to
name them after the role the callback has (listener, matcher, etc).

Adjust some related comments.

Change-Id: Iaf9f8ede68b51ea9e4d954792e8eb90def8659a6
Approved-By: Tom Tromey <tom@tromey.com>
12 files changed:
gdb/dwarf2/cooked-index.h
gdb/dwarf2/read-gdb-index.c
gdb/dwarf2/read.c
gdb/dwarf2/read.h
gdb/objfiles.h
gdb/psymtab.c
gdb/psymtab.h
gdb/quick-symbol.h
gdb/symfile-debug.c
gdb/symfile.c
gdb/symfile.h
gdb/symtab.c

index 925f73b5f6c15860787898b2cd244739cc66837e..d642c132f8af381d228b8c3631138fbbeb14434f 100644 (file)
@@ -782,14 +782,13 @@ struct cooked_index_functions : public dwarf2_base_index_functions
 
   bool expand_symtabs_matching
     (struct objfile *objfile,
-     gdb::function_view<expand_symtabs_file_matcher_ftype> file_matcher,
+     expand_symtabs_file_matcher file_matcher,
      const lookup_name_info *lookup_name,
-     gdb::function_view<expand_symtabs_symbol_matcher_ftype> symbol_matcher,
-     gdb::function_view<expand_symtabs_exp_notify_ftype> expansion_notify,
+     expand_symtabs_symbol_matcher symbol_matcher,
+     expand_symtabs_expansion_listener expansion_notify,
      block_search_flags search_flags,
      domain_search_flags domain,
-     gdb::function_view<expand_symtabs_lang_matcher_ftype> lang_matcher)
-       override;
+     expand_symtabs_lang_matcher lang_matcher) override;
 
   struct compunit_symtab *find_pc_sect_compunit_symtab
     (struct objfile *objfile, bound_minimal_symbol msymbol,
@@ -800,10 +799,8 @@ struct cooked_index_functions : public dwarf2_base_index_functions
            (objfile, msymbol, pc, section, warn_if_readin));
   }
 
-  void map_symbol_filenames
-       (struct objfile *objfile,
-       gdb::function_view<symbol_filename_ftype> fun,
-       bool need_fullname) override
+  void map_symbol_filenames (objfile *objfile, symbol_filename_listener fun,
+                            bool need_fullname) override
   {
     wait (objfile, true);
     return (dwarf2_base_index_functions::map_symbol_filenames
index 103fc734778b03ab4a031974fc6e4849a6c62f01..6aba850628b7fbfb95c0e2a5b81fe01ae714adbb 100644 (file)
@@ -434,10 +434,10 @@ static bool
 dw2_expand_symtabs_matching_symbol
   (mapped_gdb_index &index,
    const lookup_name_info &lookup_name_in,
-   gdb::function_view<expand_symtabs_symbol_matcher_ftype> symbol_matcher,
+   expand_symtabs_symbol_matcher symbol_matcher,
    gdb::function_view<bool (offset_type)> match_callback,
    dwarf2_per_objfile *per_objfile,
-   gdb::function_view<expand_symtabs_lang_matcher_ftype> lang_matcher)
+   expand_symtabs_lang_matcher lang_matcher)
 {
   lookup_name_info lookup_name_without_params
     = lookup_name_in.make_ignore_params ();
@@ -999,14 +999,13 @@ struct dwarf2_gdb_index : public dwarf2_base_index_functions
 
   bool expand_symtabs_matching
     (struct objfile *objfile,
-     gdb::function_view<expand_symtabs_file_matcher_ftype> file_matcher,
+     expand_symtabs_file_matcher file_matcher,
      const lookup_name_info *lookup_name,
-     gdb::function_view<expand_symtabs_symbol_matcher_ftype> symbol_matcher,
-     gdb::function_view<expand_symtabs_exp_notify_ftype> expansion_notify,
+     expand_symtabs_symbol_matcher symbol_matcher,
+     expand_symtabs_expansion_listener expansion_notify,
      block_search_flags search_flags,
      domain_search_flags domain,
-     gdb::function_view<expand_symtabs_lang_matcher_ftype> lang_matcher)
-       override;
+     expand_symtabs_lang_matcher lang_matcher) override;
 };
 
 /* This dumps minimal information about the index.
@@ -1030,13 +1029,12 @@ dwarf2_gdb_index::dump (struct objfile *objfile)
    index of the symbol name that matched.  */
 
 static bool
-dw2_expand_marked_cus
-  (dwarf2_per_objfile *per_objfile, offset_type idx,
-   gdb::function_view<expand_symtabs_file_matcher_ftype> file_matcher,
-   gdb::function_view<expand_symtabs_exp_notify_ftype> expansion_notify,
-   block_search_flags search_flags,
-   domain_search_flags kind,
-   gdb::function_view<expand_symtabs_lang_matcher_ftype> lang_matcher)
+dw2_expand_marked_cus (dwarf2_per_objfile *per_objfile, offset_type idx,
+                      expand_symtabs_file_matcher file_matcher,
+                      expand_symtabs_expansion_listener expansion_notify,
+                      block_search_flags search_flags,
+                      domain_search_flags kind,
+                      expand_symtabs_lang_matcher lang_matcher)
 {
   offset_type vec_len, vec_idx;
   bool global_seen = false;
@@ -1126,14 +1124,14 @@ dw2_expand_marked_cus
 
 bool
 dwarf2_gdb_index::expand_symtabs_matching
-    (struct objfile *objfile,
-     gdb::function_view<expand_symtabs_file_matcher_ftype> file_matcher,
-     const lookup_name_info *lookup_name,
-     gdb::function_view<expand_symtabs_symbol_matcher_ftype> symbol_matcher,
-     gdb::function_view<expand_symtabs_exp_notify_ftype> expansion_notify,
-     block_search_flags search_flags,
-     domain_search_flags domain,
-     gdb::function_view<expand_symtabs_lang_matcher_ftype> lang_matcher)
+  (objfile *objfile,
+   expand_symtabs_file_matcher file_matcher,
+   const lookup_name_info *lookup_name,
+   expand_symtabs_symbol_matcher symbol_matcher,
+   expand_symtabs_expansion_listener expansion_notify,
+   block_search_flags search_flags,
+   domain_search_flags domain,
+   expand_symtabs_lang_matcher lang_matcher)
 {
   dwarf2_per_objfile *per_objfile = get_dwarf2_per_objfile (objfile);
 
index ecc2c53ba028594900fe405e2f10d6e331c015f7..3d4ae49b6696128646c3eb52799899e8b3935136 100644 (file)
@@ -1661,14 +1661,13 @@ struct readnow_functions : public dwarf2_base_index_functions
 
   bool expand_symtabs_matching
     (struct objfile *objfile,
-     gdb::function_view<expand_symtabs_file_matcher_ftype> file_matcher,
+     expand_symtabs_file_matcher file_matcher,
      const lookup_name_info *lookup_name,
-     gdb::function_view<expand_symtabs_symbol_matcher_ftype> symbol_matcher,
-     gdb::function_view<expand_symtabs_exp_notify_ftype> expansion_notify,
+     expand_symtabs_symbol_matcher symbol_matcher,
+     expand_symtabs_expansion_listener expansion_notify,
      block_search_flags search_flags,
      domain_search_flags domain,
-     gdb::function_view<expand_symtabs_lang_matcher_ftype> lang_matcher)
-       override
+     expand_symtabs_lang_matcher lang_matcher) override
   {
     return true;
   }
@@ -2094,9 +2093,9 @@ bool
 dw2_expand_symtabs_matching_one
   (dwarf2_per_cu_data *per_cu,
    dwarf2_per_objfile *per_objfile,
-   gdb::function_view<expand_symtabs_file_matcher_ftype> file_matcher,
-   gdb::function_view<expand_symtabs_exp_notify_ftype> expansion_notify,
-   gdb::function_view<expand_symtabs_lang_matcher_ftype> lang_matcher)
+   expand_symtabs_file_matcher file_matcher,
+   expand_symtabs_expansion_listener expansion_notify,
+   expand_symtabs_lang_matcher lang_matcher)
 {
   if (file_matcher != nullptr && !per_cu->mark)
     return true;
@@ -2125,8 +2124,7 @@ dw2_expand_symtabs_matching_one
 
 void
 dw_expand_symtabs_matching_file_matcher
-  (dwarf2_per_objfile *per_objfile,
-   gdb::function_view<expand_symtabs_file_matcher_ftype> file_matcher)
+  (dwarf2_per_objfile *per_objfile, expand_symtabs_file_matcher file_matcher)
 {
   if (file_matcher == NULL)
     return;
@@ -2281,10 +2279,9 @@ dwarf2_base_index_functions::find_pc_sect_compunit_symtab
 }
 
 void
-dwarf2_base_index_functions::map_symbol_filenames
-     (struct objfile *objfile,
-      gdb::function_view<symbol_filename_ftype> fun,
-      bool need_fullname)
+dwarf2_base_index_functions::map_symbol_filenames (objfile *objfile,
+                                                  symbol_filename_listener fun,
+                                                  bool need_fullname)
 {
   dwarf2_per_objfile *per_objfile = get_dwarf2_per_objfile (objfile);
 
@@ -15996,14 +15993,14 @@ cooked_index_functions::find_compunit_symtab_by_address
 
 bool
 cooked_index_functions::expand_symtabs_matching
-     (struct objfile *objfile,
-      gdb::function_view<expand_symtabs_file_matcher_ftype> file_matcher,
-      const lookup_name_info *lookup_name,
-      gdb::function_view<expand_symtabs_symbol_matcher_ftype> symbol_matcher,
-      gdb::function_view<expand_symtabs_exp_notify_ftype> expansion_notify,
-      block_search_flags search_flags,
-      domain_search_flags domain,
-      gdb::function_view<expand_symtabs_lang_matcher_ftype> lang_matcher)
+  (objfile *objfile,
+   expand_symtabs_file_matcher file_matcher,
+   const lookup_name_info *lookup_name,
+   expand_symtabs_symbol_matcher symbol_matcher,
+   expand_symtabs_expansion_listener expansion_notify,
+   block_search_flags search_flags,
+   domain_search_flags domain,
+   expand_symtabs_lang_matcher lang_matcher)
 {
   dwarf2_per_objfile *per_objfile = get_dwarf2_per_objfile (objfile);
 
index a7313a6e8ca9c27ef4b886a535b303b861df54bd..24decd761c1bc6ec12217d440ca490965c3ffe1d 100644 (file)
@@ -929,8 +929,7 @@ struct dwarf2_base_index_functions : public quick_symbol_functions
     return nullptr;
   }
 
-  void map_symbol_filenames (struct objfile *objfile,
-                            gdb::function_view<symbol_filename_ftype> fun,
+  void map_symbol_filenames (objfile *objfile, symbol_filename_listener fun,
                             bool need_fullname) override;
 };
 
@@ -942,9 +941,9 @@ struct dwarf2_base_index_functions : public quick_symbol_functions
 extern bool dw2_expand_symtabs_matching_one
   (dwarf2_per_cu_data *per_cu,
    dwarf2_per_objfile *per_objfile,
-   gdb::function_view<expand_symtabs_file_matcher_ftype> file_matcher,
-   gdb::function_view<expand_symtabs_exp_notify_ftype> expansion_notify,
-   gdb::function_view<expand_symtabs_lang_matcher_ftype> lang_matcher);
+   expand_symtabs_file_matcher file_matcher,
+   expand_symtabs_expansion_listener expansion_notify,
+   expand_symtabs_lang_matcher lang_matcher);
 
 /* If FILE_MATCHER is non-NULL, set all the
    dwarf2_per_cu_quick_data::MARK of the current DWARF2_PER_OBJFILE
@@ -952,7 +951,7 @@ extern bool dw2_expand_symtabs_matching_one
 
 extern void dw_expand_symtabs_matching_file_matcher
   (dwarf2_per_objfile *per_objfile,
-   gdb::function_view<expand_symtabs_file_matcher_ftype> file_matcher);
+   expand_symtabs_file_matcher file_matcher);
 
 /* Return pointer to string at .debug_str offset STR_OFFSET.  */
 
index 4ac56d70741c8d70427ec66a3bbdb34e85133c75..05e1e01d6352f6c0295e71fd611d6d6a19853673 100644 (file)
@@ -593,14 +593,13 @@ public:
 
   /* See quick_symbol_functions.  */
   bool expand_symtabs_matching
-    (gdb::function_view<expand_symtabs_file_matcher_ftype> file_matcher,
+    (expand_symtabs_file_matcher file_matcher,
      const lookup_name_info *lookup_name,
-     gdb::function_view<expand_symtabs_symbol_matcher_ftype> symbol_matcher,
-     gdb::function_view<expand_symtabs_exp_notify_ftype> expansion_notify,
+     expand_symtabs_symbol_matcher symbol_matcher,
+     expand_symtabs_expansion_listener expansion_notify,
      block_search_flags search_flags,
      domain_search_flags domain,
-     gdb::function_view<expand_symtabs_lang_matcher_ftype> lang_matcher
-       = nullptr);
+     expand_symtabs_lang_matcher lang_matcher = nullptr);
 
   /* See quick_symbol_functions.  */
   struct compunit_symtab *
@@ -609,8 +608,7 @@ public:
                                int warn_if_readin);
 
   /* See quick_symbol_functions.  */
-  void map_symbol_filenames (gdb::function_view<symbol_filename_ftype> fun,
-                            bool need_fullname);
+  void map_symbol_filenames (symbol_filename_listener fun, bool need_fullname);
 
   /* See quick_symbol_functions.  */
   void compute_main_name ();
index ef7fa23079b898384551d5bde1dfa1166958a268..28455ba0bc58990a515f0899a873c9995fb4cca8 100644 (file)
@@ -735,10 +735,9 @@ psymbol_functions::expand_all_symtabs (struct objfile *objfile)
    the definition of quick_symbol_functions in symfile.h.  */
 
 void
-psymbol_functions::map_symbol_filenames
-     (struct objfile *objfile,
-      gdb::function_view<symbol_filename_ftype> fun,
-      bool need_fullname)
+psymbol_functions::map_symbol_filenames (objfile *objfile,
+                                        symbol_filename_listener fun,
+                                        bool need_fullname)
 {
   for (partial_symtab *ps : partial_symbols (objfile))
     {
@@ -797,13 +796,11 @@ psymtab_to_fullname (struct partial_symtab *ps)
    various psymtabs that it searches.  */
 
 static bool
-recursively_search_psymtabs
-  (struct partial_symtab *ps,
-   struct objfile *objfile,
-   block_search_flags search_flags,
-   domain_search_flags domain,
-   const lookup_name_info &lookup_name,
-   gdb::function_view<expand_symtabs_symbol_matcher_ftype> sym_matcher)
+recursively_search_psymtabs (partial_symtab *ps, objfile *objfile,
+                            block_search_flags search_flags,
+                            domain_search_flags domain,
+                            const lookup_name_info &lookup_name,
+                            expand_symtabs_symbol_matcher sym_matcher)
 {
   int keep_going = 1;
   enum psymtab_search_status result = PST_SEARCHED_AND_NOT_FOUND;
@@ -894,14 +891,13 @@ recursively_search_psymtabs
 bool
 psymbol_functions::expand_symtabs_matching
   (struct objfile *objfile,
-   gdb::function_view<expand_symtabs_file_matcher_ftype> file_matcher,
+   expand_symtabs_file_matcher file_matcher,
    const lookup_name_info *lookup_name,
-   gdb::function_view<expand_symtabs_symbol_matcher_ftype> symbol_matcher,
-   gdb::function_view<expand_symtabs_exp_notify_ftype> expansion_notify,
+   expand_symtabs_symbol_matcher symbol_matcher,
+   expand_symtabs_expansion_listener expansion_notify,
    block_search_flags search_flags,
    domain_search_flags domain,
-   gdb::function_view<expand_symtabs_lang_matcher_ftype>
-     lang_matcher ATTRIBUTE_UNUSED)
+   expand_symtabs_lang_matcher lang_matcher ATTRIBUTE_UNUSED)
 {
   /* Clear the search flags.  */
   for (partial_symtab *ps : partial_symbols (objfile))
index 411c95e8cda3db9422863b4e9fcd0e8a3ce9c6e8..129f66e12b9e48ab3aaa1d2ba0df1a403ba46d24 100644 (file)
@@ -628,14 +628,13 @@ struct psymbol_functions : public quick_symbol_functions
 
   bool expand_symtabs_matching
     (struct objfile *objfile,
-     gdb::function_view<expand_symtabs_file_matcher_ftype> file_matcher,
+     expand_symtabs_file_matcher file_matcher,
      const lookup_name_info *lookup_name,
-     gdb::function_view<expand_symtabs_symbol_matcher_ftype> symbol_matcher,
-     gdb::function_view<expand_symtabs_exp_notify_ftype> expansion_notify,
+     expand_symtabs_symbol_matcher symbol_matcher,
+     expand_symtabs_expansion_listener expansion_notify,
      block_search_flags search_flags,
      domain_search_flags kind,
-     gdb::function_view<expand_symtabs_lang_matcher_ftype> lang_matcher)
-       override;
+     expand_symtabs_lang_matcher lang_matcher) override;
 
   struct compunit_symtab *find_pc_sect_compunit_symtab
     (struct objfile *objfile, bound_minimal_symbol msymbol, CORE_ADDR pc,
@@ -647,8 +646,7 @@ struct psymbol_functions : public quick_symbol_functions
     return nullptr;
   }
 
-  void map_symbol_filenames (struct objfile *objfile,
-                            gdb::function_view<symbol_filename_ftype> fun,
+  void map_symbol_filenames (objfile *objfile, symbol_filename_listener fun,
                             bool need_fullname) override;
 
   /* Return a range adapter for the psymtabs.  */
index 9dbaf499c251e272c60a1220e18ec00939fdf2f9..32090db69cde9045e3d899127317e7cbafafcec8 100644 (file)
@@ -32,33 +32,36 @@ enum block_search_flag_values
 
 DEF_ENUM_FLAGS_TYPE (enum block_search_flag_values, block_search_flags);
 
-/* Callback for quick_symbol_functions->map_symbol_filenames.  */
+/* Callback for quick_symbol_functions::map_symbol_filenames.  */
 
-typedef void (symbol_filename_ftype) (const char *filename,
-                                     const char *fullname);
+using symbol_filename_listener
+  = gdb::function_view<void (const char *filename, const char *fullname)>;
 
-/* Callback for quick_symbol_functions->expand_symtabs_matching
+/* Callback for quick_symbol_functions::expand_symtabs_matching
    to match a file name.  */
 
-typedef bool (expand_symtabs_file_matcher_ftype) (const char *filename,
-                                                 bool basenames);
+using expand_symtabs_file_matcher
+  = gdb::function_view<bool (const char *filename, bool basenames)>;
 
-/* Callback for quick_symbol_functions->expand_symtabs_matching
+/* Callback for quick_symbol_functions::expand_symtabs_matching
    to match a symbol name.  */
 
-typedef bool (expand_symtabs_symbol_matcher_ftype) (const char *name);
+using expand_symtabs_symbol_matcher
+  = gdb::function_view<bool (const char *name)>;
 
-/* Callback for quick_symbol_functions->expand_symtabs_matching
+/* Callback for quick_symbol_functions::expand_symtabs_matching
    to match a language.  */
 
-typedef bool (expand_symtabs_lang_matcher_ftype) (enum language lang);
+using expand_symtabs_lang_matcher
+  = gdb::function_view<bool (enum language lang)>;
 
-/* Callback for quick_symbol_functions->expand_symtabs_matching
+/* Callback for quick_symbol_functions::expand_symtabs_matching
    to be called after a symtab has been expanded.  If this returns
    true, more symtabs are checked; if it returns false, iteration
    stops.  */
 
-typedef bool (expand_symtabs_exp_notify_ftype) (compunit_symtab *symtab);
+using expand_symtabs_expansion_listener
+  = gdb::function_view<bool (compunit_symtab *symtab)>;
 
 /* The "quick" symbol functions exist so that symbol readers can
    avoiding an initial read of all the symbols.  For example, symbol
@@ -153,21 +156,19 @@ struct quick_symbol_functions
      Note that if SYMBOL_MATCHER is non-NULL, then LOOKUP_NAME must
      also be provided.
 
-     Otherwise, the symbol's symbol table is expanded and the
-     notification function is called.  If the notification function
-     returns false, execution stops and this method returns false.
-     Otherwise, more files are considered.  This method will return
-     true if all calls to the notification function return true.  */
+     Otherwise, the symbol's symbol table is expanded and EXPANSION_NOTIFY is
+     called.  If EXPANSION_NOTIFY returns false, execution stops and this method
+     returns false.  Otherwise, more files are considered.  This method returns
+     true if all calls to EXPANSION_NOTIFY return true.  */
   virtual bool expand_symtabs_matching
     (struct objfile *objfile,
-     gdb::function_view<expand_symtabs_file_matcher_ftype> file_matcher,
+     expand_symtabs_file_matcher file_matcher,
      const lookup_name_info *lookup_name,
-     gdb::function_view<expand_symtabs_symbol_matcher_ftype> symbol_matcher,
-     gdb::function_view<expand_symtabs_exp_notify_ftype> expansion_notify,
+     expand_symtabs_symbol_matcher symbol_matcher,
+     expand_symtabs_expansion_listener expansion_notify,
      block_search_flags search_flags,
      domain_search_flags domain,
-     gdb::function_view<expand_symtabs_lang_matcher_ftype> lang_matcher
-       = nullptr) = 0;
+     expand_symtabs_lang_matcher lang_matcher = nullptr) = 0;
 
   /* Return the comp unit from OBJFILE that contains PC and
      SECTION.  Return NULL if there is no such compunit.  This
@@ -187,14 +188,14 @@ struct quick_symbol_functions
   virtual struct compunit_symtab *find_compunit_symtab_by_address
     (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 and the file's FULLNAME (if need_fullname is
-     non-zero).  */
-  virtual void map_symbol_filenames
-       (struct objfile *objfile,
-       gdb::function_view<symbol_filename_ftype> fun,
-       bool need_fullname) = 0;
+  /* Call FUN for every file defined in OBJFILE whose symtab is
+     not already read in.
+     
+     FUN is passed the file's FILENAME and the file's FULLNAME (if need_fullname
+     is true).  */
+  virtual void map_symbol_filenames (objfile *objfile,
+                                    symbol_filename_listener fun,
+                                    bool need_fullname) = 0;
 
   /* Compute the name and language of the main function for the given
      objfile.  Normally this is done during symbol reading, but this
index 5c414780eb07a3a5994e634b03a2a5667168de4b..dda3efe9db35fa9bded93edf77ded7a0250a96b2 100644 (file)
@@ -370,13 +370,13 @@ objfile::expand_symtabs_with_fullname (const char *fullname)
 
 bool
 objfile::expand_symtabs_matching
-  (gdb::function_view<expand_symtabs_file_matcher_ftype> file_matcher,
+  (expand_symtabs_file_matcher file_matcher,
    const lookup_name_info *lookup_name,
-   gdb::function_view<expand_symtabs_symbol_matcher_ftype> symbol_matcher,
-   gdb::function_view<expand_symtabs_exp_notify_ftype> expansion_notify,
+   expand_symtabs_symbol_matcher symbol_matcher,
+   expand_symtabs_expansion_listener expansion_notify,
    block_search_flags search_flags,
    domain_search_flags domain,
-   gdb::function_view<expand_symtabs_lang_matcher_ftype> lang_matcher)
+   expand_symtabs_lang_matcher lang_matcher)
 {
   /* This invariant is documented in quick-functions.h.  */
   gdb_assert (lookup_name != nullptr || symbol_matcher == nullptr);
@@ -435,8 +435,7 @@ objfile::find_pc_sect_compunit_symtab (bound_minimal_symbol msymbol,
 }
 
 void
-objfile::map_symbol_filenames (gdb::function_view<symbol_filename_ftype> fun,
-                              bool need_fullname)
+objfile::map_symbol_filenames (symbol_filename_listener fun, bool need_fullname)
 {
   if (debug_symfile)
     gdb_printf (gdb_stdlog,
index 4d5f3d2626278eec835ae968fe55d3b61be9fed3..b0c178a5aeb75c23862d6dd25a9e4bc6235ee231 100644 (file)
@@ -3761,14 +3761,13 @@ symfile_free_objfile (struct objfile *objfile)
    See quick_symbol_functions.expand_symtabs_matching for details.  */
 
 bool
-expand_symtabs_matching
-  (gdb::function_view<expand_symtabs_file_matcher_ftype> file_matcher,
-   const lookup_name_info &lookup_name,
-   gdb::function_view<expand_symtabs_symbol_matcher_ftype> symbol_matcher,
-   gdb::function_view<expand_symtabs_exp_notify_ftype> expansion_notify,
-   block_search_flags search_flags,
-   domain_search_flags domain,
-   gdb::function_view<expand_symtabs_lang_matcher_ftype> lang_matcher)
+expand_symtabs_matching (expand_symtabs_file_matcher file_matcher,
+                        const lookup_name_info &lookup_name,
+                        expand_symtabs_symbol_matcher symbol_matcher,
+                        expand_symtabs_expansion_listener expansion_notify,
+                        block_search_flags search_flags,
+                        domain_search_flags domain,
+                        expand_symtabs_lang_matcher lang_matcher)
 {
   for (objfile *objfile : current_program_space->objfiles ())
     if (!objfile->expand_symtabs_matching (file_matcher,
@@ -3787,8 +3786,7 @@ expand_symtabs_matching
    See quick_symbol_functions.map_symbol_filenames for details.  */
 
 void
-map_symbol_filenames (gdb::function_view<symbol_filename_ftype> fun,
-                     bool need_fullname)
+map_symbol_filenames (symbol_filename_listener fun, bool need_fullname)
 {
   for (objfile *objfile : current_program_space->objfiles ())
     objfile->map_symbol_filenames (fun, need_fullname);
index 9a207c581ae7deaaa19111fae34feec99c896000..c2e5142c045dab72fad9d73abd259813f9caef1e 100644 (file)
@@ -26,7 +26,6 @@
 #include "symfile-add-flags.h"
 #include "objfile-flags.h"
 #include "gdb_bfd.h"
-#include "gdbsupport/function-view.h"
 #include "target-section.h"
 #include "quick-symbol.h"
 
@@ -347,17 +346,15 @@ symfile_segment_data_up get_symfile_segment_data (bfd *abfd);
 extern scoped_restore_tmpl<int> increment_reading_symtab (void);
 
 bool expand_symtabs_matching
-  (gdb::function_view<expand_symtabs_file_matcher_ftype> file_matcher,
+  (expand_symtabs_file_matcher file_matcher,
    const lookup_name_info &lookup_name,
-   gdb::function_view<expand_symtabs_symbol_matcher_ftype> symbol_matcher,
-   gdb::function_view<expand_symtabs_exp_notify_ftype> expansion_notify,
+   expand_symtabs_symbol_matcher symbol_matcher,
+   expand_symtabs_expansion_listener expansion_notify,
    block_search_flags search_flags,
    domain_search_flags kind,
-   gdb::function_view<expand_symtabs_lang_matcher_ftype> lang_matcher
-     = nullptr);
+   expand_symtabs_lang_matcher lang_matcher = nullptr);
 
-void map_symbol_filenames (gdb::function_view<symbol_filename_ftype> fun,
-                          bool need_fullname);
+void map_symbol_filenames (symbol_filename_listener fun, bool need_fullname);
 
 /* Target-agnostic function to load the sections of an executable into memory.
 
index e6f6a99679034042b6014f4d9858683b1dda0e67..b6c8456cc9d7f41d25a5cd71f3775ce85ba65a24 100644 (file)
@@ -4910,7 +4910,7 @@ global_symbol_searcher::expand_symtabs
     {
       return file_matches (filename, m_filenames, basenames);
     };
-  gdb::function_view<expand_symtabs_file_matcher_ftype> file_matcher = nullptr;
+  expand_symtabs_file_matcher file_matcher = nullptr;
   if (!m_filenames.empty ())
     file_matcher = do_file_match;