Re: -var-create testsuite updates [PATCH]

Nick Roberts
2007-02-15T20:55:13Z

> > > The old tests were deliberately checking that the varobj was created
> > > with the correct type, and the new ones aren't :-(
> >
> > (Groan) I picked up the tests which were designed to fail but changed the
> > others by autopilot. I'll work my way through the changes to work out how
> > many others we should have kept and submit a new patch.

I've reverted the tests now to use mi_gdb_test and included value field in
output. I get the same test results. Where possible, I've used a specific
value in the value field of miN-var-cmd.exp and miN-var-child.exp to try to
pick up any problems with that field. In the other files I've just used a
wildcard.

--
Nick http://www.inet.net.nz/~nickrob

2007-02-16 Nick Roberts <nickrob@snap.net.nz>

* gdb.mi/mi-var-block.exp, gdb.mi/mi2-var-block.exp
* gdb.mi/mi-var-child.exp, gdb.mi/mi2-var-child.exp
* gdb.mi/mi-var-child-f.exp, gdb.mi/mi-var-cmd.exp
* gdb.mi/mi2-var-cmd.exp, gdb.mi/mi-var-display.exp
* gdb.mi/mi2-var-display.exp, gdb.mi/gdb701.exp
Revert tests to use mi_gdb_test and include value field in output
of -var-create.

Index: gdb.mi/mi-var-block.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi-var-block.exp,v
retrieving revision 1.14
diff -c -p -r1.14 mi-var-block.exp
*** gdb.mi/mi-var-block.exp 8 Feb 2007 19:51:14 -0000 1.14
--- gdb.mi/mi-var-block.exp 15 Feb 2007 20:44:18 -0000
*************** mi_runto do_block_tests
*** 44,50 ****

# Test: c_variable-3.2
# Desc: create cb and foo
! mi_create_varobj cb cb "create local variable cb"

mi_gdb_test "-var-create foo * foo" \
"&\"mi_cmd_var_create: unable to create variable object\\\\n\".*\\^error,msg=\"mi_cmd_var_create: unable to create variable object\"" \
--- 44,52 ----

# Test: c_variable-3.2
# Desc: create cb and foo
! mi_gdb_test "-var-create cb * cb" \
! "\\^done,name=\"cb\",numchild=\"0\",value=\".*\",type=\"int\"" \
! "create local variable cb"

mi_gdb_test "-var-create foo * foo" \
"&\"mi_cmd_var_create: unable to create variable object\\\\n\".*\\^error,msg=\"mi_cmd_var_create: unable to create variable object\"" \
*************** mi_gdb_test "-var-delete foo" \
*** 64,70 ****

# Test: c_variable-3.3
# Desc: create foo
! mi_create_varobj foo foo "create local variable foo"

# step to "foo2 = 123;"
mi_step_to "do_block_tests" "" "var-cmd.c" \
--- 66,74 ----

# Test: c_variable-3.3
# Desc: create foo
! mi_gdb_test "-var-create foo * foo" \
! "\\^done,name=\"foo\",numchild=\"0\",value=\".*\",type=\"int\"" \
! "create local variable foo"

# step to "foo2 = 123;"
mi_step_to "do_block_tests" "" "var-cmd.c" \
*************** mi_step_to "do_block_tests" "" "var-cmd.
*** 84,90 ****

# Test: c_variable-3.5
# Desc: create inner block foo
! mi_create_varobj inner_foo foo "create local variable inner_foo"

# step to "foo2 = 0;"
mi_step_to "do_block_tests" "" "var-cmd.c" \
--- 88,96 ----

# Test: c_variable-3.5
# Desc: create inner block foo
! mi_gdb_test "-var-create inner_foo * foo" \
! "\\^done,name=\"inner_foo\",numchild=\"0\",value=\".*\",type=\"int\"" \
! "create local variable inner_foo"

# step to "foo2 = 0;"
mi_step_to "do_block_tests" "" "var-cmd.c" \
*************** mi_step_to "do_block_tests" "" "var-cmd.
*** 93,99 ****

# Test: c_variable-3.6
# Desc: create foo2
! mi_create_varobj foo2 foo2 "create local variable foo2"

# Test: c_variable-3.7
# Desc: check that outer foo in scope and inner foo out of scope
--- 99,107 ----

# Test: c_variable-3.6
# Desc: create foo2
! mi_gdb_test "-var-create foo2 * foo2" \
! "\\^done,name=\"foo2\",numchild=\"0\",value=\".*\",type=\"int\"" \
! "create local variable foo2"

# Test: c_variable-3.7
# Desc: check that outer foo in scope and inner foo out of scope
Index: gdb.mi/mi2-var-block.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi2-var-block.exp,v
retrieving revision 1.6
diff -c -p -r1.6 mi2-var-block.exp
*** gdb.mi/mi2-var-block.exp 8 Feb 2007 19:51:14 -0000 1.6
--- gdb.mi/mi2-var-block.exp 15 Feb 2007 20:44:18 -0000
*************** mi_runto do_block_tests
*** 45,51 ****

# Test: c_variable-3.2
# Desc: create cb and foo
! mi_create_varobj cb cb "create local variable cb"

mi_gdb_test "-var-create foo * foo" \
"&\"mi_cmd_var_create: unable to create variable object\\\\n\".*\\^error,msg=\"mi_cmd_var_create: unable to create variable object\"" \
--- 45,53 ----

# Test: c_variable-3.2
# Desc: create cb and foo
! mi_gdb_test "-var-create cb * cb" \
! "\\^done,name=\"cb\",numchild=\"0\",value=\".*\",type=\"int\"" \
! "create local variable cb"

mi_gdb_test "-var-create foo * foo" \
"&\"mi_cmd_var_create: unable to create variable object\\\\n\".*\\^error,msg=\"mi_cmd_var_create: unable to create variable object\"" \
*************** mi_gdb_test "-var-delete foo" \
*** 65,71 ****

# Test: c_variable-3.3
# Desc: create foo
! mi_create_varobj foo foo "create local variable foo"

# step to "foo2 = 123;"
mi_step_to "do_block_tests" "" "var-cmd.c" \
--- 67,75 ----

# Test: c_variable-3.3
# Desc: create foo
! mi_gdb_test "-var-create foo * foo" \
! "\\^done,name=\"foo\",numchild=\"0\",value=\".*\",type=\"int\"" \
! "create local variable foo"

# step to "foo2 = 123;"
mi_step_to "do_block_tests" "" "var-cmd.c" \
*************** mi_step_to "do_block_tests" "" "var-cmd.
*** 85,91 ****

# Test: c_variable-3.5
# Desc: create inner block foo
! mi_create_varobj inner_foo foo "create local variable inner_foo"

# step to "foo2 = 0;"
mi_step_to "do_block_tests" "" "var-cmd.c" \
--- 89,97 ----

# Test: c_variable-3.5
# Desc: create inner block foo
! mi_gdb_test "-var-create inner_foo * foo" \
! "\\^done,name=\"inner_foo\",numchild=\"0\",value=\".*\",type=\"int\"" \
! "create local variable inner_foo"

# step to "foo2 = 0;"
mi_step_to "do_block_tests" "" "var-cmd.c" \
*************** mi_step_to "do_block_tests" "" "var-cmd.
*** 94,100 ****

# Test: c_variable-3.6
# Desc: create foo2
! mi_create_varobj foo2 foo2 "create local variable foo2"

# Test: c_variable-3.7
# Desc: check that outer foo in scope and inner foo out of scope
--- 100,108 ----

# Test: c_variable-3.6
# Desc: create foo2
! mi_gdb_test "-var-create foo2 * foo2" \
! "\\^done,name=\"foo2\",numchild=\"0\",value=\".*\",type=\"int\"" \
! "create local variable foo2"

# Test: c_variable-3.7
# Desc: check that outer foo in scope and inner foo out of scope
Index: gdb.mi/mi-var-child.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi-var-child.exp,v
retrieving revision 1.23
diff -c -p -r1.23 mi-var-child.exp
*** gdb.mi/mi-var-child.exp 8 Feb 2007 19:51:14 -0000 1.23
--- gdb.mi/mi-var-child.exp 15 Feb 2007 20:44:22 -0000
*************** mi_execute_to "exec-next" "end-stepping-
*** 56,63 ****

# Test: c_variable-4.2
# Desc: create variable "struct_declarations"
! mi_create_varobj struct_declarations struct_declarations \
! "create local variable struct_declarations"

# Test: c_variable-4.3
# Desc: children of struct_declarations
--- 56,64 ----

# Test: c_variable-4.2
# Desc: create variable "struct_declarations"
! mi_gdb_test "-var-create struct_declarations * struct_declarations" \
! "\\^done,name=\"struct_declarations\",numchild=\"11\",value=\"{...}\",type=\"struct _struct_decl\"" \
! "create local variable struct_declarations"

# Test: c_variable-4.3
# Desc: children of struct_declarations
*************** mi_step_to do_children_tests {} ".*${src
*** 563,569 ****

# Test: c_variable-4.81
# Desc: create local variable "weird"
! mi_create_varobj weird weird "create local variable weird"

# Test: c_variable-4.82
# Desc: children of weird
--- 564,572 ----

# Test: c_variable-4.81
# Desc: create local variable "weird"
! mi_gdb_test "-var-create weird * weird" \
! "\\^done,name=\"weird\",numchild=\"11\",value=\"$hex\",type=\"weird_struct \\*\"" \
! "create local variable weird"

# Test: c_variable-4.82
# Desc: children of weird
*************** mi_gdb_test "-var-info-num-children weir
*** 625,632 ****

# Test: c_variable-4.90
# Desc: create weird->int_ptr_ptr
! mi_create_varobj weird->int_ptr_ptr weird->int_ptr_ptr \
! "create local variable weird->int_ptr_ptr"

# Test: c_variable-4.91
# Desc: children of weird->int_ptr_ptr
--- 628,636 ----

# Test: c_variable-4.90
# Desc: create weird->int_ptr_ptr
! mi_gdb_test "-var-create weird->int_ptr_ptr * weird->int_ptr_ptr" \
! "\\^done,name=\"weird->int_ptr_ptr\",numchild=\"1\",value=\"$hex\",type=\"int \\*\\*\"" \
! "create local variable weird->int_ptr_ptr"

# Test: c_variable-4.91
# Desc: children of weird->int_ptr_ptr
*************** mi_execute_to "exec-step 43" "end-steppi
*** 890,897 ****

# Test: c_variable-5.10
# Desc: create psnp->char_ptr
! mi_create_varobj psnp->char_ptr psnp->char_ptr \
! "create local variable psnp->char_ptr"

# Test: c_variable-5.11
# Desc: children of psnp->char_ptr
--- 894,902 ----

# Test: c_variable-5.10
# Desc: create psnp->char_ptr
! mi_gdb_test "-var-create psnp->char_ptr * psnp->char_ptr" \
! "\\^done,name=\"psnp->char_ptr\",numchild=\"1\",value=\".*\",type=\"char \\*\\*\\*\\*\"" \
! "create local variable psnp->char_ptr"

# Test: c_variable-5.11
# Desc: children of psnp->char_ptr
*************** mi_gdb_test "-var-info-num-children psnp
*** 962,969 ****

# Test: c_variable-5.19
# Desc: create psnp->long_ptr
! mi_create_varobj psnp->long_ptr psnp->long_ptr \
! "create local variable psnp->long_ptr"

# Test: c_variable-5.20
# Desc: children of psnp->long_ptr
--- 967,975 ----

# Test: c_variable-5.19
# Desc: create psnp->long_ptr
! mi_gdb_test "-var-create psnp->long_ptr * psnp->long_ptr" \
! "\\^done,name=\"psnp->long_ptr\",numchild=\"1\",value=\"$hex\",type=\"long int \\*\\*\\*\\*\"" \
! "create local variable psnp->long_ptr"

# Test: c_variable-5.20
# Desc: children of psnp->long_ptr
*************** mi_gdb_test "-var-info-num-children psnp
*** 1028,1034 ****

# Test: c_variable-5.30
# Desc: create psnp->ptrs
! mi_create_varobj psnp->ptrs psnp->ptrs "create local variable psnp->ptrs"

# Test: c_variable-5.31
# Desc: children of psnp->ptrs
--- 1034,1042 ----

# Test: c_variable-5.30
# Desc: create psnp->ptrs
! mi_gdb_test "-var-create psnp->ptrs * psnp->ptrs" \
! "\\^done,name=\"psnp->ptrs\",numchild=\"3\",value=\"\\\[3\\\]\",type=\"struct _struct_n_pointer \\*\\\[3\\\]\"" \
! "create local variable psnp->ptrs"

# Test: c_variable-5.31
# Desc: children of psnp->ptrs
Index: gdb.mi/mi2-var-child.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi2-var-child.exp,v
retrieving revision 1.5
diff -c -p -r1.5 mi2-var-child.exp
*** gdb.mi/mi2-var-child.exp 8 Feb 2007 19:51:14 -0000 1.5
--- gdb.mi/mi2-var-child.exp 15 Feb 2007 20:44:26 -0000
*************** mi_runto do_children_tests
*** 51,58 ****

# Test: c_variable-4.2
# Desc: create variable "struct_declarations"
! mi_create_varobj struct_declarations struct_declarations \
! "create local variable struct_declarations"

# Test: c_variable-4.3
# Desc: children of struct_declarations
--- 51,59 ----

# Test: c_variable-4.2
# Desc: create variable "struct_declarations"
! mi_gdb_test "-var-create struct_declarations * struct_declarations" \
! "\\^done,name=\"struct_declarations\",numchild=\"11\",value=\"{...}\",type=\"struct _struct_decl\"" \
! "create local variable struct_declarations"

# Test: c_variable-4.3
# Desc: children of struct_declarations
*************** mi_step_to do_children_tests {} {.*var-c
*** 558,564 ****

# Test: c_variable-4.81
# Desc: create local variable "weird"
! mi_create_varobj weird weird "create local variable weird"

# Test: c_variable-4.82
# Desc: children of weird
--- 559,567 ----

# Test: c_variable-4.81
# Desc: create local variable "weird"
! mi_gdb_test "-var-create weird * weird" \
! "\\^done,name=\"weird\",numchild=\"11\",value=\"$hex\",type=\"weird_struct \\*\"" \
! "create local variable weird"

# Test: c_variable-4.82
# Desc: children of weird
*************** mi_gdb_test "-var-info-num-children weir
*** 620,627 ****

# Test: c_variable-4.90
# Desc: create weird->int_ptr_ptr
! mi_create_varobj weird->int_ptr_ptr weird->int_ptr_ptr \
! "create local variable weird->int_ptr_ptr"

# Test: c_variable-4.91
# Desc: children of weird->int_ptr_ptr
--- 623,631 ----

# Test: c_variable-4.90
# Desc: create weird->int_ptr_ptr
! mi_gdb_test "-var-create weird->int_ptr_ptr * weird->int_ptr_ptr" \
! "\\^done,name=\"weird->int_ptr_ptr\",numchild=\"1\",value=\"$hex\",type=\"int \\*\\*\"" \
! "create local variable weird->int_ptr_ptr"

# Test: c_variable-4.91
# Desc: children of weird->int_ptr_ptr
*************** mi_execute_to "exec-step 43" "end-steppi
*** 861,868 ****

# Test: c_variable-5.10
# Desc: create psnp->char_ptr
! mi_create_varobj psnp->char_ptr psnp->char_ptr \
! "create local variable psnp->char_ptr"

# Test: c_variable-5.11
# Desc: children of psnp->char_ptr
--- 865,873 ----

# Test: c_variable-5.10
# Desc: create psnp->char_ptr
! mi_gdb_test "-var-create psnp->char_ptr * psnp->char_ptr" \
! "\\^done,name=\"psnp->char_ptr\",numchild=\"1\",value=\".*\",type=\"char \\*\\*\\*\\*\"" \
! "create local variable psnp->char_ptr"

# Test: c_variable-5.11
# Desc: children of psnp->char_ptr
*************** mi_gdb_test "-var-info-num-children psnp
*** 933,940 ****

# Test: c_variable-5.19
# Desc: create psnp->long_ptr
! mi_create_varobj psnp->long_ptr psnp->long_ptr \
! "create local variable psnp->long_ptr"

# Test: c_variable-5.20
# Desc: children of psnp->long_ptr
--- 938,946 ----

# Test: c_variable-5.19
# Desc: create psnp->long_ptr
! mi_gdb_test "-var-create psnp->long_ptr * psnp->long_ptr" \
! "\\^done,name=\"psnp->long_ptr\",numchild=\"1\",value=\"$hex\",type=\"long int \\*\\*\\*\\*\"" \
! "create local variable psnp->long_ptr"

# Test: c_variable-5.20
# Desc: children of psnp->long_ptr
*************** mi_gdb_test "-var-info-num-children psnp
*** 999,1006 ****

# Test: c_variable-5.30
# Desc: create psnp->ptrs
! mi_create_varobj psnp->ptrs psnp->ptrs "create local variable psnp->ptrs"
!

# Test: c_variable-5.31
# Desc: children of psnp->ptrs
--- 1005,1013 ----

# Test: c_variable-5.30
# Desc: create psnp->ptrs
! mi_gdb_test "-var-create psnp->ptrs * psnp->ptrs" \
! "\\^done,name=\"psnp->ptrs\",numchild=\"3\",value=\"\\\[3\\\]\",type=\"struct _struct_n_pointer \\*\\\[3\\\]\"" \
! "create local variable psnp->ptrs"

# Test: c_variable-5.31
# Desc: children of psnp->ptrs
Index: gdb.mi/mi-var-child-f.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi-var-child-f.exp,v
retrieving revision 1.5
diff -c -p -r1.5 mi-var-child-f.exp
*** gdb.mi/mi-var-child-f.exp 8 Feb 2007 19:51:14 -0000 1.5
--- gdb.mi/mi-var-child-f.exp 15 Feb 2007 20:44:26 -0000
*************** mi_gdb_load ${binfile}
*** 38,44 ****

mi_runto MAIN__

! 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\\)\"\}\\\]" \
--- 38,46 ----

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_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\\)\"\}\\\]" \
Index: gdb.mi/mi-var-cmd.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi-var-cmd.exp,v
retrieving revision 1.25
diff -c -p -r1.25 mi-var-cmd.exp
*** gdb.mi/mi-var-cmd.exp 8 Feb 2007 19:51:14 -0000 1.25
--- gdb.mi/mi-var-cmd.exp 15 Feb 2007 20:44:27 -0000
*************** mi_gdb_load ${binfile}
*** 52,58 ****
# Desc: Create global variable

mi_gdb_test "111-var-create global_simple * global_simple" \
! "111\\^done,name=\"global_simple\",numchild=\"6\",value=\".*\",type=\"simpleton\"" \
"create global variable"

# Test: c_variable-1.2
--- 52,58 ----
# Desc: Create global variable

mi_gdb_test "111-var-create global_simple * global_simple" \
! "111\\^done,name=\"global_simple\",numchild=\"6\",value=\"{...}\",type=\"simpleton\"" \
"create global variable"

# Test: c_variable-1.2
*************** mi_runto do_locals_tests
*** 74,116 ****
# Test: c_variable-1.4
# Desc: create local variables

! mi_create_varobj linteger linteger "create local variable linteger"
!
! mi_create_varobj lpinteger lpinteger "create local variable lpinteger"
!
! mi_create_varobj lcharacter lcharacter "create local variable lcharacter"
!
! mi_create_varobj lpcharacter lpcharacter "create local variable lpcharacter"
!
! mi_create_varobj llong llong "create local variable llong"
!
! mi_create_varobj lplong lplong "create local variable lplong"
!
! mi_create_varobj lfloat lfloat "create local variable lfloat"
!
! mi_create_varobj lpfloat lpfloat "create local variable lpfloat"
!
! mi_create_varobj ldouble ldouble "create local variable ldouble"
!
! mi_create_varobj lpdouble lpdouble "create local variable lpdouble"
!
! mi_create_varobj lsimple lsimple "create local variable lsimple"
!
! mi_create_varobj lpsimple lpsimple "create local variable lpsimple"

! mi_create_varobj func func "create local variable func"

# Test: c_variable-1.5
# Desc: create lsimple.character
! mi_create_varobj lsimple.character lsimple.character "create lsimple.character"

# Test: c_variable-1.6
# Desc: create lpsimple->integer
! mi_create_varobj lsimple->integer lsimple->integer "create lsimple->integer"

# Test: c_variable-1.7
# Desc: ceate lsimple.integer
! mi_create_varobj lsimple.integer lsimple.integer "create lsimple->integer"

# Test: c_variable-1.9
# Desc: create type name
--- 74,149 ----
# Test: c_variable-1.4
# Desc: create local variables

! mi_gdb_test "-var-create linteger * linteger" \
! "\\^done,name=\"linteger\",numchild=\"0\",value=\".*\",type=\"int\"" \
! "create local variable linteger"

! mi_gdb_test "-var-create lpinteger * lpinteger" \
! "\\^done,name=\"lpinteger\",numchild=\"1\",value=\"$hex\",type=\"int \\*\"" \
! "create local variable lpinteger"
!
! mi_gdb_test "-var-create lcharacter * lcharacter" \
! "\\^done,name=\"lcharacter\",numchild=\"0\",value=\".*\",type=\"char\"" \
! "create local variablelcharacter "
!
! mi_gdb_test "-var-create lpcharacter * lpcharacter" \
! "\\^done,name=\"lpcharacter\",numchild=\"1\",value=\"$hex \\\\\".*\\\\\"\",type=\"char \\*\"" \
! "create local variable lpcharacter"
!
! mi_gdb_test "-var-create llong * llong" \
! "\\^done,name=\"llong\",numchild=\"0\",value=\".*\",type=\"long int\"" \
! "create local variable llong"
!
! mi_gdb_test "-var-create lplong * lplong" \
! "\\^done,name=\"lplong\",numchild=\"1\",value=\"$hex\",type=\"long int \\*\"" \
! "create local variable lplong"
!
! mi_gdb_test "-var-create lfloat * lfloat" \
! "\\^done,name=\"lfloat\",numchild=\"0\",value=\".*\",type=\"float\"" \
! "create local variable lfloat"
!
! mi_gdb_test "-var-create lpfloat * lpfloat" \
! "\\^done,name=\"lpfloat\",numchild=\"1\",value=\"$hex\",type=\"float \\*\"" \
! "create local variable lpfloat"
!
! mi_gdb_test "-var-create ldouble * ldouble" \
! "\\^done,name=\"ldouble\",numchild=\"0\",value=\".*\",type=\"double\"" \
! "create local variable ldouble"
!
! mi_gdb_test "-var-create lpdouble * lpdouble" \
! "\\^done,name=\"lpdouble\",numchild=\"1\",value=\"$hex\",type=\"double \\*\"" \
! "create local variable lpdouble"
!
! mi_gdb_test "-var-create lsimple * lsimple" \
! "\\^done,name=\"lsimple\",numchild=\"6\",value=\"{...}\",type=\"struct _simple_struct\"" \
! "create local variable lsimple"
!
! mi_gdb_test "-var-create lpsimple * lpsimple" \
! "\\^done,name=\"lpsimple\",numchild=\"6\",value=\"$hex\",type=\"struct _simple_struct \\*\"" \
! "create local variable lpsimple"
!
! mi_gdb_test "-var-create func * func" \
! "\\^done,name=\"func\",numchild=\"0\",value=\"$hex\",type=\"void \\(\\*\\)\\((void|)\\)\"" \
! "create local variable func"

# Test: c_variable-1.5
# Desc: create lsimple.character
! mi_gdb_test "-var-create lsimple.character * lsimple.character" \
! "\\^done,name=\"lsimple.character\",numchild=\"0\",value=\".*\",type=\"char\"" \
! "create lsimple.character"

# Test: c_variable-1.6
# Desc: create lpsimple->integer
! mi_gdb_test "-var-create lsimple->integer * lsimple->integer" \
! "\\^done,name=\"lsimple->integer\",numchild=\"0\",value=\".*\",type=\"int\"" \
! "create lsimple->integer"

# Test: c_variable-1.7
# Desc: ceate lsimple.integer
! mi_gdb_test "-var-create lsimple.integer * lsimple.integer" \
! "\\^done,name=\"lsimple.integer\",numchild=\"0\",value=\".*\",type=\"int\"" \
! "create lsimple->integer"
!

# Test: c_variable-1.9
# Desc: create type name
*************** mi_gdb_test "-var-update *" \
*** 370,376 ****
"\\^done,changelist=\\\[\\\]" \
"assign same value to func (update)"

! mi_create_varobj array_ptr array_ptr "create global variable array_ptr"

mi_gdb_test "-var-assign array_ptr array2" \
"\\^done,value=\"$hex\"" \
--- 403,411 ----
"\\^done,changelist=\\\[\\\]" \
"assign same value to func (update)"

! mi_gdb_test "-var-create array_ptr * array_ptr" \
! "\\^done,name=\"array_ptr\",numchild=\"1\",value=\"$hex\",type=\"int \\*\"" \
! "create global variable array_ptr"

mi_gdb_test "-var-assign array_ptr array2" \
"\\^done,value=\"$hex\"" \
*************** mi_continue_to subroutine1
*** 399,407 ****

# Test: c_variable-2.10
# Desc: create variable for locals i,l in subroutine1
! mi_create_varobj i i "create i"
!
! mi_create_varobj l l "create l"

# Test: c_variable-2.11
# Desc: create do_locals_tests local in subroutine1
--- 434,446 ----

# Test: c_variable-2.10
# Desc: create variable for locals i,l in subroutine1
! mi_gdb_test "-var-create i * i" \
! "\\^done,name=\"i\",numchild=\"0\",value=\"4321\",type=\"int\"" \
! "create i"
!
! mi_gdb_test "-var-create l * l" \
! "\\^done,name=\"l\",numchild=\"1\",value=\"$hex\",type=\"long int \\*\"" \
! "create l"

# Test: c_variable-2.11
# Desc: create do_locals_tests local in subroutine1
*************** mi_gdb_test "-var-update selected_a" \
*** 556,562 ****

# A varobj we fail to read during -var-update should be considered
# out of scope.
! mi_create_varobj null_ptr **0 "create null_ptr"

# Allow this to succeed, if address zero is readable, although it
# will not test what it was meant to. Most important is that GDB
--- 595,603 ----

# A varobj we fail to read during -var-update should be considered
# out of scope.
! mi_gdb_test "-var-create null_ptr * **0" \
! {\^done,name="null_ptr",numchild="0",value=".*",type="int"} \
! "create null_ptr"

# Allow this to succeed, if address zero is readable, although it
# will not test what it was meant to. Most important is that GDB
*************** mi_gdb_test "kill" \
*** 579,585 ****
{&"kill\\n".*\^done} \
"kill program before endvar"

! mi_create_varobj endvar _end "create endvar"

# Allow this to succeed whether the value is readable, unreadable, or
# missing. Most important is that GDB does not crash.
--- 620,628 ----
{&"kill\\n".*\^done} \
"kill program before endvar"

! mi_gdb_test "-var-create endvar * _end" \
! {(\^done,name="endvar",numchild="0",value=".*",type=".*"|&".*unable to.*".*\^error,msg=".*")} \
! "create endvar"

# Allow this to succeed whether the value is readable, unreadable, or
# missing. Most important is that GDB does not crash.
Index: gdb.mi/mi2-var-display.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi2-var-display.exp,v
retrieving revision 1.9
diff -c -p -r1.9 mi2-var-display.exp
*** gdb.mi/mi2-var-display.exp 8 Feb 2007 19:51:14 -0000 1.9
--- gdb.mi/mi2-var-display.exp 15 Feb 2007 20:44:29 -0000
*************** gdb_expect {
*** 65,71 ****

# Test: c_variable-6.1
# Desc: create variable bar
! mi_create_varobj bar bar "create local variable bar"

# Test: c_variable-6.2
# Desc: type of variable bar
--- 65,73 ----

# Test: c_variable-6.1
# Desc: create variable bar
! mi_gdb_test "-var-create bar * bar" \
! "\\^done,name=\"bar\",numchild=\"0\",value=\".*\",type=\"int\"" \
! "create local variable bar"

# Test: c_variable-6.2
# Desc: type of variable bar
*************** mi_gdb_test "-var-delete bar" \
*** 117,123 ****

# Test: c_variable-6.11
# Desc: create variable foo
! mi_create_varobj foo foo "create local variable foo"

# Test: c_variable-6.12
# Desc: type of variable foo
--- 119,127 ----

# Test: c_variable-6.11
# Desc: create variable foo
! mi_gdb_test "-var-create foo * foo" \
! "\\^done,name=\"foo\",numchild=\"1\",value=\".*\",type=\"int \\*\"" \
! "create local variable foo"

# Test: c_variable-6.12
# Desc: type of variable foo
*************** mi_gdb_test "-var-delete foo" \
*** 175,181 ****

# Test: c_variable-6.21
# Desc: create variable weird and children
! mi_create_varobj weird weird "create local variable weird"

mi_gdb_test "-var-list-children weird" \
"\\^done,numchild=\"11\",children=\\\[child=\{name=\"weird.integer\",exp=\"integer\",numchild=\"0\",type=\"int\"\},child=\{name=\"weird.character\",exp=\"character\",numchild=\"0\",type=\"char\"\},child={name=\"weird.char_ptr\",exp=\"char_ptr\",numchild=\"1\",type=\"char \\*\"\},child=\{name=\"weird.long_int\",exp=\"long_int\",numchild=\"0\",type=\"long int\"\},child=\{name=\"weird.int_ptr_ptr\",exp=\"int_ptr_ptr\",numchild=\"1\",type=\"int \\*\\*\"\},child=\{name=\"weird.long_array\",exp=\"long_array\",numchild=\"10\",type=\"long int \\\[10\\\]\"\},child=\{name=\"weird.func_ptr\",exp=\"func_ptr\",numchild=\"0\",type=\"void \\(\\*\\)\\((void|)\\)\"\},child=\{name=\"weird.func_ptr_struct\",exp=\"func_ptr_struct\",numchild=\"0\",type=\"struct _struct_decl \\(\\*\\)\\((int, char \\*, long int|)\\)\"\},child=\{name=\"weird.func_ptr_ptr\",exp=\"func_ptr_ptr\",numchild=\"0\",type=\"struct _struct_decl \\*\\(\\*\\)\\((int, char \\*, long int|)\\)\"\},child=\{name=\"weird.u1\",exp=\"u1\",numchild=\"4\",type=\"union \{\\.\\.\\.\}\"\},child=\{name=\"weird.s2\",exp=\"s2\",numchild=\"4\",type=\"struct \{\\.\\.\\.\}\"\}\\\]" \
--- 179,187 ----

# Test: c_variable-6.21
# Desc: create variable weird and children
! mi_gdb_test "-var-create weird * weird" \
! "\\^done,name=\"weird\",numchild=\"11\",value=\".*\",type=\"weird_struct \\*\"" \
! "create local variable weird"

mi_gdb_test "-var-list-children weird" \
"\\^done,numchild=\"11\",children=\\\[child=\{name=\"weird.integer\",exp=\"integer\",numchild=\"0\",type=\"int\"\},child=\{name=\"weird.character\",exp=\"character\",numchild=\"0\",type=\"char\"\},child={name=\"weird.char_ptr\",exp=\"char_ptr\",numchild=\"1\",type=\"char \\*\"\},child=\{name=\"weird.long_int\",exp=\"long_int\",numchild=\"0\",type=\"long int\"\},child=\{name=\"weird.int_ptr_ptr\",exp=\"int_ptr_ptr\",numchild=\"1\",type=\"int \\*\\*\"\},child=\{name=\"weird.long_array\",exp=\"long_array\",numchild=\"10\",type=\"long int \\\[10\\\]\"\},child=\{name=\"weird.func_ptr\",exp=\"func_ptr\",numchild=\"0\",type=\"void \\(\\*\\)\\((void|)\\)\"\},child=\{name=\"weird.func_ptr_struct\",exp=\"func_ptr_struct\",numchild=\"0\",type=\"struct _struct_decl \\(\\*\\)\\((int, char \\*, long int|)\\)\"\},child=\{name=\"weird.func_ptr_ptr\",exp=\"func_ptr_ptr\",numchild=\"0\",type=\"struct _struct_decl \\*\\(\\*\\)\\((int, char \\*, long int|)\\)\"\},child=\{name=\"weird.u1\",exp=\"u1\",numchild=\"4\",type=\"union \{\\.\\.\\.\}\"\},child=\{name=\"weird.s2\",exp=\"s2\",numchild=\"4\",type=\"struct \{\\.\\.\\.\}\"\}\\\]" \
*************** gdb_expect {
*** 338,344 ****

# Test: c_variable-7.10
# Desc: create union u
! mi_create_varobj u u "create local variable u"

# Test: c_variable-7.11
# Desc: value of u
--- 344,352 ----

# Test: c_variable-7.10
# Desc: create union u
! mi_gdb_test "-var-create u * u" \
! "\\^done,name=\"u\",numchild=\"2\",value=\".*\",type=\"union named_union\"" \
! "create local variable u"

# Test: c_variable-7.11
# Desc: value of u
*************** mi_gdb_test "-var-list-children u" \
*** 372,378 ****

# Test: c_variable-7.20
# Desc: create anonu
! mi_create_varobj anonu anonu "create local variable anonu"

# Test: c_variable-7.21
# Desc: value of anonu
--- 380,388 ----

# Test: c_variable-7.20
# Desc: create anonu
! mi_gdb_test "-var-create anonu * anonu" \
! "\\^done,name=\"anonu\",numchild=\"3\",value=\".*\",type=\"union \{\\.\\.\\.\}\"" \
! "create local variable anonu"

# Test: c_variable-7.21
# Desc: value of anonu
*************** mi_gdb_test "-var-list-children anonu" \
*** 406,412 ****

# Test: c_variable-7.30
# Desc: create struct s
! mi_create_varobj s s "create local variable s"

# Test: c_variable-7.31
# Desc: value of s
--- 416,425 ----

# Test: c_variable-7.30
# Desc: create struct s
! mi_gdb_test "-var-create s * s" \
! "\\^done,name=\"s\",numchild=\"6\",value=\".*\",type=\"struct _simple_struct\"" \
! "create local variable s"
!

# Test: c_variable-7.31
# Desc: value of s
*************** mi_gdb_test "-var-list-children s" \
*** 441,447 ****

# Test: c_variable-7.40
# Desc: create anons
! mi_create_varobj anons anons "create local variable anons"

# Test: c_variable-7.41
# Desc: value of anons
--- 454,462 ----

# Test: c_variable-7.40
# Desc: create anons
! mi_gdb_test "-var-create anons * anons" \
! "\\^done,name=\"anons\",numchild=\"3\",value=\".*\",type=\"struct \{\\.\\.\\.\}\"" \
! "create local variable anons"

# Test: c_variable-7.41
# Desc: value of anons
*************** mi_gdb_test "-var-list-children anons" \
*** 476,482 ****

# Test: c_variable-7.50
# Desc: create enum e
! mi_create_varobj e e "create local variable e"

setup_xfail "*-*-*"
# Test: c_variable-7.51
--- 491,499 ----

# Test: c_variable-7.50
# Desc: create enum e
! mi_gdb_test "-var-create e * e" \
! "\\^done,name=\"e\",numchild=\"0\",value=\".*\",type=\"enum foo\"" \
! "create local variable e"

setup_xfail "*-*-*"
# Test: c_variable-7.51
*************** mi_gdb_test "-var-list-children e" \
*** 512,518 ****

# Test: c_variable-7.60
# Desc: create anone
! mi_create_varobj anone anone "create local variable anone"

setup_xfail "*-*-*"
# Test: c_variable-7.61
--- 529,537 ----

# Test: c_variable-7.60
# Desc: create anone
! mi_gdb_test "-var-create anone * anone" \
! "\\^done,name=\"anone\",numchild=\"0\",value=\".*\",type=\"enum \{\\.\\.\\.\}\"" \
! "create local variable anone"

setup_xfail "*-*-*"
# Test: c_variable-7.61
*************** gdb_expect {
*** 591,597 ****

# Test: c_variable-7.81
# Desc: Create variables in different scopes
! mi_create_varobj a1 a "create local variable a1"

mi_gdb_test "-var-create a2 $fp a" \
"\\^done,name=\"a2\",numchild=\"0\",value=\".*\",type=\"int\"" \
--- 610,618 ----

# Test: c_variable-7.81
# Desc: Create variables in different scopes
! mi_gdb_test "-var-create a1 * a" \
! "\\^done,name=\"a1\",numchild=\"0\",value=\".*\",type=\"char\"" \
! "create local variable a1"

mi_gdb_test "-var-create a2 $fp a" \
"\\^done,name=\"a2\",numchild=\"0\",value=\".*\",type=\"int\"" \
Index: gdb.mi/gdb701.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/gdb701.exp,v
retrieving revision 1.4
diff -c -p -r1.4 gdb701.exp
*** gdb.mi/gdb701.exp 8 Feb 2007 19:51:14 -0000 1.4
--- gdb.mi/gdb701.exp 15 Feb 2007 20:44:29 -0000
*************** mi_run_to_main
*** 50,56 ****
# Step over "foo = 0"
mi_next "step over \"foo = 0\""

! mi_create_varobj fooPtr foo "create fooPtr"

mi_gdb_test "-var-list-children fooPtr" \
"(&\".*\"\r\n)*\\^done,numchild=\"3\",.*" \
--- 50,58 ----
# Step over "foo = 0"
mi_next "step over \"foo = 0\""

! mi_gdb_test "-var-create fooPtr * foo" \
! "(&\".*\"\r\n)*\\^done,name=\"fooPtr\",numchild=\"3\",value=\".*\",type=\"Foo \\*\"" \
! "create fooPtr"

mi_gdb_test "-var-list-children fooPtr" \
"(&\".*\"\r\n)*\\^done,numchild=\"3\",.*" \