This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Fix update of floating variable objects
- From: Vladimir Prus <ghost at cs dot msu dot su>
- To: gdb-patches at sourceware dot org
- Date: Sat, 19 Apr 2008 21:06:52 +0400
- Subject: Fix update of floating variable objects
I've checked in the below patch that makes sure that
-var-update --all-values
indeed includes all values, even for a variable object which type has
changed -- which can happen with floating varobjs.
- Volodya
Index: gdb/ChangeLog
===================================================================
RCS file: /cvs/src/src/gdb/ChangeLog,v
retrieving revision 1.9296
diff -u -p -r1.9296 ChangeLog
--- gdb/ChangeLog 19 Apr 2008 16:38:25 -0000 1.9296
+++ gdb/ChangeLog 19 Apr 2008 17:01:01 -0000
@@ -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.
Index: gdb/mi/mi-cmd-var.c
===================================================================
RCS file: /cvs/src/src/gdb/mi/mi-cmd-var.c,v
retrieving revision 1.49
diff -u -p -r1.49 mi-cmd-var.c
--- gdb/mi/mi-cmd-var.c 13 Apr 2008 09:33:48 -0000 1.49
+++ gdb/mi/mi-cmd-var.c 19 Apr 2008 17:01:01 -0000
@@ -687,6 +687,8 @@ varobj_update_one (struct varobj *var, e
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)
Index: gdb/testsuite/ChangeLog
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/ChangeLog,v
retrieving revision 1.1613
diff -u -p -r1.1613 ChangeLog
--- gdb/testsuite/ChangeLog 19 Apr 2008 05:06:54 -0000 1.1613
+++ gdb/testsuite/ChangeLog 19 Apr 2008 17:01:02 -0000
@@ -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
Index: gdb/testsuite/gdb.mi/var-cmd.c
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/var-cmd.c,v
retrieving revision 1.17
diff -u -p -r1.17 var-cmd.c
--- gdb/testsuite/gdb.mi/var-cmd.c 13 Apr 2008 09:33:49 -0000 1.17
+++ gdb/testsuite/gdb.mi/var-cmd.c 19 Apr 2008 17:01:02 -0000
@@ -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)"