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 | 053cb41bd346a104eefeda533bc1388812e7fdf6 (patch) | |
tree | d01d037b90f3da0cf9bfe80a8d2e5223c2b5e0db /gdb | |
parent | 436aafc4d11edd36a19e1d2e1d89b1fc7ad41300 (diff) | |
download | gdb-053cb41bd346a104eefeda533bc1388812e7fdf6.zip gdb-053cb41bd346a104eefeda533bc1388812e7fdf6.tar.gz gdb-053cb41bd346a104eefeda533bc1388812e7fdf6.tar.bz2 |
* 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')
-rw-r--r-- | gdb/ChangeLog | 5 | ||||
-rw-r--r-- | gdb/gdbtypes.c | 11 |
2 files changed, 16 insertions, 0 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index ea00205..00656aa 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2007-05-17 Joel Brobecker <brobecker@adacore.com> + + * gdbtypes.c (make_pointer_type): Preserve the pointer type chain + and set the length of all the variants of the pointer type. + 2007-05-17 Maciej W. Rozycki <macro@mips.com> * mips-tdep.c (mips_n32n64_push_dummy_call): Fix and reformat a diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c index f215558..f43983a 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; } |