diff options
author | Doug Evans <dje@google.com> | 2015-05-27 11:50:38 -0700 |
---|---|---|
committer | Doug Evans <dje@google.com> | 2015-05-27 11:50:38 -0700 |
commit | b2e2f908b863c27abb00108a03ebe2598baec55c (patch) | |
tree | 2d80ad0c354497e91d57aafadaf2d438cb0eb352 /gdb/psymtab.c | |
parent | f62fce356bf1df27e01fc40a3a277fc924019ee7 (diff) | |
download | gdb-b2e2f908b863c27abb00108a03ebe2598baec55c.zip gdb-b2e2f908b863c27abb00108a03ebe2598baec55c.tar.gz gdb-b2e2f908b863c27abb00108a03ebe2598baec55c.tar.bz2 |
PR symtab/18258
gdb/ChangeLog:
* block.c (block_find_symbol): New function.
(block_find_non_opaque_type): Ditto.
(block_find_non_opaque_type_preferred): Ditto.
* block.h (block_symbol_matcher_ftype): New typedef.
(block_find_symbol): Declare.
(block_find_non_opaque_type): Ditto.
(block_find_non_opaque_type_preferred): Ditto.
* dwarf2read.c (dw2_lookup_symbol): Call block_find_symbol.
* psymtab.c (psym_lookup_symbol): Ditto.
* symtab.c (basic_lookup_transparent_type_1): New function.
(basic_lookup_transparent_type): Call it.
gdb/testsuite/ChangeLog:
* gdb.dwarf2/opaque-type-lookup-2.c: New file.
* gdb.dwarf2/opaque-type-lookup.c: New file.
* gdb.dwarf2/opaque-type-lookup.exp: New file.
Diffstat (limited to 'gdb/psymtab.c')
-rw-r--r-- | gdb/psymtab.c | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/gdb/psymtab.c b/gdb/psymtab.c index 383e4c4..9ee6ed1 100644 --- a/gdb/psymtab.c +++ b/gdb/psymtab.c @@ -516,7 +516,7 @@ psym_lookup_symbol (struct objfile *objfile, if (!ps->readin && lookup_partial_symbol (objfile, ps, name, psymtab_index, domain)) { - struct symbol *sym = NULL; + struct symbol *sym, *with_opaque = NULL; struct compunit_symtab *stab = psymtab_to_symtab (objfile, ps); /* Note: While psymtab_to_symtab can return NULL if the partial symtab is empty, we can assume it won't here because lookup_partial_symbol @@ -524,18 +524,20 @@ psym_lookup_symbol (struct objfile *objfile, const struct blockvector *bv = COMPUNIT_BLOCKVECTOR (stab); struct block *block = BLOCKVECTOR_BLOCK (bv, block_index); + sym = block_find_symbol (block, name, domain, + block_find_non_opaque_type_preferred, + &with_opaque); + /* Some caution must be observed with overloaded functions - and methods, since the psymtab will not contain any overload + and methods, since the index will not contain any overload information (but NAME might contain it). */ - sym = block_lookup_symbol (block, name, domain); - - if (sym && strcmp_iw (SYMBOL_SEARCH_NAME (sym), name) == 0) - { - if (!TYPE_IS_OPAQUE (SYMBOL_TYPE (sym))) - return stab; - stab_best = stab; - } + if (sym != NULL + && strcmp_iw (SYMBOL_SEARCH_NAME (sym), name) == 0) + return stab; + if (with_opaque != NULL + && strcmp_iw (SYMBOL_SEARCH_NAME (with_opaque), name) == 0) + stab_best = stab; /* Keep looking through other psymtabs. */ } |