public inbox for gdb-testers@sourceware.org
help / color / mirror / Atom feed
* [binutils-gdb] Change iterate_over_symbols to return bool
@ 2019-09-10 15:39 gdb-buildbot
  2019-09-10 15:39 ` Failures on RHEL-s390x-m64, branch master gdb-buildbot
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: gdb-buildbot @ 2019-09-10 15:39 UTC (permalink / raw)
  To: gdb-testers

*** TEST RESULTS FOR COMMIT 6969f124b987494df069b032e2e0f36485d3d8bb ***

commit 6969f124b987494df069b032e2e0f36485d3d8bb
Author:     Tom Tromey <tromey@adacore.com>
AuthorDate: Fri Jul 12 10:47:21 2019 -0600
Commit:     Tom Tromey <tromey@adacore.com>
CommitDate: Tue Sep 10 08:30:45 2019 -0600

    Change iterate_over_symbols to return bool
    
    This changes iterate_over_symbols to return a bool.  This allows it to
    be reused in another context in a subsequent patch.
    
    gdb/ChangeLog
    2019-09-10  Tom Tromey  <tromey@adacore.com>
    
            * ada-lang.c (ada_iterate_over_symbols): Return bool.
            * language.h (struct language_defn) <la_iterate_over_symbols>:
            Return bool.
            * symtab.c (iterate_over_symbols): Return bool.
            * symtab.h (iterate_over_symbols): Return bool.

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 1865eeddbb..e2ebafe714 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,11 @@
+2019-09-10  Tom Tromey  <tromey@adacore.com>
+
+	* ada-lang.c (ada_iterate_over_symbols): Return bool.
+	* language.h (struct language_defn) <la_iterate_over_symbols>:
+	Return bool.
+	* symtab.c (iterate_over_symbols): Return bool.
+	* symtab.h (iterate_over_symbols): Return bool.
+
 2019-09-10  Tom Tromey  <tromey@adacore.com>
 
 	* ada-lang.c (aux_add_nonlocal_symbols): Change type.
diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c
index d677acdb60..21d40c7aad 100644
--- a/gdb/ada-lang.c
+++ b/gdb/ada-lang.c
@@ -5740,7 +5740,7 @@ ada_lookup_symbol_list (const char *name, const struct block *block,
 
 /* Implementation of the la_iterate_over_symbols method.  */
 
-static void
+static bool
 ada_iterate_over_symbols
   (const struct block *block, const lookup_name_info &name,
    domain_enum domain,
@@ -5754,8 +5754,10 @@ ada_iterate_over_symbols
   for (i = 0; i < ndefs; ++i)
     {
       if (!callback (&results[i]))
-	break;
+	return false;
     }
+
+  return true;
 }
 
 /* The result is as for ada_lookup_symbol_list with FULL_SEARCH set
diff --git a/gdb/language.h b/gdb/language.h
index 2a100b0491..0088e5de2d 100644
--- a/gdb/language.h
+++ b/gdb/language.h
@@ -407,7 +407,7 @@ struct language_defn
        This field may not be NULL.  If the language does not need any
        special processing here, 'iterate_over_symbols' should be
        used as the definition.  */
-    void (*la_iterate_over_symbols)
+    bool (*la_iterate_over_symbols)
       (const struct block *block, const lookup_name_info &name,
        domain_enum domain,
        gdb::function_view<symbol_found_callback_ftype> callback);
diff --git a/gdb/symtab.c b/gdb/symtab.c
index 88e34de05b..5f184454bd 100644
--- a/gdb/symtab.c
+++ b/gdb/symtab.c
@@ -2822,15 +2822,9 @@ basic_lookup_transparent_type (const char *name)
   return (struct type *) 0;
 }
 
-/* Iterate over the symbols named NAME, matching DOMAIN, in BLOCK.
-
-   For each symbol that matches, CALLBACK is called.  The symbol is
-   passed to the callback.
-
-   If CALLBACK returns false, the iteration ends.  Otherwise, the
-   search continues.  */
+/* See symtab.h.  */
 
-void
+bool
 iterate_over_symbols (const struct block *block,
 		      const lookup_name_info &name,
 		      const domain_enum domain,
@@ -2847,9 +2841,10 @@ iterate_over_symbols (const struct block *block,
 	  struct block_symbol block_sym = {sym, block};
 
 	  if (!callback (&block_sym))
-	    return;
+	    return false;
 	}
     }
+  return true;
 }
 
 /* Find the compunit symtab associated with PC and SECTION.
diff --git a/gdb/symtab.h b/gdb/symtab.h
index f38e544cdb..49feea62e2 100644
--- a/gdb/symtab.h
+++ b/gdb/symtab.h
@@ -2092,7 +2092,16 @@ std::vector<CORE_ADDR> find_pcs_for_symtab_line
 
 typedef bool (symbol_found_callback_ftype) (struct block_symbol *bsym);
 
-void iterate_over_symbols (const struct block *block,
+/* Iterate over the symbols named NAME, matching DOMAIN, in BLOCK.
+
+   For each symbol that matches, CALLBACK is called.  The symbol is
+   passed to the callback.
+
+   If CALLBACK returns false, the iteration ends and this function
+   returns false.  Otherwise, the search continues, and the function
+   eventually returns true.  */
+
+bool iterate_over_symbols (const struct block *block,
 			   const lookup_name_info &name,
 			   const domain_enum domain,
 			   gdb::function_view<symbol_found_callback_ftype> callback);


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2019-09-10 18:23 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-10 15:39 [binutils-gdb] Change iterate_over_symbols to return bool gdb-buildbot
2019-09-10 15:39 ` Failures on RHEL-s390x-m64, branch master gdb-buildbot
2019-09-10 16:05 ` Failures on Ubuntu-Aarch64-m64, " gdb-buildbot
2019-09-10 16:18 ` Failures on Ubuntu-Aarch64-native-extended-gdbserver-m64, " gdb-buildbot
2019-09-10 17:09 ` Failures on Debian-s390x-m64, " gdb-buildbot
2019-09-10 17:48 ` Failures on Debian-s390x-native-extended-gdbserver-m64, " gdb-buildbot
2019-09-10 18:11 ` Failures on Fedora-i686, " gdb-buildbot
2019-09-10 18:19 ` Failures on Fedora-x86_64-cc-with-index, " gdb-buildbot
2019-09-10 18:23 ` Failures on Debian-s390x-native-gdbserver-m64, " gdb-buildbot
2019-09-10 18:30 ` Failures on Fedora-x86_64-m32, " gdb-buildbot
2019-09-10 18:53 ` Failures on Fedora-x86_64-native-gdbserver-m32, " gdb-buildbot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).