2010-07-02 Ulrich Weigand <uweigand@de.ibm.com>
[binutils-gdb.git] / gdb / valops.c
index 506d40ec2f50d64bd30ab2643b06a6721fa92672..7fbad10ce34db9c386e84bdf0b1d87f447be46a6 100644 (file)
@@ -1852,7 +1852,7 @@ search_struct_field (const char *name, struct value *arg1, int offset,
              {
                v = value_static_field (type, i);
                if (v == 0)
-                 error (_("field %s is nonexistent or has been optimised out"),
+                 error (_("field %s is nonexistent or has been optimized out"),
                         name);
              }
            else
@@ -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;