Make structs work on DECstation (sigh)
[deliverable/binutils-gdb.git] / gdb / mipsread.c
index 193278dd616b7140d58daa56b3a8ee2b03c60eb7..09c81a5bd8356bbda7cc2f2f81f41c8ca3676a61 100644 (file)
@@ -1056,6 +1056,7 @@ static struct type *parse_type(ax, sh, bs)
        TIR            *t;
        struct type    *tp = 0, *tp1;
        char           *fmt;
+       int             i;
 
        /* Procedures start off by one */
        if (sh->st == stProc || sh->st == stStaticProc)
@@ -1150,11 +1151,15 @@ static struct type *parse_type(ax, sh, bs)
                         */
                        TYPE_CODE(tp1) = TYPE_CODE(tp);
                        TYPE_NAME(tp1) = obsavestring(name, strlen(name));
-                       if (TYPE_CODE(tp1) == TYPE_CODE_ENUM) {
-                               int             i;
+                       TYPE_TYPE_SPECIFIC(tp1) = TYPE_TYPE_SPECIFIC(tp);
 
+                       /* Now do cleanup based on the final type.  */
+                       switch (TYPE_CODE (tp1)) {
+                       case TYPE_CODE_ENUM:
                                for (i = 0; i < TYPE_NFIELDS(tp1); i++)
-                                       make_enum_constant(&TYPE_FIELD(tp1,i), tp1);
+                                       make_enum_constant(&TYPE_FIELD(tp1,i),
+                                                          tp1);
+                               break;
                        }
                }
                if (tp1 != tp) {
This page took 0.023077 seconds and 4 git commands to generate.