2010-05-11 Pierre Muller <muller@ics.u-strasbg.fr>
[platform/upstream/binutils.git] / gdb / gdbtypes.c
index a40b717..3dc8176 100644 (file)
@@ -540,7 +540,6 @@ make_qualified_type (struct type *type, int new_flags,
 struct type *
 make_type_with_address_space (struct type *type, int space_flag)
 {
-  struct type *ntype;
   int new_flags = ((TYPE_INSTANCE_FLAGS (type)
                    & ~(TYPE_INSTANCE_FLAG_CODE_SPACE
                        | TYPE_INSTANCE_FLAG_DATA_SPACE
@@ -567,11 +566,10 @@ make_cv_type (int cnst, int voltl,
              struct type **typeptr)
 {
   struct type *ntype;  /* New type */
-  struct type *tmp_type = type;        /* tmp type */
-  struct objfile *objfile;
 
   int new_flags = (TYPE_INSTANCE_FLAGS (type)
-                  & ~(TYPE_INSTANCE_FLAG_CONST | TYPE_INSTANCE_FLAG_VOLATILE));
+                  & ~(TYPE_INSTANCE_FLAG_CONST 
+                      | TYPE_INSTANCE_FLAG_VOLATILE));
 
   if (cnst)
     new_flags |= TYPE_INSTANCE_FLAG_CONST;
@@ -1246,6 +1244,13 @@ lookup_struct_elt_type (struct type *type, char *name, int noerr)
        {
          return TYPE_FIELD_TYPE (type, i);
        }
+     else if (!t_field_name || *t_field_name == '\0')
+       {
+         struct type *subtype = lookup_struct_elt_type (
+                                  TYPE_FIELD_TYPE (type, i), name, 1);
+         if (subtype != NULL)
+           return subtype;
+       }
     }
 
   /* OK, it's not in this class.  Recursively check the baseclasses.  */