demangled symbol lookup fixes
This commit is contained in:
parent
d332c5ac7e
commit
0729fd5008
3 changed files with 139 additions and 112 deletions
|
@ -1,3 +1,13 @@
|
|||
2000-03-29 Daniel Berlin <dan@cgsoftware.com>
|
||||
|
||||
* minsyms.c (add_minsym_to_demangled_hash_table): New function.
|
||||
(install_minimal_symbols): Fix demangled symbol problems caused by
|
||||
using add_minsym_to_hash_table for the demangled names, which is
|
||||
wrong. Now we use add_minsym_to_demangled_hash_table.
|
||||
(lookup_minimal_symbol): Fix problems with demangled symbol lookup
|
||||
caused by weird control flow.
|
||||
* symtab.h: Add add_minsym_to_demangled_hash_table prototype here.
|
||||
|
||||
2000-03-29 Jason Merrill <jason@casey.cygnus.com>
|
||||
|
||||
* configure.in: -linux-gnu*, not -linux-gnu.
|
||||
|
|
|
@ -123,6 +123,20 @@ add_minsym_to_hash_table (struct minimal_symbol *sym,
|
|||
}
|
||||
}
|
||||
|
||||
/* Add the minimal symbol SYM to an objfile's minsym demangled hash table,
|
||||
TABLE. */
|
||||
static void
|
||||
add_minsym_to_demangled_hash_table (struct minimal_symbol *sym,
|
||||
struct minimal_symbol **table)
|
||||
{
|
||||
if (sym->demangled_hash_next == NULL)
|
||||
{
|
||||
unsigned int hash = msymbol_hash_iw (SYMBOL_DEMANGLED_NAME (sym));
|
||||
sym->demangled_hash_next = table[hash];
|
||||
table[hash] = sym;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Look through all the current minimal symbol tables and find the
|
||||
first minimal symbol that matches NAME. If OBJF is non-NULL, limit
|
||||
|
@ -167,9 +181,15 @@ lookup_minimal_symbol (name, sfile, objf)
|
|||
{
|
||||
/* Do two passes: the first over the ordinary hash table,
|
||||
and the second over the demangled hash table. */
|
||||
int pass = 1;
|
||||
int pass;
|
||||
|
||||
for (pass = 1; pass <= 2 && found_symbol == NULL; pass++)
|
||||
{
|
||||
/* Select hash list according to pass. */
|
||||
if (pass == 1)
|
||||
msymbol = objfile->msymbol_hash[hash];
|
||||
else
|
||||
msymbol = objfile->msymbol_demangled_hash[dem_hash];
|
||||
|
||||
while (msymbol != NULL && found_symbol == NULL)
|
||||
{
|
||||
|
@ -210,17 +230,11 @@ lookup_minimal_symbol (name, sfile, objf)
|
|||
}
|
||||
}
|
||||
|
||||
/* Find the next symbol on the hash chain. At the end
|
||||
of the first pass, try the demangled hash list. */
|
||||
/* Find the next symbol on the hash chain. */
|
||||
if (pass == 1)
|
||||
msymbol = msymbol->hash_next;
|
||||
else
|
||||
msymbol = msymbol->demangled_hash_next;
|
||||
if (msymbol == NULL)
|
||||
{
|
||||
++pass;
|
||||
if (pass == 2)
|
||||
msymbol = objfile->msymbol_demangled_hash[dem_hash];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -934,7 +948,7 @@ install_minimal_symbols (objfile)
|
|||
{
|
||||
SYMBOL_INIT_DEMANGLED_NAME (msymbols, &objfile->symbol_obstack);
|
||||
if (SYMBOL_DEMANGLED_NAME (msymbols) != NULL)
|
||||
add_minsym_to_hash_table (msymbols,
|
||||
add_minsym_to_demangled_hash_table (msymbols,
|
||||
objfile->msymbol_demangled_hash);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1240,6 +1240,9 @@ extern unsigned int msymbol_hash PARAMS ((const char *));
|
|||
extern void
|
||||
add_minsym_to_hash_table (struct minimal_symbol *sym,
|
||||
struct minimal_symbol **table);
|
||||
extern void
|
||||
add_minsym_to_demangled_hash_table (struct minimal_symbol *sym,
|
||||
struct minimal_symbol **table);
|
||||
|
||||
extern struct minimal_symbol *
|
||||
lookup_minimal_symbol PARAMS ((const char *, const char *, struct objfile *));
|
||||
|
|
Loading…
Reference in a new issue