aboutsummaryrefslogtreecommitdiff
path: root/gdb/stabsread.c
diff options
context:
space:
mode:
authorJim Kingdon <jkingdon@engr.sgi.com>1993-11-14 06:40:47 +0000
committerJim Kingdon <jkingdon@engr.sgi.com>1993-11-14 06:40:47 +0000
commit79cf7e1f330c45abe5460fb6182d5bca684f9187 (patch)
treed6f9e005d2780ef1af0f8a1b131d207702d65cc1 /gdb/stabsread.c
parentf50cb1a34d237ce65da41c763a879ac7873a8c0e (diff)
downloadgdb-79cf7e1f330c45abe5460fb6182d5bca684f9187.zip
gdb-79cf7e1f330c45abe5460fb6182d5bca684f9187.tar.gz
gdb-79cf7e1f330c45abe5460fb6182d5bca684f9187.tar.bz2
* 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.
Diffstat (limited to 'gdb/stabsread.c')
-rw-r--r--gdb/stabsread.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/gdb/stabsread.c b/gdb/stabsread.c
index d038ca6..3f037fb 100644
--- a/gdb/stabsread.c
+++ b/gdb/stabsread.c
@@ -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. */