* stabsread.c (read_type): Skip the colon when reading a
authorJim Kingdon <jkingdon@engr.sgi.com>
Sun, 14 Nov 1993 06:40:47 +0000 (06:40 +0000)
committerJim Kingdon <jkingdon@engr.sgi.com>
Sun, 14 Nov 1993 06:40:47 +0000 (06:40 +0000)
cross-reference.  Only complain, not error_type, on unrecognized
cross-reference types.  error_type, not dump core, if the colon is
missing.

gdb/ChangeLog
gdb/stabsread.c

index 22930f729081d72fba56ddb9c133b9c1738fa9c9..81c809dc6298510977b084e3a73436a9059b9fa3 100644 (file)
@@ -1,3 +1,10 @@
+Sun Nov 14 00:28:13 1993  Jim Kingdon  (kingdon@lioth.cygnus.com)
+
+       * stabsread.c (read_type): Skip the colon when reading a
+       cross-reference.  Only complain, not error_type, on unrecognized
+       cross-reference types.  error_type, not dump core, if the colon is
+       missing.
+
 Fri Nov 12 16:23:08 1993  Stu Grossman  (grossman at cygnus.com)
 
        * config/m68k/tm-sun3.h:  Disable use of alternate breakpoint insn
index d038ca65459ac4cd47ebc78c8b8f03947ff8b211..3f037fb3e614753948d002e13d3eaed255011e8c 100644 (file)
@@ -1321,14 +1321,26 @@ read_type (pp, objfile)
              code = TYPE_CODE_ENUM;
              break;
            default:
-             return error_type (pp);
+             {
+               /* Complain and keep going, so compilers can invent new
+                  cross-reference types.  */
+               static struct complaint msg =
+                 {"Unrecognized cross-reference type `%c'", 0, 0};
+               complain (&msg, (*pp)[0]);
+               code = TYPE_CODE_STRUCT;
+               break;
+             }
            }
           
          p = strchr(*pp, ':');
+         if (p == NULL)
+           return error_type (pp);
          while (p[1] == ':')
            {
               p += 2;
               p = strchr(p, ':');
+              if (p == NULL)
+                return error_type (pp);
            }
          to = type_name = 
                (char *)obstack_alloc (&objfile->type_obstack, p - *pp + 1);
@@ -1339,8 +1351,9 @@ read_type (pp, objfile)
            *to++ = *from++;
          *to = '\0';
          
-         /* Set the pointer ahead of the name which we just read.  */
-         *pp = from;
+         /* Set the pointer ahead of the name which we just read, and
+            the colon.  */
+         *pp = from + 1;
        }
 
        /* Now check to see whether the type has already been declared.  */