Index: varobj.c =================================================================== RCS file: /cvs/src/src/gdb/varobj.c,v retrieving revision 1.58 diff -u -r1.58 varobj.c @@ -2055,8 +2219,14 @@ { /* BOGUS: if val_print sees a struct/class, it will print out its children instead of "{...}" */ + struct type* type = get_type (var); + /* Strip top-level references. */ + while (TYPE_CODE (type) == TYPE_CODE_REF) + { + type = TYPE_TARGET_TYPE (type); + } - switch (TYPE_CODE (get_type (var))) + switch (TYPE_CODE (type)) { case TYPE_CODE_STRUCT: case TYPE_CODE_UNION: