aboutsummaryrefslogtreecommitdiff
path: root/gdb/symtab.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@adacore.com>2019-07-12 10:47:21 -0600
committerTom Tromey <tromey@adacore.com>2019-09-10 08:30:45 -0600
commit6969f124b987494df069b032e2e0f36485d3d8bb (patch)
treed0b2cbfb2b96651860e7336f4c6042c178676dc6 /gdb/symtab.c
parent199b4314efbd419d6957e366e13a14cd87cea5e4 (diff)
downloadgdb-6969f124b987494df069b032e2e0f36485d3d8bb.zip
gdb-6969f124b987494df069b032e2e0f36485d3d8bb.tar.gz
gdb-6969f124b987494df069b032e2e0f36485d3d8bb.tar.bz2
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.
Diffstat (limited to 'gdb/symtab.c')
-rw-r--r--gdb/symtab.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/gdb/symtab.c b/gdb/symtab.c
index 88e34de..5f18445 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.