summaryrefslogtreecommitdiff
path: root/gdb/symtab.c
diff options
context:
space:
mode:
authorDoug Evans <dje@google.com>2013-03-05 21:15:33 +0000
committerDoug Evans <dje@google.com>2013-03-05 21:15:33 +0000
commitebf3262775ab5d785278cc5096c40bad16ac5dc5 (patch)
tree3edd67f14e98463a1227c6b8d5a379fb9e731b73 /gdb/symtab.c
parent8945e77196073b641208e991da067b3fcb63e5d7 (diff)
downloadgdb-ebf3262775ab5d785278cc5096c40bad16ac5dc5.tar.gz
* ada-lang.c (ada_lookup_symbol_list_worker): New function, contents
of old ada_lookup_symbol_list. In !full_search case, don't search superblocks. (ada_lookup_symbol_list): Delete arg full_search, all callers updated. Call ada_lookup_symbol_list_worker. (ada_iterate_over_symbols): Call ada_lookup_symbol_list_worker. * ada-lang.h (ada_lookup_symbol_list): Update. * language.h (language_defn): Update comment for la_iterate_over_symbols. * linespec.c (iterate_over_file_blocks): New function. (iterate_over_all_matching_symtabs): Call it. (lookup_prefix_sym): Ditto. (get_current_search_block): New function. (get_search_block): Delete. (find_label_symbols): Call get_current_search_block. (add_matching_symbols_to_info): Call iterate_over_file_blocks. * symtab.c (iterate_over_symbols): Don't search superblocks.
Diffstat (limited to 'gdb/symtab.c')
-rw-r--r--gdb/symtab.c32
1 files changed, 12 insertions, 20 deletions
diff --git a/gdb/symtab.c b/gdb/symtab.c
index 57441c1ce5b..de2dbeee1cf 100644
--- a/gdb/symtab.c
+++ b/gdb/symtab.c
@@ -2023,16 +2023,13 @@ lookup_block_symbol (const struct block *block, const char *name,
}
}
-/* Iterate over the symbols named NAME, matching DOMAIN, starting with
- BLOCK.
+/* Iterate over the symbols named NAME, matching DOMAIN, in BLOCK.
For each symbol that matches, CALLBACK is called. The symbol and
DATA are passed to the callback.
If CALLBACK returns zero, the iteration ends. Otherwise, the
- search continues. This function iterates upward through blocks.
- When the outermost block has been finished, the function
- returns. */
+ search continues. */
void
iterate_over_symbols (const struct block *block, const char *name,
@@ -2040,24 +2037,19 @@ iterate_over_symbols (const struct block *block, const char *name,
symbol_found_callback_ftype *callback,
void *data)
{
- while (block)
- {
- struct block_iterator iter;
- struct symbol *sym;
+ struct block_iterator iter;
+ struct symbol *sym;
- for (sym = block_iter_name_first (block, name, &iter);
- sym != NULL;
- sym = block_iter_name_next (name, &iter))
+ for (sym = block_iter_name_first (block, name, &iter);
+ sym != NULL;
+ sym = block_iter_name_next (name, &iter))
+ {
+ if (symbol_matches_domain (SYMBOL_LANGUAGE (sym),
+ SYMBOL_DOMAIN (sym), domain))
{
- if (symbol_matches_domain (SYMBOL_LANGUAGE (sym),
- SYMBOL_DOMAIN (sym), domain))
- {
- if (!callback (sym, data))
- return;
- }
+ if (!callback (sym, data))
+ return;
}
-
- block = BLOCK_SUPERBLOCK (block);
}
}