diff options
author | Vladimir Prus <vladimir@codesourcery.com> | 2006-11-29 06:41:13 +0000 |
---|---|---|
committer | Vladimir Prus <vladimir@codesourcery.com> | 2006-11-29 06:41:13 +0000 |
commit | ae097835482c59d31fa242ea7c8247913fcfee4a (patch) | |
tree | 45529904015751a4c45daa3d367e28b1b18d1dfe /gdb/varobj.c | |
parent | ba3d1a1c2df7a6446386e157dc08a59b3ec2b547 (diff) | |
download | gdb-ae097835482c59d31fa242ea7c8247913fcfee4a.zip gdb-ae097835482c59d31fa242ea7c8247913fcfee4a.tar.gz gdb-ae097835482c59d31fa242ea7c8247913fcfee4a.tar.bz2 |
2006-11-29 Vladimir Prus <vladimir@codesourcery.com>
* varobj.c (varobj_set_value): Don't compare the old
and the new value here. Don't assign new value here.
Instead, call install_new_value.
Diffstat (limited to 'gdb/varobj.c')
-rw-r--r-- | gdb/varobj.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/gdb/varobj.c b/gdb/varobj.c index 42ed597..309bd5e 100644 --- a/gdb/varobj.c +++ b/gdb/varobj.c @@ -841,18 +841,22 @@ varobj_set_value (struct varobj *var, char *expression) array's content. */ value = coerce_array (value); - if (!value_contents_equal (var->value, value)) - var->updated = 1; - /* The new value may be lazy. gdb_value_assign, or rather value_contents, will take care of this. If fetching of the new value will fail, gdb_value_assign with catch the exception. */ if (!gdb_value_assign (var->value, value, &val)) return 0; - value_free (var->value); + release_value (val); - var->value = val; + + /* If the value has changed, record it, so that next -var-update can + report this change. If a variable had a value of '1', we've set it + to '333' and then set again to '1', when -var-update will report this + variable as changed -- because the first assignment has set the + 'updated' flag. There's no need to optimize that, because return value + of -var-update should be considered an approximation. */ + var->updated = install_new_value (var, val, 0 /* Compare values. */); input_radix = saved_input_radix; return 1; } |