+ return other;
+}
+
+/* See block.h. */
+
+struct symbol *
+block_find_symbol (const struct block *block, const char *name,
+ const domain_enum domain,
+ block_symbol_matcher_ftype *matcher, void *data)
+{
+ struct block_iterator iter;
+ struct symbol *sym;
+
+ lookup_name_info lookup_name (name, symbol_name_match_type::FULL);
+
+ /* Verify BLOCK is STATIC_BLOCK or GLOBAL_BLOCK. */
+ gdb_assert (BLOCK_SUPERBLOCK (block) == NULL
+ || BLOCK_SUPERBLOCK (BLOCK_SUPERBLOCK (block)) == NULL);
+
+ ALL_BLOCK_SYMBOLS_WITH_NAME (block, lookup_name, iter, sym)
+ {
+ /* MATCHER is deliberately called second here so that it never sees
+ a non-domain-matching symbol. */
+ if (symbol_matches_domain (sym->language (), SYMBOL_DOMAIN (sym), domain)
+ && matcher (sym, data))
+ return sym;
+ }