[binutils-gdb] gdb: make symbol_found_callback_ftype a function_view

Simon Marchi via Gdb-cvs <[email protected]>
Newsgroups gmane.comp.gdb.cvs
Message-ID <[email protected]>
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=e80c346010c6631fab30055a22d344effc620483

commit e80c346010c6631fab30055a22d344effc620483
Author: Simon Marchi <[email protected]>
Date:   Thu Apr 16 16:16:20 2026 -0400

    gdb: make symbol_found_callback_ftype a function_view
    
    All uses of symbol_found_callback_ftype use it within a function_view,
    so factor out the function_view into the type alias.
    
    Change-Id: I24a1d2fc233aa5d593c9c68581a9912bfee3a348
    Approved-By: Andrew Burgess <[email protected]>

Diff:
---
 gdb/ada-lang.c | 2 +-
 gdb/language.h | 2 +-
 gdb/linespec.c | 6 +++---
 gdb/symtab.c   | 2 +-
 gdb/symtab.h   | 4 ++--
 5 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c
index f8ed4cc5e10..d388a301fa1 100644
--- a/gdb/ada-lang.c
+++ b/gdb/ada-lang.c
@@ -13705,7 +13705,7 @@ public:
   bool iterate_over_symbols
 	(const struct block *block, const lookup_name_info &name,
 	 domain_search_flags domain,
-	 gdb::function_view<symbol_found_callback_ftype> callback) const override
+	 symbol_found_callback_ftype callback) const override
   {
     std::vector<struct block_symbol> results
       = ada_lookup_symbol_list_worker (name, block, domain, 0);
diff --git a/gdb/language.h b/gdb/language.h
index da903eb702d..0cc075f8a29 100644
--- a/gdb/language.h
+++ b/gdb/language.h
@@ -362,7 +362,7 @@ struct language_defn
   virtual bool iterate_over_symbols
 	(const struct block *block, const lookup_name_info &name,
 	 domain_search_flags domain,
-	 gdb::function_view<symbol_found_callback_ftype> callback) const
+	 symbol_found_callback_ftype callback) const
   {
     return ::iterate_over_symbols (block, name, domain, callback);
   }
diff --git a/gdb/linespec.c b/gdb/linespec.c
index 0afe0c619a1..bfdd075ac82 100644
--- a/gdb/linespec.c
+++ b/gdb/linespec.c
@@ -363,7 +363,7 @@ struct linespec_parser
 static void iterate_over_file_blocks
   (struct symtab *symtab, const lookup_name_info &name,
    domain_search_flags domain,
-   gdb::function_view<symbol_found_callback_ftype> callback);
+   symbol_found_callback_ftype callback);
 
 static void initialize_defaults (struct symtab **default_symtab,
 				 int *default_line);
@@ -1128,7 +1128,7 @@ iterate_over_all_matching_symtabs
    const lookup_name_info &lookup_name,
    const domain_search_flags domain,
    struct program_space *search_pspace, bool include_inline,
-   gdb::function_view<symbol_found_callback_ftype> callback)
+   symbol_found_callback_ftype callback)
 {
   for (struct program_space *pspace : program_spaces)
     {
@@ -1196,7 +1196,7 @@ static void
 iterate_over_file_blocks
   (struct symtab *symtab, const lookup_name_info &name,
    domain_search_flags domain,
-   gdb::function_view<symbol_found_callback_ftype> callback)
+   symbol_found_callback_ftype callback)
 {
   const struct block *block;
 
diff --git a/gdb/symtab.c b/gdb/symtab.c
index 78aa3c8c1f5..6fba0cd838a 100644
--- a/gdb/symtab.c
+++ b/gdb/symtab.c
@@ -2701,7 +2701,7 @@ bool
 iterate_over_symbols (const struct block *block,
 		      const lookup_name_info &name,
 		      const domain_search_flags domain,
-		      gdb::function_view<symbol_found_callback_ftype> callback)
+		      symbol_found_callback_ftype callback)
 {
   for (struct symbol *sym : block_iterator_range (block, &name))
     {
diff --git a/gdb/symtab.h b/gdb/symtab.h
index 34c19bde62f..b8e8caf8d5f 100644
--- a/gdb/symtab.h
+++ b/gdb/symtab.h
@@ -2813,7 +2813,7 @@ std::vector<const linetable_entry *> find_linetable_entries_for_symtab_line
    true to indicate that LA_ITERATE_OVER_SYMBOLS should continue
    iterating, or false to indicate that the iteration should end.  */
 
-typedef bool (symbol_found_callback_ftype) (struct block_symbol *bsym);
+using symbol_found_callback_ftype = gdb::function_view<bool (block_symbol *)>;
 
 /* Iterate over the symbols named NAME, matching DOMAIN, in BLOCK.
 
@@ -2827,7 +2827,7 @@ typedef bool (symbol_found_callback_ftype) (struct block_symbol *bsym);
 bool iterate_over_symbols (const struct block *block,
 			   const lookup_name_info &name,
 			   const domain_search_flags domain,
-			   gdb::function_view<symbol_found_callback_ftype> callback);
+			   symbol_found_callback_ftype callback);
 
 /* Storage type used by demangle_for_lookup.  demangle_for_lookup
    either returns a const char * pointer that points to either of the
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.