+2006-05-03 Vladimir Prus <ghost@cs.msu.su>
+
+ * varobj.c (c_value_of_variable): Ignore top-level references.
+ (Committed by Jim Blandy.)
+
2006-04-30 Mark Kettenis <kettenis@gnu.org>
* breakpoint.c (insert_single_step_breakpoint): Make a failure to
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: