Index: gdb/varobj.c =================================================================== RCS file: /cvs/src/src/gdb/varobj.c,v retrieving revision 1.156 diff -u -p -r1.156 varobj.c --- gdb/varobj.c 3 Mar 2010 18:32:44 -0000 1.156 +++ gdb/varobj.c 22 Mar 2010 19:15:34 -0000 @@ -2821,6 +2821,12 @@ c_describe_child (struct varobj *parent, parent_expression = varobj_get_path_expr (parent); } adjust_value_for_child_access (&value, &type, &was_ptr); + if (value != parent->value) + { + /* If value was created merely to later create child, + * do not keep it in value history. */ + release_value (value); + } switch (TYPE_CODE (type)) { @@ -2902,6 +2908,9 @@ c_describe_child (struct varobj *parent, *cfull_expression = xstrdup ("???"); /* Don't set value and type, we don't know then. */ } + + if (value != parent->value) + value_free (value); } static char *