summaryrefslogtreecommitdiff
path: root/gdb/varobj.c
diff options
context:
space:
mode:
authorVladimir Prus <vladimir@codesourcery.com>2009-05-17 07:13:17 +0000
committerVladimir Prus <vladimir@codesourcery.com>2009-05-17 07:13:17 +0000
commitcbf7162e522c05ce6fe12dc6a4320ef91c930ea1 (patch)
tree6ec9cbbfda805d8aeb41dec2e786fd0703b8b079 /gdb/varobj.c
parentbcae35effefa2bb4785c9b25fefc9e6068c6e827 (diff)
downloadgdb-cbf7162e522c05ce6fe12dc6a4320ef91c930ea1.tar.gz
Always report varobj as changed when in_scope attribute changes.
* varobj.c (install_new_value): If non-NULL-ness of value changed, return 1.
Diffstat (limited to 'gdb/varobj.c')
-rw-r--r--gdb/varobj.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/gdb/varobj.c b/gdb/varobj.c
index 8ec67b77cf1..d36e46d8cee 100644
--- a/gdb/varobj.c
+++ b/gdb/varobj.c
@@ -982,9 +982,12 @@ varobj_list (struct varobj ***varlist)
this is the first assignement after the variable object was just
created, or changed type. In that case, just assign the value
and return 0.
- Otherwise, assign the value and if type_changeable returns non-zero,
- find if the new value is different from the current value.
- Return 1 if so, and 0 if the values are equal.
+ Otherwise, assign the new value, and return 1 if the value is different
+ from the current one, 0 otherwise. The comparison is done on textual
+ representation of value. Therefore, some types need not be compared. E.g.
+ for structures the reported value is always "{...}", so no comparison is
+ necessary here. If the old value was NULL and new one is not, or vice versa,
+ we always return 1.
The VALUE parameter should not be released -- the function will
take care of releasing it when needed. */
@@ -1105,6 +1108,15 @@ install_new_value (struct varobj *var, struct value *value, int initial)
}
}
+ if (!initial && !changeable)
+ {
+ /* For values that are not changeable, we don't compare the values.
+ However, we want to notice if a value was not NULL and now is NULL,
+ or vise versa, so that we report when top-level varobjs come in scope
+ and leave the scope. */
+ changed = (var->value != NULL) != (value != NULL);
+ }
+
/* We must always keep the new value, since children depend on it. */
if (var->value != NULL && var->value != value)
value_free (var->value);