[RFA] Fix mi-var-child-f.exp failures

Keith Seitz
2013-07-25T23:58:27Z

Hi,

This test file contains three "new" failures which are actually not
failures. They've been failing ever since dynamic varobjs went in:

commit 8e8a4e3d9ea92ce53f8d5373b1b8865c9c92636b
Author: Tom Tromey <tromey@redhat.com>
Date: Tue Sep 15 18:51:24 2009 +0000

As a result of this commit, MI will now output a "has_more" attribute to
-var-create, -var-update, and -var-list-children. The commit caught most
of the places in the test suite where this needed to be added, but not
many of us appear to have a fortran compiler installed, so
mi-var-child-f.exp was overlooked.

I've chosen to fix as much of these tests by using standard test
procedures (mi_create_varobj and mi_list_varobj_children) when possible.

Ok?
Keith

testsuite/ChangeLog
2013-07-25 Keith Seitz <keiths@redhat.com>

* gdb.mi/mi-var-child-f.exp: Use mi_create_varobj.
Use mi_list_varobj_children for the immediate children of `array'.
Add "has_more" attribute for grandchildren test.

diff --git a/gdb/testsuite/gdb.mi/mi-var-child-f.exp
b/gdb/testsuite/gdb.mi/mi-var-child-f.exp
index 762a90d..c725871 100644
--- a/gdb/testsuite/gdb.mi/mi-var-child-f.exp
+++ b/gdb/testsuite/gdb.mi/mi-var-child-f.exp
@@ -37,14 +37,14 @@ mi_gdb_load ${binfile}

mi_runto MAIN__

-mi_gdb_test "-var-create array * array" \
- "\\^done,name=\"array\",numchild=\"3\",value=\".*\",type=\"integer
\\(2,-1:1\\)\"" \
- "create local variable array"
+mi_create_varobj "array" "array" "create local variable array"

-mi_gdb_test "-var-list-children --all-values array" \
-
"\\^done,numchild=\"3\",children=\\\[child=\{name=\"array.-1\",exp=\"-1\",numchild=\"2\",value=\"\\\[2\\\]\",type=\"integer
\\(2\\)\"\},child=\{name=\"array.0\",exp=\"0\",numchild=\"2\",value=\"\\\[2\\\]\",type=\"integer
\\(2\\)\"\},child=\{name=\"array.1\",exp=\"1\",numchild=\"2\",value=\"\\\[2\\\]\",type=\"integer
\\(2\\)\"\}\\\]" \
- "get children of array"
+mi_list_varobj_children "array" {
+ {"array.-1" "-1" 2 "integer \\(2\\)"}
+ {"array.0" "0" 2 "integer \\(2\\)"}
+ {"array.1" "1" 2 "integer \\(2\\)"}
+} "get children of array"

mi_gdb_test "-var-list-children --all-values array.-1" \
-
"\\^done,numchild=\"2\",children=\\\[child=\{name=\"array.-1.1\",exp=\"1\",numchild=\"0\",value=\"11\",type=\"integer\"\},child=\{name=\"array.-1.2\",exp=\"2\",numchild=\"0\",value=\"21\",type=\"integer\"\}\\\]"
\
+
"\\^done,numchild=\"2\",children=\\\[child=\{name=\"array.-1.1\",exp=\"1\",numchild=\"0\",value=\"11\",type=\"integer\"\},child=\{name=\"array.-1.2\",exp=\"2\",numchild=\"0\",value=\"21\",type=\"integer\"\}\\\],has_more=\"0\""
\
"get grandchildren of array (children of first element of second
index)"