gdb: move "gdb:function_view" into quick-symbol.h typedefs

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>
diff --git a/gdb/dwarf2/cooked-index.h b/gdb/dwarf2/cooked-index.h
index 925f73b..d642c13 100644
--- a/gdb/dwarf2/cooked-index.h
+++ b/gdb/dwarf2/cooked-index.h
@@ -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
diff --git a/gdb/dwarf2/read-gdb-index.c b/gdb/dwarf2/read-gdb-index.c
index 103fc73..6aba850 100644
--- a/gdb/dwarf2/read-gdb-index.c
+++ b/gdb/dwarf2/read-gdb-index.c
@@ -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);
 
diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c
index ecc2c53..3d4ae49 100644
--- a/gdb/dwarf2/read.c
+++ b/gdb/dwarf2/read.c
@@ -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);
 
diff --git a/gdb/dwarf2/read.h b/gdb/dwarf2/read.h
index a7313a6..24decd7 100644
--- a/gdb/dwarf2/read.h
+++ b/gdb/dwarf2/read.h
@@ -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.  */
 
diff --git a/gdb/objfiles.h b/gdb/objfiles.h
index 4ac56d7..05e1e01 100644
--- a/gdb/objfiles.h
+++ b/gdb/objfiles.h
@@ -593,14 +593,13 @@ struct objfile : intrusive_list_node<objfile>
 
   /* 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 @@ struct objfile : intrusive_list_node<objfile>
 				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 ();
diff --git a/gdb/psymtab.c b/gdb/psymtab.c
index ef7fa23..28455ba 100644
--- a/gdb/psymtab.c
+++ b/gdb/psymtab.c
@@ -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))
diff --git a/gdb/psymtab.h b/gdb/psymtab.h
index 411c95e..129f66e 100644
--- a/gdb/psymtab.h
+++ b/gdb/psymtab.h
@@ -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.  */
diff --git a/gdb/quick-symbol.h b/gdb/quick-symbol.h
index 9dbaf49..32090db 100644
--- a/gdb/quick-symbol.h
+++ b/gdb/quick-symbol.h
@@ -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
diff --git a/gdb/symfile-debug.c b/gdb/symfile-debug.c
index 5c41478..dda3efe 100644
--- a/gdb/symfile-debug.c
+++ b/gdb/symfile-debug.c
@@ -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,
diff --git a/gdb/symfile.c b/gdb/symfile.c
index 4d5f3d2..b0c178a 100644
--- a/gdb/symfile.c
+++ b/gdb/symfile.c
@@ -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);
diff --git a/gdb/symfile.h b/gdb/symfile.h
index 9a207c5..c2e5142 100644
--- a/gdb/symfile.h
+++ b/gdb/symfile.h
@@ -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.
 
diff --git a/gdb/symtab.c b/gdb/symtab.c
index e6f6a99..b6c8456 100644
--- a/gdb/symtab.c
+++ b/gdb/symtab.c
@@ -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;