aboutsummaryrefslogtreecommitdiff
path: root/gdb/varobj.c
diff options
context:
space:
mode:
authorJim Blandy <jimb@codesourcery.com>2006-05-03 22:59:38 +0000
committerJim Blandy <jimb@codesourcery.com>2006-05-03 22:59:38 +0000
commit14b3d9c967b5ad2b6022069fc84bbc7541d3f977 (patch)
treef4e478230e697f29fe6cb1b1c3cfb353bf3b0fe2 /gdb/varobj.c
parent104b4fab38823840d1b41da92a33aaadb597e524 (diff)
downloadgdb-14b3d9c967b5ad2b6022069fc84bbc7541d3f977.zip
gdb-14b3d9c967b5ad2b6022069fc84bbc7541d3f977.tar.gz
gdb-14b3d9c967b5ad2b6022069fc84bbc7541d3f977.tar.bz2
gdb/ChangeLog:
2006-05-03 Vladimir Prus <ghost@cs.msu.su> * varobj.c (c_value_of_variable): Ignore top-level references. (Committed by Jim Blandy.)
Diffstat (limited to 'gdb/varobj.c')
-rw-r--r--gdb/varobj.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/gdb/varobj.c b/gdb/varobj.c
index c16e088..c664bfd 100644
--- a/gdb/varobj.c
+++ b/gdb/varobj.c
@@ -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: