mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-09-11 16:46:14 +08:00
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:
12
gdb/valops.c
12
gdb/valops.c
@ -3284,8 +3284,16 @@ value_maybe_namespace_elt (const struct type *curtype,
|
||||
struct value *result;
|
||||
|
||||
sym = cp_lookup_symbol_namespace (namespace_name, name,
|
||||
get_selected_block (0),
|
||||
VAR_DOMAIN);
|
||||
get_selected_block (0), VAR_DOMAIN);
|
||||
|
||||
if (sym == NULL)
|
||||
{
|
||||
char *concatenated_name = alloca (strlen (namespace_name) + 2
|
||||
+ strlen (name) + 1);
|
||||
|
||||
sprintf (concatenated_name, "%s::%s", namespace_name, name);
|
||||
sym = lookup_static_symbol_aux (concatenated_name, VAR_DOMAIN);
|
||||
}
|
||||
|
||||
if (sym == NULL)
|
||||
return NULL;
|
||||
|
Reference in New Issue
Block a user