Re: Patch for gdb/mi problem 702

J. Johnston
2002-10-23T22:20:18Z

[-- Attachment #1: Type: text/plain, Size: 461 bytes --]

I have added test scenarios to gdb.mi testsuite to verify the new assign/update
behavior.

gdb/testsuite/gdb.mi/ChangeLog

2002-10-23 Jeff Johnston <jjohnstn@redhat.com>

* mi-var-cmd.exp: Add tests to verify that a -var-assign that changes
a value shows up in the changelist of a -var-update.
* mi1-var-cmd.exp: Ditto.

Andrew, are you satisfied with my answer to your previous question and may I commit
the original patch plus these changes?

-- Jeff J.

[-- Attachment #2: 702.test.patch --]
[-- Type: text/plain, Size: 2781 bytes --]

Index: mi-var-cmd.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi-var-cmd.exp,v
retrieving revision 1.13
diff -u -r1.13 mi-var-cmd.exp
--- mi-var-cmd.exp 3 Oct 2002 20:03:55 -0000 1.13
+++ mi-var-cmd.exp 23 Oct 2002 22:12:48 -0000
@@ -288,6 +288,18 @@
"\\^done,value=\"3333\"" \
"assign to linteger"

+mi_gdb_test "-var-update *" \
+ "\\^done,changelist=\\\[\{name=\"linteger\",in_scope=\"true\",type_changed=\"false\"\}\\\]" \
+ "update all vars: linteger changed after assign"
+
+mi_gdb_test "-var-assign linteger 3333" \
+ "\\^done,value=\"3333\"" \
+ "assign to linteger again, same value"
+
+mi_gdb_test "-var-update *" \
+ "\\^done,changelist=\\\[\\\]" \
+ "update all vars: linteger not changed after same assign"
+
mi_gdb_test "-var-evaluate-expression linteger" \
"\\^done,value=\"3333\"" \
"eval linteger"
@@ -295,6 +307,14 @@
mi_gdb_test "-var-assign lpinteger \"&linteger + 3\"" \
"\\^done,value=\"$hex\"" \
"assign to lpinteger"
+
+mi_gdb_test "-var-update *" \
+ "\\^done,changelist=\\\[\{name=\"lpinteger\",in_scope=\"true\",type_changed=\"false\"\}\\\]" \
+ "update all vars: lpinteger changed after assign"
+
+mi_gdb_test "-var-update *" \
+ "\\^done,changelist=\\\[\\\]" \
+ "update all vars: no changes on second update"

mi_gdb_test "-var-evaluate-expression lpinteger" \
"\\^done,value=\"$hex\"" \
Index: mi1-var-cmd.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi1-var-cmd.exp,v
retrieving revision 1.2
diff -u -r1.2 mi1-var-cmd.exp
--- mi1-var-cmd.exp 1 Oct 2002 16:01:37 -0000 1.2
+++ mi1-var-cmd.exp 23 Oct 2002 22:12:48 -0000
@@ -288,6 +288,18 @@
"\\^done,value=\"3333\"" \
"assign to linteger"

+mi_gdb_test "-var-update *" \
+ "\\^done,changelist=\{name=\"linteger\",in_scope=\"true\",type_changed=\"false\"\}" \
+ "update all vars: linteger changed after assign"
+
+mi_gdb_test "-var-assign linteger 3333" \
+ "\\^done,value=\"3333\"" \
+ "reassign to linteger"
+
+mi_gdb_test "-var-update *" \
+ "\\^done,changelist=\{\}" \
+ "update all vars: linteger not changed after same assign"
+
mi_gdb_test "-var-evaluate-expression linteger" \
"\\^done,value=\"3333\"" \
"eval linteger"
@@ -295,6 +307,14 @@
mi_gdb_test "-var-assign lpinteger \"&linteger + 3\"" \
"\\^done,value=\"$hex\"" \
"assign to lpinteger"
+
+mi_gdb_test "-var-update *" \
+ "\\^done,changelist=\{name=\"lpinteger\",in_scope=\"true\",type_changed=\"false\"\}" \
+ "update all vars: lpinteger changed after assign"
+
+mi_gdb_test "-var-update *" \
+ "\\^done,changelist=\{\}" \
+ "update all vars: no changes for second update"

mi_gdb_test "-var-evaluate-expression lpinteger" \
"\\^done,value=\"$hex\"" \