Fixes to improve opaque struct/union handling. Still fails to find the

complete definition for files outside the one containing the complete
definition, if that file has not yet been read in.  (Working on it...)
This commit is contained in:
Fred Fish 1991-12-06 16:37:20 +00:00
parent 7b2a87cab2
commit 5edf98d7a2
2 changed files with 31 additions and 12 deletions

View file

@ -1,3 +1,10 @@
Fri Dec 6 08:30:36 1991 Fred Fish (fnf at cygnus.com)
* dwarfread.c (struct_type): Fixes to improve opaque struct/union
handling. Does not solve all problems, since gdb still fails to
find the complete definition if the file containing the complete
definition has not yet been read in. (FIXME)
Thu Dec 5 21:53:21 1991 John Gilmore (gnu at cygnus.com)
* symtab.c (decode_line_1): If SKIP_PROLOGUE leaves us in

View file

@ -902,6 +902,7 @@ DEFUN(struct_type, (dip, thisdie, enddie, objfile),
if ((type = lookup_utype (dip -> dieref)) == NULL)
{
/* No forward references created an empty type, so install one now */
type = alloc_utype (dip -> dieref, NULL);
}
TYPE_CPLUS_SPECIFIC (type) = (struct cplus_struct_type *)
@ -925,9 +926,9 @@ DEFUN(struct_type, (dip, thisdie, enddie, objfile),
SQUAWK (("missing structure or union tag"));
break;
}
/* Some compilers try to be helpful by inventing "fake" names for anonymous
enums, structures, and unions, like "~0fake" or ".0fake". Thanks, but
no thanks... */
/* Some compilers try to be helpful by inventing "fake" names for
anonymous enums, structures, and unions, like "~0fake" or ".0fake".
Thanks, but no thanks... */
if (dip -> at_name != NULL
&& *dip -> at_name != '~'
&& *dip -> at_name != '.')
@ -975,7 +976,17 @@ DEFUN(struct_type, (dip, thisdie, enddie, objfile),
}
thisdie = nextdie;
}
/* Now create the vector of fields, and record how big it is. */
/* Now create the vector of fields, and record how big it is. We may
not even have any fields, if this DIE was generated due to a reference
to an anonymous structure or union. In this case, TYPE_FLAG_STUB is
set, which clues gdb in to the fact that it needs to search elsewhere
for the full structure definition. */
if (nfields == 0)
{
TYPE_FLAGS (type) |= TYPE_FLAG_STUB;
}
else
{
TYPE_NFIELDS (type) = nfields;
TYPE_FIELDS (type) = (struct field *)
obstack_alloc (symbol_obstack, sizeof (struct field) * nfields);
@ -984,6 +995,7 @@ DEFUN(struct_type, (dip, thisdie, enddie, objfile),
{
TYPE_FIELD (type, --n) = list -> field;
}
}
return (type);
}