diff options
author | John Gilmore <gnu@cygnus> | 1991-11-28 00:51:48 +0000 |
---|---|---|
committer | John Gilmore <gnu@cygnus> | 1991-11-28 00:51:48 +0000 |
commit | 67c29f758dfe3fdb08c77595154de1aaf5b9fafd (patch) | |
tree | 288a8487a9acbf74f658f0231c25ce96d2ec44db | |
parent | 52bd2c221fc584e776fdc34cd66753a965a8cacc (diff) | |
download | gdb-67c29f758dfe3fdb08c77595154de1aaf5b9fafd.zip gdb-67c29f758dfe3fdb08c77595154de1aaf5b9fafd.tar.gz gdb-67c29f758dfe3fdb08c77595154de1aaf5b9fafd.tar.bz2 |
Make structs work on DECstation (sigh)
-rw-r--r-- | gdb/ChangeLog | 4 | ||||
-rw-r--r-- | gdb/mipsread.c | 11 | ||||
-rw-r--r-- | gdb/symtab.h | 3 |
3 files changed, 13 insertions, 5 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 43a2678..6941e92 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -4,7 +4,7 @@ Wed Nov 27 01:23:41 1991 John Gilmore (gnu at cygnus.com) * symtab.h: target_type is not used in record types. Eliminate TYPE_MAIN_VARIANT and TYPE_NEXT_VARIANT. Eliminate - lookup_method_type. + lookup_method_type. Add TYPE_TYPE_SPECIFIC macro. * symtab.c (lookup_member_type): Don't chain them up, just allocate one in symbol_obstack when we need one. @@ -30,6 +30,8 @@ Wed Nov 27 01:23:41 1991 John Gilmore (gnu at cygnus.com) * mipsread.c: Eliminate "template" types. Build new, real types whenever we need them. Allocate cplus structures as needed. Bulletproof the type parsing a bit more. Mark storage leaks. + (parse_type): Copy TYPE_TYPE_SPECIFIC when copying a real type + on top of a partial type. Fri Nov 22 16:39:57 1991 John Gilmore (gnu at cygnus.com) diff --git a/gdb/mipsread.c b/gdb/mipsread.c index 193278d..09c81a5 100644 --- a/gdb/mipsread.c +++ b/gdb/mipsread.c @@ -1056,6 +1056,7 @@ static struct type *parse_type(ax, sh, bs) TIR *t; struct type *tp = 0, *tp1; char *fmt; + int i; /* Procedures start off by one */ if (sh->st == stProc || sh->st == stStaticProc) @@ -1150,11 +1151,15 @@ static struct type *parse_type(ax, sh, bs) */ TYPE_CODE(tp1) = TYPE_CODE(tp); TYPE_NAME(tp1) = obsavestring(name, strlen(name)); - if (TYPE_CODE(tp1) == TYPE_CODE_ENUM) { - int i; + TYPE_TYPE_SPECIFIC(tp1) = TYPE_TYPE_SPECIFIC(tp); + /* Now do cleanup based on the final type. */ + switch (TYPE_CODE (tp1)) { + case TYPE_CODE_ENUM: for (i = 0; i < TYPE_NFIELDS(tp1); i++) - make_enum_constant(&TYPE_FIELD(tp1,i), tp1); + make_enum_constant(&TYPE_FIELD(tp1,i), + tp1); + break; } } if (tp1 != tp) { diff --git a/gdb/symtab.h b/gdb/symtab.h index 801bc5f..2c5646e 100644 --- a/gdb/symtab.h +++ b/gdb/symtab.h @@ -195,7 +195,7 @@ struct type int vptr_fieldno; /* Slot to point to additional language-specific fields of this type. */ - union + union type_specific { struct type **arg_types; struct cplus_struct_type *cplus_stuff; @@ -674,6 +674,7 @@ int current_source_line; #define TYPE_FN_FIELDS(thistype) TYPE_CPLUS_SPECIFIC(thistype)->fn_fields #define TYPE_NFN_FIELDS(thistype) TYPE_CPLUS_SPECIFIC(thistype)->nfn_fields #define TYPE_NFN_FIELDS_TOTAL(thistype) TYPE_CPLUS_SPECIFIC(thistype)->nfn_fields_total +#define TYPE_TYPE_SPECIFIC(thistype) (thistype)->type_specific #define TYPE_ARG_TYPES(thistype) (thistype)->type_specific.arg_types #define TYPE_CPLUS_SPECIFIC(thistype) (thistype)->type_specific.cplus_stuff #define TYPE_BASECLASS(thistype,index) (thistype)->fields[index].type |