From: jimb Date: Wed, 18 Feb 2004 01:09:02 +0000 (+0000) Subject: * stabsread.c (read_type): If we find any type numbers that are X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=7fdb2b24bcb941ab24964ee4551da9514b58d9d2;p=pf3gnuchains%2Fpf3gnuchains3x.git * 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. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 5b8fa48785..55733fb58e 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,11 @@ +2004-02-17 Jim Blandy + + * 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. + 2004-02-17 Elena Zannoni * Makefile.in (defs_h): Remove dependency on progress_h. diff --git a/gdb/stabsread.c b/gdb/stabsread.c index 021c19eb48..5cee516bcb 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;