diff options
author | Fred Fish <fnf@specifix.com> | 1991-12-04 23:40:07 +0000 |
---|---|---|
committer | Fred Fish <fnf@specifix.com> | 1991-12-04 23:40:07 +0000 |
commit | 8b5b6fae67a4183c7f43080b84023e89d56d7884 (patch) | |
tree | 5b7660236cb5307626433878ab52ecccc06e4ed0 | |
parent | 43857158b5bbd4f10fb07f594d0aa0f5ebe55fff (diff) | |
download | gdb-8b5b6fae67a4183c7f43080b84023e89d56d7884.zip gdb-8b5b6fae67a4183c7f43080b84023e89d56d7884.tar.gz gdb-8b5b6fae67a4183c7f43080b84023e89d56d7884.tar.bz2 |
Handle structures and unions which contain DIE's other than just member
DIE's.
-rw-r--r-- | gdb/dwarfread.c | 40 |
1 files changed, 27 insertions, 13 deletions
diff --git a/gdb/dwarfread.c b/gdb/dwarfread.c index f975c7f..ad6c958 100644 --- a/gdb/dwarfread.c +++ b/gdb/dwarfread.c @@ -361,7 +361,8 @@ EXFUN(process_dies, static void EXFUN(read_structure_scope, - (struct dieinfo *dip AND char *thisdie AND char *enddie)); + (struct dieinfo *dip AND char *thisdie AND char *enddie AND + struct objfile *objfile)); static struct type * EXFUN(decode_array_element_type, (char *scan AND char *end)); @@ -382,7 +383,8 @@ EXFUN(read_enumeration, static struct type * EXFUN(struct_type, - (struct dieinfo *dip AND char *thisdie AND char *enddie)); + (struct dieinfo *dip AND char *thisdie AND char *enddie AND + struct objfile *objfile)); static struct type * EXFUN(enum_type, (struct dieinfo *dip)); @@ -867,7 +869,7 @@ LOCAL FUNCTION SYNOPSIS static struct type *struct_type (struct dieinfo *dip, char *thisdie, - char *enddie) + char *enddie, struct objfile *objfile) DESCRIPTION @@ -878,10 +880,11 @@ DESCRIPTION */ static struct type * -DEFUN(struct_type, (dip, thisdie, enddie), +DEFUN(struct_type, (dip, thisdie, enddie, objfile), struct dieinfo *dip AND char *thisdie AND - char *enddie) + char *enddie AND + struct objfile *objfile) { struct type *type; struct nextfield { @@ -896,6 +899,7 @@ DEFUN(struct_type, (dip, thisdie, enddie), char *tpart2; char *tpart3; struct dieinfo mbr; + char *nextdie; if ((type = lookup_utype (dip -> dieref)) == NULL) { @@ -953,6 +957,14 @@ DEFUN(struct_type, (dip, thisdie, enddie), { break; } + else if (mbr.at_sibling != 0) + { + nextdie = dbbase + mbr.at_sibling - dbroff; + } + else + { + nextdie = thisdie + mbr.dielength; + } switch (mbr.dietag) { case TAG_member: @@ -968,10 +980,10 @@ DEFUN(struct_type, (dip, thisdie, enddie), nfields++; break; default: - SQUAWK (("bad member of '%s'", TYPE_NAME (type))); + process_dies (thisdie, nextdie, objfile); break; } - thisdie += mbr.dielength; + thisdie = nextdie; } /* Now create the vector of fields, and record how big it is. */ TYPE_NFIELDS (type) = nfields; @@ -994,7 +1006,7 @@ LOCAL FUNCTION SYNOPSIS static void read_structure_scope (struct dieinfo *dip, - char *thisdie, char *enddie) + char *thisdie, char *enddie, struct objfile *objfile) DESCRIPTION @@ -1011,15 +1023,16 @@ NOTES */ static void -DEFUN(read_structure_scope, (dip, thisdie, enddie), +DEFUN(read_structure_scope, (dip, thisdie, enddie, objfile), struct dieinfo *dip AND char *thisdie AND - char *enddie) + char *enddie AND + struct objfile *objfile) { struct type *type; struct symbol *sym; - type = struct_type (dip, thisdie, enddie); + type = struct_type (dip, thisdie, enddie, objfile); if ((sym = new_symbol (dip)) != NULL) { SYMBOL_TYPE (sym) = type; @@ -1541,7 +1554,8 @@ LOCAL FUNCTION SYNOPSIS - static void process_dies (char *thisdie, char *enddie) + static void process_dies (char *thisdie, char *enddie, + struct objfile *objfile) DESCRIPTION @@ -1595,7 +1609,7 @@ DEFUN(process_dies, (thisdie, enddie, objfile), break; case TAG_structure_type: case TAG_union_type: - read_structure_scope (&di, thisdie, nextdie); + read_structure_scope (&di, thisdie, nextdie, objfile); break; case TAG_enumeration_type: read_enumeration (&di, thisdie, nextdie); |