--- gdb-5.2/gdb/dwarfread.c 2002-02-04 11:55:34.000000000 +0000 +++ gdb-5.2-dds_patch/gdb/dwarfread.c 2002-07-25 09:33:36.000000000 +0100 @@ -490,10 +490,13 @@ static void read_tag_pointer_type (struct dieinfo *dip); static void read_tag_string_type (struct dieinfo *dip); +static void +read_tag_typedef (struct dieinfo *, struct objfile *); + static void read_subroutine_type (struct dieinfo *, char *, char *); static void read_enumeration (struct dieinfo *, char *, char *, struct objfile *); @@ -1796,10 +1799,44 @@ /* LOCAL FUNCTION + read_tag_typedef -- read TAG_typedef DIE + + SYNOPSIS + + static void read_tag_typedef (struct dieinfo *, struct objfile *); + + DESCRIPTION + Populate the user type with details of the typedef. + + This isn't required by gcc as it doesn't generate + at_mod_u_d_type's that point to typedefs. However other + compilers do (eg diab). + */ + +static void +read_tag_typedef (struct dieinfo *dip, struct objfile *objfile) +{ + struct type *type; + + if ((type = lookup_utype (dip->die_ref)) == NULL) + { + /* No forward references created an empty type, so install one now */ + type = alloc_utype (dip->die_ref, NULL); + } + TYPE_TARGET_TYPE(type) = decode_die_type(dip); + TYPE_CODE(type) = TYPE_CODE_TYPEDEF; + + new_symbol (dip, objfile); +} + +/* + + LOCAL FUNCTION + handle_producer -- process the AT_producer attribute DESCRIPTION Perform any operations that depend on finding a particular @@ -1994,10 +2031,13 @@ read_tag_pointer_type (&di); break; case TAG_string_type: read_tag_string_type (&di); break; + case TAG_typedef: + read_tag_typedef (&di, objfile); + break; default: new_symbol (&di, objfile); break; } }