Index: gdbtypes.c =================================================================== RCS file: /cvs/src/src/gdb/gdbtypes.c,v retrieving revision 1.114 diff -u -p -r1.114 gdbtypes.c --- gdbtypes.c 28 Feb 2007 19:42:08 -0000 1.114 +++ gdbtypes.c 16 May 2007 20:34:08 -0000 @@ -276,6 +276,7 @@ make_pointer_type (struct type *type, st { 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, st { 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, st 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; }