aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Johnston <jjohnstn@redhat.com>2002-10-23 23:54:33 +0000
committerJeff Johnston <jjohnstn@redhat.com>2002-10-23 23:54:33 +0000
commitfb9b6b359f5378f9b37aa13b57be30175fc2e6fa (patch)
tree10b5992e47d5cc78f5c894d161e2b7942deb64c7
parent8da065d53ccd9ed50eb9b30979672ba0ead52a1c (diff)
downloadgdb-fb9b6b359f5378f9b37aa13b57be30175fc2e6fa.zip
gdb-fb9b6b359f5378f9b37aa13b57be30175fc2e6fa.tar.gz
gdb-fb9b6b359f5378f9b37aa13b57be30175fc2e6fa.tar.bz2
2002-10-23 Jeff Johnston <jjohnstn@redhat.com>
* NEWS: add recent mi fixes. * varobj.c (struct varobj): Add new "updated" flag. (new_variable): Default "updated" flag to 0. (varobj_set_value): Set "updated" flag to 1 if value changes. (varobj_update): Check varobj "updated" flag before comparing old and refreshed values. Fix for PR gdb/702.
-rw-r--r--gdb/ChangeLog11
-rw-r--r--gdb/NEWS5
-rw-r--r--gdb/varobj.c16
3 files changed, 29 insertions, 3 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 09259e5..6ea2085 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,14 @@
+2002-10-23 Jeff Johnston <jjohnstn@redhat.com>
+
+ * NEWS: add recent mi fixes.
+ * varobj.c (struct varobj): Add new "updated" flag.
+ (new_variable): Default "updated" flag to 0.
+ (varobj_set_value): Set "updated" flag to 1 if value
+ changes.
+ (varobj_update): Check varobj "updated" flag before
+ comparing old and refreshed values. Fix for
+ PR gdb/702.
+
2002-10-23 David Carlton <carlton@math.stanford.edu>
* parse.c (parse_exp_1): Use BLOCK_START.
diff --git a/gdb/NEWS b/gdb/NEWS
index 4ce063e..0ba805d 100644
--- a/gdb/NEWS
+++ b/gdb/NEWS
@@ -12,6 +12,11 @@ option "-i=mi", has been changed to "mi2". The previous MI syntax,
Support for the original "mi0" syntax (included in GDB 5.0) has been
removed.
+Fix for gdb/192: removed extraneous space when displaying frame level.
+Fix for gdb/672: update changelist is now output in mi list format.
+Fix for gdb/702: a -var-assign that updates the value now shows up
+ in a subsequent -var-update.
+
* REMOVED configurations and files
V850EA ISA
diff --git a/gdb/varobj.c b/gdb/varobj.c
index 16ba528..a0e1d53 100644
--- a/gdb/varobj.c
+++ b/gdb/varobj.c
@@ -111,6 +111,9 @@ struct varobj
/* The format of the output for this object */
enum varobj_display_formats format;
+
+ /* Was this variable updated via a varobj_set_value operation */
+ int updated;
};
/* Every variable keeps a linked list of its children, described
@@ -753,6 +756,7 @@ int
varobj_set_value (struct varobj *var, char *expression)
{
struct value *val;
+ int error;
int offset = 0;
/* The argument "expression" contains the variable's new value.
@@ -778,6 +782,8 @@ varobj_set_value (struct varobj *var, char *expression)
return 0;
}
+ if (!my_value_equal (var->value, value, &error))
+ var->updated = 1;
if (!gdb_value_assign (var->value, value, &val))
return 0;
value_free (var->value);
@@ -893,10 +899,11 @@ varobj_update (struct varobj **varp, struct varobj ***changelist)
/* If values are not equal, note that it's changed.
There a couple of exceptions here, though.
We don't want some types to be reported as "changed". */
- else if (type_changeable (*varp)
- && !my_value_equal ((*varp)->value, new, &error2))
+ else if (type_changeable (*varp) &&
+ ((*varp)->updated || !my_value_equal ((*varp)->value, new, &error2)))
{
vpush (&result, *varp);
+ (*varp)->updated = 0;
changed++;
/* error2 replaces var->error since this new value
WILL replace the old one. */
@@ -933,10 +940,12 @@ varobj_update (struct varobj **varp, struct varobj ***changelist)
/* Update this variable */
new = value_of_child (v->parent, v->index);
- if (type_changeable (v) && !my_value_equal (v->value, new, &error2))
+ if (type_changeable (v) &&
+ (v->updated || !my_value_equal (v->value, new, &error2)))
{
/* Note that it's changed */
vpush (&result, v);
+ v->updated = 0;
changed++;
}
/* error2 replaces v->error since this new value
@@ -1294,6 +1303,7 @@ new_variable (void)
var->children = NULL;
var->format = 0;
var->root = NULL;
+ var->updated = 0;
return var;
}