2006-11-29 Vladimir Prus <vladimir@codesourcery.com>
authorVladimir Prus <vladimir@codesourcery.com>
Wed, 29 Nov 2006 06:41:13 +0000 (06:41 +0000)
committerVladimir Prus <vladimir@codesourcery.com>
Wed, 29 Nov 2006 06:41:13 +0000 (06:41 +0000)
        * 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.

gdb/ChangeLog
gdb/varobj.c

index c92e9acc1c902ec5a8f3e56f973c34ceac16ffcf..dc4257f947cbb30173b7e6aa1d74eb3f22a4fdc9 100644 (file)
@@ -1,3 +1,9 @@
+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.
+
 2006-11-28  Daniel Jacobowitz  <dan@codesourcery.com>
 
        * regformats/reg-mips64.dat: New file.
index 42ed597f2926eecbddd340b9a93088a8f822712b..309bd5e6e864a37b0ca8ea8bfa68b7f4837642c0 100644 (file)
@@ -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;
     }
This page took 0.030283 seconds and 4 git commands to generate.