summaryrefslogtreecommitdiff
path: root/gdb/stabsread.c
diff options
context:
space:
mode:
authorJim Blandy <jimb@codesourcery.com>2004-02-18 01:09:03 +0000
committerJim Blandy <jimb@codesourcery.com>2004-02-18 01:09:03 +0000
commit19feb0c9f1ca8019985072dc02064e7ba718a997 (patch)
tree06fc06b1c74e95f26c2628b22843e67bd51c5181 /gdb/stabsread.c
parentea39e25b9e52183780f0356415469a9fb184f20b (diff)
downloadgdb-19feb0c9f1ca8019985072dc02064e7ba718a997.tar.gz
* stabsread.c (read_type): If we find any type numbers that are
forward references, complain if the references aren't resolved by the time we're finished reading. (cleanup_undefined_types): Make error message more appropriate for a complaint.
Diffstat (limited to 'gdb/stabsread.c')
-rw-r--r--gdb/stabsread.c21
1 files changed, 16 insertions, 5 deletions
diff --git a/gdb/stabsread.c b/gdb/stabsread.c
index 021c19eb489..5cee516bcb3 100644
--- a/gdb/stabsread.c
+++ b/gdb/stabsread.c
@@ -1446,11 +1446,21 @@ read_type (char **pp, struct objfile *objfile)
if (read_type_number (pp, typenums) != 0)
return error_type (pp, objfile);
- /* Type is not being defined here. Either it already exists,
- or this is a forward reference to it. dbx_alloc_type handles
- both cases. */
if (**pp != '=')
- return dbx_alloc_type (typenums, objfile);
+ {
+ /* Type is not being defined here. Either it already
+ exists, or this is a forward reference to it.
+ dbx_alloc_type handles both cases. */
+ type = dbx_alloc_type (typenums, objfile);
+
+ /* If this is a forward reference, arrange to complain if it
+ doesn't get patched up by the time we're done
+ reading. */
+ if (TYPE_CODE (type) == TYPE_CODE_UNDEF)
+ add_undefined_type (type);
+
+ return type;
+ }
/* Type is being defined here. */
/* Skip the '='.
@@ -4197,7 +4207,8 @@ cleanup_undefined_types (void)
default:
{
complaint (&symfile_complaints,
- "GDB internal error. cleanup_undefined_types with bad type %d.",
+ "forward-referenced types left unresolved, "
+ "type code %d.",
TYPE_CODE (*type));
}
break;