domain_enum);
static struct symbol *lookup_symbol_aux (const char *name,
- const char *mangled_name,
+ const char *linkage_name,
const struct block *block,
const domain_enum domain,
int *is_a_field_of_this,
static
struct symbol *lookup_symbol_aux_local (const char *name,
- const char *mangled_name,
+ const char *linkage_name,
const struct block *block,
const domain_enum domain,
struct symtab **symtab,
static
struct symbol *lookup_symbol_aux_block (const char *name,
- const char *mangled_name,
+ const char *linkage_name,
const struct block *block,
const domain_enum domain,
struct symtab **symtab);
static
struct symbol *lookup_symbol_aux_symtabs (int block_index,
const char *name,
- const char *mangled_name,
+ const char *linkage_name,
const domain_enum domain,
struct symtab **symtab);
static
struct symbol *lookup_symbol_aux_psymtabs (int block_index,
const char *name,
- const char *mangled_name,
+ const char *linkage_name,
const domain_enum domain,
struct symtab **symtab);
#if 0
static
struct symbol *lookup_symbol_aux_minsyms (const char *name,
- const char *mangled_name,
+ const char *linkage_name,
const domain_enum domain,
int *is_a_field_of_this,
struct symtab **symtab);
return returnval;
}
+/* Behave like lookup_symbol_aux except that NAME is the natural name
+ of the symbol that we're looking for and, if LINKAGE_NAME is
+ non-NULL, ensure that the symbol's linkage name matches as
+ well. */
+
static struct symbol *
-lookup_symbol_aux (const char *name, const char *mangled_name,
+lookup_symbol_aux (const char *name, const char *linkage_name,
const struct block *block, const domain_enum domain,
int *is_a_field_of_this, struct symtab **symtab)
{
/* Search specified block and its superiors. Don't search
STATIC_BLOCK or GLOBAL_BLOCK. */
- sym = lookup_symbol_aux_local (name, mangled_name, block, domain,
+ sym = lookup_symbol_aux_local (name, linkage_name, block, domain,
symtab, &static_block);
if (sym != NULL)
return sym;
if (BLOCK_START (b) <= BLOCK_START (block)
&& BLOCK_END (b) > BLOCK_START (block))
{
- sym = lookup_block_symbol (b, name, mangled_name, VAR_DOMAIN);
+ sym = lookup_block_symbol (b, name, linkage_name, VAR_DOMAIN);
if (sym)
{
block_found = b;
if (static_block != NULL)
{
- sym = lookup_symbol_aux_block (name, mangled_name, static_block,
+ sym = lookup_symbol_aux_block (name, linkage_name, static_block,
domain, symtab);
if (sym != NULL)
return sym;
of the desired name as a global, then do psymtab-to-symtab
conversion on the fly and return the found symbol. */
- sym = lookup_symbol_aux_symtabs (GLOBAL_BLOCK, name, mangled_name,
+ sym = lookup_symbol_aux_symtabs (GLOBAL_BLOCK, name, linkage_name,
domain, symtab);
if (sym != NULL)
return sym;
- sym = lookup_symbol_aux_psymtabs (GLOBAL_BLOCK, name, mangled_name,
+ sym = lookup_symbol_aux_psymtabs (GLOBAL_BLOCK, name, linkage_name,
domain, symtab);
if (sym != NULL)
return sym;
desired name as a file-level static, then do psymtab-to-symtab
conversion on the fly and return the found symbol. */
- sym = lookup_symbol_aux_symtabs (STATIC_BLOCK, name, mangled_name,
+ sym = lookup_symbol_aux_symtabs (STATIC_BLOCK, name, linkage_name,
domain, symtab);
if (sym != NULL)
return sym;
- sym = lookup_symbol_aux_psymtabs (STATIC_BLOCK, name, mangled_name,
+ sym = lookup_symbol_aux_psymtabs (STATIC_BLOCK, name, linkage_name,
domain, symtab);
if (sym != NULL)
return sym;
match, store the address of STATIC_BLOCK in static_block. */
static struct symbol *
-lookup_symbol_aux_local (const char *name, const char *mangled_name,
+lookup_symbol_aux_local (const char *name, const char *linkage_name,
const struct block *block,
const domain_enum domain,
struct symtab **symtab,
while (BLOCK_SUPERBLOCK (BLOCK_SUPERBLOCK (block)) != NULL)
{
- sym = lookup_symbol_aux_block (name, mangled_name, block, domain,
+ sym = lookup_symbol_aux_block (name, linkage_name, block, domain,
symtab);
if (sym != NULL)
return sym;
symbol, and set block_found appropriately. */
static struct symbol *
-lookup_symbol_aux_block (const char *name, const char *mangled_name,
+lookup_symbol_aux_block (const char *name, const char *linkage_name,
const struct block *block,
const domain_enum domain,
struct symtab **symtab)
struct block *b;
struct symtab *s = NULL;
- sym = lookup_block_symbol (block, name, mangled_name, domain);
+ sym = lookup_block_symbol (block, name, linkage_name, domain);
if (sym)
{
block_found = block;
static struct symbol *
lookup_symbol_aux_symtabs (int block_index,
- const char *name, const char *mangled_name,
+ const char *name, const char *linkage_name,
const domain_enum domain,
struct symtab **symtab)
{
{
bv = BLOCKVECTOR (s);
block = BLOCKVECTOR_BLOCK (bv, block_index);
- sym = lookup_block_symbol (block, name, mangled_name, domain);
+ sym = lookup_block_symbol (block, name, linkage_name, domain);
if (sym)
{
block_found = block;
static struct symbol *
lookup_symbol_aux_psymtabs (int block_index, const char *name,
- const char *mangled_name,
+ const char *linkage_name,
const domain_enum domain,
struct symtab **symtab)
{
ALL_PSYMTABS (objfile, ps)
{
if (!ps->readin
- && lookup_partial_symbol (ps, name, mangled_name,
+ && lookup_partial_symbol (ps, name, linkage_name,
psymtab_index, domain))
{
s = PSYMTAB_TO_SYMTAB (ps);
bv = BLOCKVECTOR (s);
block = BLOCKVECTOR_BLOCK (bv, block_index);
- sym = lookup_block_symbol (block, name, mangled_name, domain);
+ sym = lookup_block_symbol (block, name, linkage_name, domain);
if (!sym)
{
/* This shouldn't be necessary, but as a last resort try
block = BLOCKVECTOR_BLOCK (bv,
block_index == GLOBAL_BLOCK ?
STATIC_BLOCK : GLOBAL_BLOCK);
- sym = lookup_block_symbol (block, name, mangled_name, domain);
+ sym = lookup_block_symbol (block, name, linkage_name, domain);
if (!sym)
error ("Internal: %s symbol `%s' found in %s psymtab but not in symtab.\n%s may be an inlined function, or may be a template function\n(if a template, try specifying an instantiation: %s<type>).",
block_index == GLOBAL_BLOCK ? "global" : "static",
static struct symbol *
lookup_symbol_aux_minsyms (const char *name,
- const char *mangled_name,
+ const char *linkage_name,
const domain_enum domain,
int *is_a_field_of_this,
struct symtab **symtab)
to be clearly the wrong thing to pass as the
unmangled name. */
sym =
- lookup_block_symbol (block, name, mangled_name, domain);
+ lookup_block_symbol (block, name, linkage_name, domain);
/* We kept static functions in minimal symbol table as well as
in static scope. We want to find them in the symbol table. */
if (!sym)
{
block = BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK);
sym = lookup_block_symbol (block, name,
- mangled_name, domain);
+ linkage_name, domain);
}
/* NOTE: carlton/2002-12-04: The following comment was
symbol (language_cplus or language_objc set) has both the encoded and
non-encoded names tested for a match.
- If MANGLED_NAME is non-NULL, verify that any symbol we find has this
+ If LINKAGE_NAME is non-NULL, verify that any symbol we find has this
particular mangled name.
*/
struct symbol *
lookup_block_symbol (register const struct block *block, const char *name,
- const char *mangled_name,
+ const char *linkage_name,
const domain_enum domain)
{
register int bot, top, inc;
for (sym = BLOCK_BUCKET (block, hash_index); sym; sym = sym->hash_next)
{
if (SYMBOL_DOMAIN (sym) == domain
- && (mangled_name
- ? strcmp (DEPRECATED_SYMBOL_NAME (sym), mangled_name) == 0
+ && (linkage_name
+ ? strcmp (DEPRECATED_SYMBOL_NAME (sym), linkage_name) == 0
: SYMBOL_MATCHES_NATURAL_NAME (sym, name)))
return sym;
}
{
sym = BLOCK_SYM (block, bot);
if (SYMBOL_DOMAIN (sym) == domain
- && (mangled_name
- ? strcmp (DEPRECATED_SYMBOL_NAME (sym), mangled_name) == 0
+ && (linkage_name
+ ? strcmp (DEPRECATED_SYMBOL_NAME (sym), linkage_name) == 0
: SYMBOL_MATCHES_NATURAL_NAME (sym, name)))
{
return sym;
{
sym = BLOCK_SYM (block, bot);
if (SYMBOL_DOMAIN (sym) == domain
- && (mangled_name
- ? strcmp (DEPRECATED_SYMBOL_NAME (sym), mangled_name) == 0
+ && (linkage_name
+ ? strcmp (DEPRECATED_SYMBOL_NAME (sym), linkage_name) == 0
: SYMBOL_MATCHES_NATURAL_NAME (sym, name)))
{
/* If SYM has aliases, then use any alias that is active