gdb/
* cp-namespace.c (cp_lookup_nested_type): New variable concatenated_name. Turn the current return condition into a reverse one. Call also lookup_static_symbol_aux on the constructed qualified name. * symtab.c (lookup_symbol_aux): Move variable objfile and searching in other files into a called ... (lookup_static_symbol_aux): ... new function here. * symtab.h (lookup_static_symbol_aux): New prototype. * valops.c (value_maybe_namespace_elt): Call also lookup_static_symbol_aux if we failed otherwise. gdb/testsuite/ * gdb.cp/namespace.exp (whatis C::cOtherFileType) (whatis ::C::cOtherFileType, whatis C::cOtherFileVar) (whatis ::C::cOtherFileVar, print C::cOtherFileVar) (print ::C::cOtherFileVar) (whatis C::OtherFileClass::cOtherFileClassType) (whatis ::C::OtherFileClass::cOtherFileClassType) (print C::OtherFileClass::cOtherFileClassVar) (print ::cOtherFileClassVar) (print ::C::OtherFileClass::cOtherFileClassVar): New tests. (ptype OtherFileClass, ptype ::C::OtherFileClass): Permit arbitrary trailing content. * gdb.cp/namespace1.cc (C::OtherFileClass::cOtherFileClassType) (C::OtherFileClass::cOtherFileClassVar) (C::OtherFileClass::cOtherFileClassVar_use, C::cOtherFileType) (C::cOtherFileVar, C::cOtherFileVar_use): New.
This commit is contained in:
parent
af53d23161
commit
41f62f3939
8 changed files with 159 additions and 12 deletions
20
gdb/symtab.c
20
gdb/symtab.c
|
@ -1054,7 +1054,6 @@ lookup_symbol_aux (const char *name, const struct block *block,
|
|||
{
|
||||
struct symbol *sym;
|
||||
const struct language_defn *langdef;
|
||||
struct objfile *objfile;
|
||||
|
||||
/* Make sure we do something sensible with is_a_field_of_this, since
|
||||
the callers that set this parameter to some non-null value will
|
||||
|
@ -1122,10 +1121,21 @@ lookup_symbol_aux (const char *name, const struct block *block,
|
|||
return sym;
|
||||
|
||||
/* Now search all static file-level symbols. Not strictly correct,
|
||||
but more useful than an error. Do the symtabs first, then check
|
||||
the psymtabs. If a psymtab indicates the existence of the
|
||||
desired name as a file-level static, then do psymtab-to-symtab
|
||||
conversion on the fly and return the found symbol. */
|
||||
but more useful than an error. */
|
||||
|
||||
return lookup_static_symbol_aux (name, domain);
|
||||
}
|
||||
|
||||
/* Search all static file-level symbols for NAME from DOMAIN. Do the symtabs
|
||||
first, then check the psymtabs. If a psymtab indicates the existence of the
|
||||
desired name as a file-level static, then do psymtab-to-symtab conversion on
|
||||
the fly and return the found symbol. */
|
||||
|
||||
struct symbol *
|
||||
lookup_static_symbol_aux (const char *name, const domain_enum domain)
|
||||
{
|
||||
struct objfile *objfile;
|
||||
struct symbol *sym;
|
||||
|
||||
sym = lookup_symbol_aux_symtabs (STATIC_BLOCK, name, domain);
|
||||
if (sym != NULL)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue