gdb/ChangeLog:
[deliverable/binutils-gdb.git] / gdb / varobj.c
index c16e08819fe1cb80d01e3b95c0e0dac5cc9e31a1..c664bfd09755348fb9c0e22926c0c5fc51e1dc4b 100644 (file)
@@ -2054,10 +2054,16 @@ c_variable_editable (struct varobj *var)
 static char *
 c_value_of_variable (struct varobj *var)
 {
-  /* BOGUS: if val_print sees a struct/class, it will print out its
-     children instead of "{...}" */
+  /* BOGUS: if val_print sees a struct/class, or a reference to one,
+     it will print out its children instead of "{...}".  So we need to
+     catch that case explicitly.  */
+  struct type *type = get_type (var);
 
-  switch (TYPE_CODE (get_type (var)))
+  /* Strip top-level references. */
+  while (TYPE_CODE (type) == TYPE_CODE_REF)
+    type = check_typedef (TYPE_TARGET_TYPE (type));
+
+  switch (TYPE_CODE (type))
     {
     case TYPE_CODE_STRUCT:
     case TYPE_CODE_UNION:
This page took 0.025024 seconds and 4 git commands to generate.