aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVladimir Prus <vladimir@codesourcery.com>2008-04-19 17:03:20 +0000
committerVladimir Prus <vladimir@codesourcery.com>2008-04-19 17:03:20 +0000
commit8e91f0232ca9c286299092c896288b8657c9311b (patch)
tree32908995d006b7370bef473414c7a339a9e9360e
parent603ba1de0bfd2aabf369a10ed8a645388e466db8 (diff)
downloadgdb-8e91f0232ca9c286299092c896288b8657c9311b.zip
gdb-8e91f0232ca9c286299092c896288b8657c9311b.tar.gz
gdb-8e91f0232ca9c286299092c896288b8657c9311b.tar.bz2
* mi/mi-cmd-var.c (varobj_update_one): Print new
value for variable objects that changed type.
-rw-r--r--gdb/ChangeLog5
-rw-r--r--gdb/mi/mi-cmd-var.c2
-rw-r--r--gdb/testsuite/ChangeLog6
-rw-r--r--gdb/testsuite/gdb.mi/var-cmd.c7
4 files changed, 20 insertions, 0 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 0f0db2d..7d08e32 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,10 @@
2008-04-19 Vladimir Prus <vladimir@codesourcery.com>
+ * mi/mi-cmd-var.c (varobj_update_one): Print new
+ value for variable objects that changed type.
+
+2008-04-19 Vladimir Prus <vladimir@codesourcery.com>
+
* varobj.c (varobj_invalidate): Don't touch floating
varobjs.
diff --git a/gdb/mi/mi-cmd-var.c b/gdb/mi/mi-cmd-var.c
index 9c0df69..2f009fa 100644
--- a/gdb/mi/mi-cmd-var.c
+++ b/gdb/mi/mi-cmd-var.c
@@ -687,6 +687,8 @@ varobj_update_one (struct varobj *var, enum print_values print_values,
ui_out_field_string (uiout, "new_type", varobj_get_type(var));
ui_out_field_int (uiout, "new_num_children",
varobj_get_num_children(var));
+ if (mi_print_value_p (varobj_get_gdb_type (var), print_values))
+ ui_out_field_string (uiout, "value", varobj_get_value (var));
break;
}
if (mi_version (uiout) > 1)
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index ae8cfe6..bcf8619 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,9 @@
+2008-04-19 Vladimir Prus <vladimir@codesourcery.com>
+
+ * gdb.mi/var-cmd.c (do_at_tests): Verify that
+ '-var-update --all-values' reports new value even the type
+ of a variable object has changed.
+
2008-04-18 Craig Silverstein <csilvers@google.com>
* gdb.dwarf2/dw2-compressed.S, gdb.dwarf2/dw2-compressed.exp: New
diff --git a/gdb/testsuite/gdb.mi/var-cmd.c b/gdb/testsuite/gdb.mi/var-cmd.c
index ffc442f..99542cc 100644
--- a/gdb/testsuite/gdb.mi/var-cmd.c
+++ b/gdb/testsuite/gdb.mi/var-cmd.c
@@ -450,6 +450,13 @@ void do_at_tests ()
:*/
i += 2.0;
}
+ {
+ float i = 19;
+ /*:
+ mi_gdb_test "-var-update --all-values F" {.*value="19".*} "update F (--all-values)"
+ :*/
+ i += 2.0;
+ }
i++;
/*:
mi_varobj_update_with_type_change F "int" "0" "update F (3)"