diff --git a/gdb/ChangeLog b/gdb/ChangeLog index b543904db2..c1945cb5e2 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,9 @@ +2017-11-01 Weimin Pan + + * minsyms.c (lookup_minimal_symbol_and_objfile): Use + lookup_minimal_symbol() to find symbol entry. + * minsyms.h (lookup_minimal_symbol_and_objfile): Update comment. + 2018-03-23 Keith Seitz PR c++/22968 diff --git a/gdb/minsyms.c b/gdb/minsyms.c index a55c0718fc..72969b7778 100644 --- a/gdb/minsyms.c +++ b/gdb/minsyms.c @@ -1009,23 +1009,12 @@ lookup_minimal_symbol_and_objfile (const char *name) { struct bound_minimal_symbol result; struct objfile *objfile; - unsigned int hash = msymbol_hash (name) % MINIMAL_SYMBOL_HASH_SIZE; ALL_OBJFILES (objfile) { - struct minimal_symbol *msym; - - for (msym = objfile->per_bfd->msymbol_hash[hash]; - msym != NULL; - msym = msym->hash_next) - { - if (strcmp (MSYMBOL_LINKAGE_NAME (msym), name) == 0) - { - result.minsym = msym; - result.objfile = objfile; - return result; - } - } + result = lookup_minimal_symbol (name, NULL, objfile); + if (result.minsym != NULL) + return result; } memset (&result, 0, sizeof (result)); diff --git a/gdb/minsyms.h b/gdb/minsyms.h index 78b32e8d1c..11a202025d 100644 --- a/gdb/minsyms.h +++ b/gdb/minsyms.h @@ -203,7 +203,7 @@ struct bound_minimal_symbol lookup_minimal_symbol (const char *, struct bound_minimal_symbol lookup_bound_minimal_symbol (const char *); /* Find the minimal symbol named NAME, and return both the minsym - struct and its objfile. This only checks the linkage name. */ + struct and its objfile. */ struct bound_minimal_symbol lookup_minimal_symbol_and_objfile (const char *);