diff options
author | Joel Brobecker <brobecker@gnat.com> | 2007-05-17 16:38:25 +0000 |
---|---|---|
committer | Joel Brobecker <brobecker@gnat.com> | 2007-05-17 16:38:25 +0000 |
commit | ca936980fe6705b4230ca158b5c97de1e6669d4f (patch) | |
tree | d4fe2fdb181006f44fb37bb6c89c6aae8cde4fe0 /gdb/gdbtypes.c | |
parent | b12b7d70ed9b348450847ff28107387883a64a13 (diff) | |
download | gdb-ca936980fe6705b4230ca158b5c97de1e6669d4f.tar.gz |
* gdbtypes.c (make_pointer_type): Preserve the pointer type chain
and set the length of all the variants of the pointer type.
Diffstat (limited to 'gdb/gdbtypes.c')
-rw-r--r-- | gdb/gdbtypes.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c index f2155584514..f43983a072a 100644 --- a/gdb/gdbtypes.c +++ b/gdb/gdbtypes.c @@ -276,6 +276,7 @@ make_pointer_type (struct type *type, struct type **typeptr) { struct type *ntype; /* New type */ struct objfile *objfile; + struct type *chain; ntype = TYPE_POINTER_TYPE (type); @@ -301,7 +302,9 @@ make_pointer_type (struct type *type, struct type **typeptr) { ntype = *typeptr; objfile = TYPE_OBJFILE (ntype); + chain = TYPE_CHAIN (ntype); smash_type (ntype); + TYPE_CHAIN (ntype) = chain; TYPE_OBJFILE (ntype) = objfile; } @@ -321,6 +324,14 @@ make_pointer_type (struct type *type, struct type **typeptr) if (!TYPE_POINTER_TYPE (type)) /* Remember it, if don't have one. */ TYPE_POINTER_TYPE (type) = ntype; + /* Update the length of all the other variants of this type. */ + chain = TYPE_CHAIN (ntype); + while (chain != ntype) + { + TYPE_LENGTH (chain) = TYPE_LENGTH (ntype); + chain = TYPE_CHAIN (chain); + } + return ntype; } |