aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorJoel Brobecker <brobecker@gnat.com>2007-05-17 20:15:37 +0000
committerJoel Brobecker <brobecker@gnat.com>2007-05-17 20:15:37 +0000
commit1e98b32608b1bed31081eb942756d314f92c1036 (patch)
tree62ac7bba7babe21d61c995ff075ff1a7b3d2268a /gdb
parent5d14452b8a738fafb42dad13c8fac709bfd3c94d (diff)
downloadgdb-1e98b32608b1bed31081eb942756d314f92c1036.zip
gdb-1e98b32608b1bed31081eb942756d314f92c1036.tar.gz
gdb-1e98b32608b1bed31081eb942756d314f92c1036.tar.bz2
* gdbtypes.c (make_reference_type): Preserve the type chain
and set the length of all the variants of the pointer type.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog5
-rw-r--r--gdb/gdbtypes.c11
2 files changed, 16 insertions, 0 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 00656aa..884b337 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,10 @@
2007-05-17 Joel Brobecker <brobecker@adacore.com>
+ * gdbtypes.c (make_reference_type): Preserve the type chain
+ and set the length of all the variants of the pointer type.
+
+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.
diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c
index f43983a..db4a85a 100644
--- a/gdb/gdbtypes.c
+++ b/gdb/gdbtypes.c
@@ -354,6 +354,7 @@ make_reference_type (struct type *type, struct type **typeptr)
{
struct type *ntype; /* New type */
struct objfile *objfile;
+ struct type *chain;
ntype = TYPE_REFERENCE_TYPE (type);
@@ -379,7 +380,9 @@ make_reference_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;
}
@@ -395,6 +398,14 @@ make_reference_type (struct type *type, struct type **typeptr)
if (!TYPE_REFERENCE_TYPE (type)) /* Remember it, if don't have one. */
TYPE_REFERENCE_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;
}