/* Block-related functions for the GNU debugger, GDB.
- Copyright (C) 2003-2019 Free Software Foundation, Inc.
+ Copyright (C) 2003-2020 Free Software Foundation, Inc.
This file is part of GDB.
if (BLOCK_FUNCTION (block) != NULL)
return symbol_arch (BLOCK_FUNCTION (block));
- return get_objfile_arch (block_objfile (block));
+ return block_objfile (block)->arch ();
}
/* See block.h. */
return block_iter_match_step (iterator, name, 0);
}
-/* Return true if symbol A is the best match possible for DOMAIN. */
+/* See block.h. */
-static bool
+bool
best_symbol (struct symbol *a, const domain_enum domain)
{
return (SYMBOL_DOMAIN (a) == domain
&& SYMBOL_CLASS (a) != LOC_UNRESOLVED);
}
-/* Return symbol B if it is a better match than symbol A for DOMAIN.
- Otherwise return A. */
+/* See block.h. */
-static struct symbol *
+struct symbol *
better_symbol (struct symbol *a, struct symbol *b, const domain_enum domain)
{
if (a == NULL)
STRUCT vs VAR domain symbols. So if a matching symbol is found,
make sure there is no "better" matching symbol, i.e., one with
exactly the same domain. PR 16253. */
- if (symbol_matches_domain (SYMBOL_LANGUAGE (sym),
+ if (symbol_matches_domain (sym->language (),
SYMBOL_DOMAIN (sym), domain))
other = better_symbol (other, sym, domain);
}
ALL_BLOCK_SYMBOLS_WITH_NAME (block, lookup_name, iter, sym)
{
- if (symbol_matches_domain (SYMBOL_LANGUAGE (sym),
+ if (symbol_matches_domain (sym->language (),
SYMBOL_DOMAIN (sym), domain))
{
sym_found = sym;
STRUCT vs VAR domain symbols. So if a matching symbol is found,
make sure there is no "better" matching symbol, i.e., one with
exactly the same domain. PR 16253. */
- if (symbol_matches_domain (SYMBOL_LANGUAGE (sym),
- SYMBOL_DOMAIN (sym), domain))
+ if (symbol_matches_domain (sym->language (), SYMBOL_DOMAIN (sym), domain))
other = better_symbol (other, sym, domain);
}
{
/* MATCHER is deliberately called second here so that it never sees
a non-domain-matching symbol. */
- if (symbol_matches_domain (SYMBOL_LANGUAGE (sym),
- SYMBOL_DOMAIN (sym), domain)
+ if (symbol_matches_domain (sym->language (), SYMBOL_DOMAIN (sym), domain)
&& matcher (sym, data))
return sym;
}