*** empty log message ***
[deliverable/binutils-gdb.git] / gdb / gdbtypes.c
index 5d56de06afe2e1f66348b686da518b5ebd0f74a2..f21555845142c27eda6220d43cad2714e220834d 100644 (file)
@@ -636,7 +636,7 @@ replace_type (struct type *ntype, struct type *type)
        call replace_type().  */
     gdb_assert (TYPE_ADDRESS_CLASS_ALL (chain) == 0);
 
-    TYPE_LENGTH (ntype) = TYPE_LENGTH (type);
+    TYPE_LENGTH (chain) = TYPE_LENGTH (type);
     chain = TYPE_CHAIN (chain);
   } while (ntype != chain);
 
@@ -1514,7 +1514,15 @@ check_typedef (struct type *type)
        }
       sym = lookup_symbol (name, 0, STRUCT_DOMAIN, 0, (struct symtab **) NULL);
       if (sym)
-       make_cv_type (is_const, is_volatile, SYMBOL_TYPE (sym), &type);
+        {
+          /* Same as above for opaque types, we can replace the stub
+             with the complete type only if they are int the same
+             objfile.  */
+         if (TYPE_OBJFILE (SYMBOL_TYPE(sym)) == TYPE_OBJFILE (type))
+            make_cv_type (is_const, is_volatile, SYMBOL_TYPE (sym), &type);
+         else
+           type = SYMBOL_TYPE (sym);
+        }
     }
 
   if (TYPE_TARGET_STUB (type))
This page took 0.023957 seconds and 4 git commands to generate.