aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gdb/testsuite/ChangeLog20
-rw-r--r--gdb/testsuite/gdb.mi/gdb701.exp4
-rw-r--r--gdb/testsuite/gdb.mi/gdb792.exp83
-rw-r--r--gdb/testsuite/gdb.mi/mi-var-block.exp20
-rw-r--r--gdb/testsuite/gdb.mi/mi-var-child.exp537
-rw-r--r--gdb/testsuite/gdb.mi/mi-var-cmd.exp79
-rw-r--r--gdb/testsuite/gdb.mi/mi-var-display.exp95
-rw-r--r--gdb/testsuite/gdb.mi/mi-var-invalidate.exp8
-rw-r--r--gdb/testsuite/gdb.mi/mi2-var-block.exp16
-rw-r--r--gdb/testsuite/gdb.mi/mi2-var-child.exp502
-rw-r--r--gdb/testsuite/gdb.mi/mi2-var-cmd.exp79
-rw-r--r--gdb/testsuite/gdb.mi/mi2-var-display.exp95
-rw-r--r--gdb/testsuite/lib/mi-support.exp49
13 files changed, 728 insertions, 859 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index e353733..408a7cb 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,23 @@
+2008-03-26 Vladimir Prus <vladimir@codesourcery.com>
+
+ * lib/mi-support.exp (mi_create_varobj_checked): New.
+ (mi_list_varobj_children): Allow to check for a
+ value.
+ (mi_list_array_varobj_children): New.
+
+ * gdb.mi/mi-var-child.exp: Use mi_create_varobj
+ and mi_list_varobj_children, as opposed to hardcoding
+ expected strings.
+ * gdb.mi/gdb701.exp: Likewise.
+ * gdb.mi/gdb792.exp: Likewise.
+ * gdb.mi/mi-var-block.exp: Likewise.
+ * gdb.mi/mi-var-cmd.exp: Likewise.
+ * gdb.mi/mi-var-invalidate.exp: Likewise.
+ * gdb.mi/mi2-var-block.exp: Likewise.
+ * gdb.mi/mi2-var-child.exp: Likewise.
+ * gdb.mi/mi2-var-cmd.exp: Likewise.
+ * gdb.mi/mi2-var-display.exp: Likewise.
+
2008-03-24 Jan Kratochvil <jan.kratochvil@redhat.com>
Fix random false FAILs on i386.
diff --git a/gdb/testsuite/gdb.mi/gdb701.exp b/gdb/testsuite/gdb.mi/gdb701.exp
index 3e000bd..18a187b 100644
--- a/gdb/testsuite/gdb.mi/gdb701.exp
+++ b/gdb/testsuite/gdb.mi/gdb701.exp
@@ -49,9 +49,7 @@ mi_run_to_main
# 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_create_varobj "fooPtr" "foo" "create fooPtr"
mi_gdb_test "-var-list-children fooPtr" \
"(&\".*\"\r\n)*\\^done,numchild=\"3\",.*" \
diff --git a/gdb/testsuite/gdb.mi/gdb792.exp b/gdb/testsuite/gdb.mi/gdb792.exp
index 0088280..652e616 100644
--- a/gdb/testsuite/gdb.mi/gdb792.exp
+++ b/gdb/testsuite/gdb.mi/gdb792.exp
@@ -48,45 +48,50 @@ if {[gdb_compile $srcdir/$subdir/$srcfile $binfile executable {debug c++}] != ""
# Run to main
mi_run_to_main
-mi_gdb_test "-var-create - * a" \
- "(&\".*\"\r\n)*\\^done,name=\"var1\",numchild=\"3\",value=\".*\",type=\"A\"" \
- "create var for class A"
-
-mi_gdb_test "-var-list-children var1" \
- "(&\".*\"\r\n)*\\^done,numchild=\"3\",children=\\\[child=\{name=\"var1\.public\",exp=\"public\",numchild=\"2\"\},child=\{name=\"var1\.private\",exp=\"private\",numchild=\"2\"\},child=\{name=\"var1\.protected\",exp=\"protected\",numchild=\"2\"\}\\\]" \
- "list children of class A"
-
-mi_gdb_test "-var-list-children var1.public" \
- "(&\".*\"\r\n)*\\^done,numchild=\"2\",children=\\\[child=\{name=\"var1\.public\.x\",exp=\"x\",numchild=\"0\",type=\"int\"\},child=\{name=\"var1\.public\.buffer\",exp=\"buffer\",numchild=\"10\",type=\"char \\\[10\\\]\"\}\\\]" \
- "list children of A.public"
-
-mi_gdb_test "-var-list-children var1.private" \
- "(&\".*\"\r\n)*\\^done,numchild=\"2\",children=\\\[child=\{name=\"var1\.private\.u\",exp=\"u\",numchild=\"0\",type=\"int\"\},child=\{name=\"var1\.private\.z\",exp=\"z\",numchild=\"0\",type=\"float\"\}\\\]" \
- "list children of A.private"
-
-mi_gdb_test "-var-list-children var1.protected" \
- "(&\".*\"\r\n)*\\^done,numchild=\"2\",children=\\\[child=\{name=\"var1\.protected\.y\",exp=\"y\",numchild=\"0\",type=\"int\"\},child=\{name=\"var1\.protected\.b\",exp=\"b\",numchild=\"2\",type=\"B\"\}\\\]" \
- "list children of A.protected"
-
-mi_gdb_test "-var-list-children var1.protected.b" \
- "(&\".*\"\r\n)*\\^done,numchild=\"2\",children=\\\[child=\{name=\"var1\.protected\.b\.public\",exp=\"public\",numchild=\"2\"\},child=\{name=\"var1\.protected\.b\.private\",exp=\"private\",numchild=\"1\"\}\\\]" \
- "list children of A.protected.b"
-
-mi_gdb_test "-var-list-children var1.protected.b.public" \
- "(&\".*\"\r\n)*\\^done,numchild=\"2\",children=\\\[child=\{name=\"var1\.protected\.b\.public\.bx\",exp=\"bx\",numchild=\"0\",type=\"int\"\},child=\{name=\"var1\.protected\.b\.public\.by\",exp=\"by\",numchild=\"0\",type=\"int\"\}\\\]" \
- "list children of A.protected.b.public"
-
-mi_gdb_test "-var-list-children var1.protected.b.private" \
- "(&\".*\"\r\n)*\\^done,numchild=\"1\",children=\\\[child=\{name=\"var1\.protected\.b\.private\.k\",exp=\"k\",numchild=\"0\",type=\"int\"\}\\\]" \
- "list children of A.protected.b.private"
-
-mi_gdb_test "-var-create - * c" \
- "(&\".*\"\r\n)*\\^done,name=\"var2\",numchild=\"3\",value=\".*\",type=\"C\"" \
- "create var for class C which has baseclass A"
-
-mi_gdb_test "-var-list-children var2" \
- "(&\".*\"\r\n)*\\^done,numchild=\"3\",children=\\\[child=\{name=\"var2\.A\",exp=\"A\",numchild=\"3\",type=\"A\"\},child=\{name=\"var2\.public\",exp=\"public\",numchild=\"1\"\},child=\{name=\"var2\.private\",exp=\"private\",numchild=\"1\"\}\\\]" \
- "list children of class C"
+mi_create_varobj "var1" "a" "create var for class A"
+
+mi_list_varobj_children "var1" {
+ {var1.public public 2}
+ {var1.private private 2}
+ {var1.protected protected 2}
+} "list children of class A"
+
+mi_list_varobj_children "var1.public" {
+ {var1.public.x x 0 int}
+ {var1.public.buffer buffer 10 {char \[10\]}}
+} "list children of A.public"
+
+mi_list_varobj_children "var1.private" {
+ {var1.private.u u 0 int}
+ {var1.private.z z 0 float}
+} "list children of A.private"
+
+mi_list_varobj_children "var1.protected" {
+ {var1.protected.y y 0 int}
+ {var1.protected.b b 2 B}
+} "list children of A.protected"
+
+mi_list_varobj_children "var1.protected.b" {
+ {var1.protected.b.public public 2}
+ {var1.protected.b.private private 1}
+} "list children of A.protected.b"
+
+mi_list_varobj_children "var1.protected.b.public" {
+ {var1.protected.b.public.bx bx 0 int}
+ {var1.protected.b.public.by by 0 int}
+} "list children of A.protected.b.public"
+
+mi_list_varobj_children "var1.protected.b.private" {
+ {var1.protected.b.private.k k 0 int}
+} "list children of A.protected.b.private"
+
+mi_create_varobj "var2" "c" "create var for class C which has baseclass A"
+
+mi_list_varobj_children "var2" {
+ {var2.A A 3 A}
+ {var2.public public 1}
+ {var2.private private 1}
+} "list children of class C"
mi_gdb_exit
return 0
diff --git a/gdb/testsuite/gdb.mi/mi-var-block.exp b/gdb/testsuite/gdb.mi/mi-var-block.exp
index b46dc37..5fff551 100644
--- a/gdb/testsuite/gdb.mi/mi-var-block.exp
+++ b/gdb/testsuite/gdb.mi/mi-var-block.exp
@@ -44,13 +44,11 @@ mi_runto do_block_tests
# 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_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\"" \
- "create local variable foo"
+ "&\"mi_cmd_var_create: unable to create variable object\\\\n\".*\\^error,msg=\"mi_cmd_var_create: unable to create variable object\"" \
+ "try to create local variable foo"
# step to "foo = 123;"
mi_step_to "do_block_tests" "" "var-cmd.c" \
@@ -66,9 +64,7 @@ mi_gdb_test "-var-delete foo" \
# 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"
+mi_create_varobj "foo" "foo" "create local variable foo"
# step to "foo2 = 123;"
mi_step_to "do_block_tests" "" "var-cmd.c" \
@@ -88,9 +84,7 @@ mi_step_to "do_block_tests" "" "var-cmd.c" \
# 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"
+mi_create_varobj "inner_foo" "foo" "create local variable inner_foo"
# step to "foo2 = 0;"
mi_step_to "do_block_tests" "" "var-cmd.c" \
@@ -99,9 +93,7 @@ mi_step_to "do_block_tests" "" "var-cmd.c" \
# 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"
+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
diff --git a/gdb/testsuite/gdb.mi/mi-var-child.exp b/gdb/testsuite/gdb.mi/mi-var-child.exp
index bdb7a1a..29aaf7d 100644
--- a/gdb/testsuite/gdb.mi/mi-var-child.exp
+++ b/gdb/testsuite/gdb.mi/mi-var-child.exp
@@ -54,17 +54,28 @@ mi_continue_to_line $line_dlt_first_real "step to real start of do_children_test
# 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\"" \
+mi_create_varobj "struct_declarations" "struct_declarations" \
"create local variable struct_declarations"
# Test: c_variable-4.3
# Desc: children of struct_declarations
# STABS doesn't give us argument types for the func ptr structs, but
# Dwarf 2 does.
-mi_gdb_test "-var-list-children struct_declarations" \
- "\\^done,numchild=\"11\",children=\\\[child=\{name=\"struct_declarations.integer\",exp=\"integer\",numchild=\"0\",type=\"int\"\},child=\{name=\"struct_declarations.character\",exp=\"character\",numchild=\"0\",type=\"char\"\},child={name=\"struct_declarations.char_ptr\",exp=\"char_ptr\",numchild=\"1\",type=\"char \\*\"\},child=\{name=\"struct_declarations.long_int\",exp=\"long_int\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.int_ptr_ptr\",exp=\"int_ptr_ptr\",numchild=\"1\",type=\"int \\*\\*\"\},child=\{name=\"struct_declarations.long_array\",exp=\"long_array\",numchild=\"12\",type=\"long int \\\[12\\\]\"\},child=\{name=\"struct_declarations.func_ptr\",exp=\"func_ptr\",numchild=\"0\",type=\"void \\(\\*\\)\\((void)?\\)\"\},child=\{name=\"struct_declarations.func_ptr_struct\",exp=\"func_ptr_struct\",numchild=\"0\",type=\"struct _struct_decl \\(\\*\\)\\((int, char \\*, long int)?\\)\"\},child=\{name=\"struct_declarations.func_ptr_ptr\",exp=\"func_ptr_ptr\",numchild=\"0\",type=\"struct _struct_decl \\*\\(\\*\\)\\((int, char \\*, long int)?\\)\"\},child=\{name=\"struct_declarations.u1\",exp=\"u1\",numchild=\"4\",type=\"union \{\\.\\.\\.\}\"\},child=\{name=\"struct_declarations.s2\",exp=\"s2\",numchild=\"4\",type=\"struct \{\\.\\.\\.\}\"\}\\\]" \
- "get children of struct_declarations"
+mi_list_varobj_children "struct_declarations" {
+ {struct_declarations.integer integer 0 int}
+ {struct_declarations.character character 0 char}
+ {struct_declarations.char_ptr char_ptr 1 "char \\*"}
+ {struct_declarations.long_int long_int 0 "long int"}
+ {struct_declarations.int_ptr_ptr int_ptr_ptr 1 "int \\*\\*"}
+ {struct_declarations.long_array long_array 12 "long int \\[12\\]"}
+ {struct_declarations.func_ptr func_ptr 0 "void \\(\\*\\)\\((void)?\\)"}
+ {struct_declarations.func_ptr_struct func_ptr_struct 0 \
+ "struct _struct_decl \\(\\*\\)(\\(int, char \\*, long int\\))?"}
+ {struct_declarations.func_ptr_ptr func_ptr_ptr 0 \
+ "struct _struct_decl \\*\\(\\*\\)\\((int, char \\*, long int)?\\)"}
+ {struct_declarations.u1 u1 4 "union \\{\\.\\.\\.\\}"}
+ {struct_declarations.s2 s2 4 "struct \\{\\.\\.\\.\\}"}
+} "get children of struct_declarations"
#gdbtk_test c_variable-4.3 {children of struct_declarations} {
# get_children struct_declarations
@@ -78,9 +89,8 @@ mi_gdb_test "-var-info-num-children struct_declarations" \
# Test: c_variable-4.5
# Desc: children of struct_declarations.integer
-mi_gdb_test "-var-list-children struct_declarations.integer" \
- "\\^done,numchild=\"0\"" \
- "get children of struct_declarations.integer"
+mi_list_varobj_children "struct_declarations.integer" {} \
+ "get children of struct_declarations.integer"
# Test: c_variable-4.6
# Desc: number of children of struct_declarations.integer
@@ -90,8 +100,7 @@ mi_gdb_test "-var-info-num-children struct_declarations.integer" \
# Test: c_variable-4.7
# Desc: children of struct_declarations.character
-mi_gdb_test "-var-list-children struct_declarations.character" \
- "\\^done,numchild=\"0\"" \
+mi_list_varobj_children "struct_declarations.character" {} \
"get children of struct_declarations.character"
# Test: c_variable-4.8
@@ -102,9 +111,9 @@ mi_gdb_test "-var-info-num-children struct_declarations.character" \
# Test: c_variable-4.9
# Desc: children of struct_declarations.char_ptr
-mi_gdb_test "-var-list-children struct_declarations.char_ptr" \
- "\\^done,numchild=\"1\",children=\\\[child=\{name=\"struct_declarations.char_ptr.\\*char_ptr\",exp=\"\\*char_ptr\",numchild=\"0\",type=\"char\"\}\\\]" \
- "get children of struct_declarations.char_ptr"
+mi_list_varobj_children "struct_declarations.char_ptr" {
+ {{struct_declarations.char_ptr.\*char_ptr} {\*char_ptr} 0 char}
+} "get children of struct_declarations.char_ptr"
# Test: c_variable-4.10
# Desc: number of children of struct_declarations.char_ptr
@@ -114,8 +123,7 @@ mi_gdb_test "-var-info-num-children struct_declarations.char_ptr" \
# Test: c_variable-4.11
# Desc: children of struct_declarations.long_int
-mi_gdb_test "-var-list-children struct_declarations.long_int" \
- "\\^done,numchild=\"0\"" \
+mi_list_varobj_children "struct_declarations.long_int" {} \
"get children of struct_declarations.long_int"
# Test: c_variable-4.12
@@ -126,9 +134,9 @@ mi_gdb_test "-var-info-num-children struct_declarations.long_int" \
# Test: c_variable-4.13
# Desc: children of int_ptr_ptr
-mi_gdb_test "-var-list-children struct_declarations.int_ptr_ptr" \
- "\\^done,numchild=\"1\",children=\\\[child=\{name=\"struct_declarations.int_ptr_ptr.\\*int_ptr_ptr\",exp=\"\\*int_ptr_ptr\",numchild=\"1\",type=\"int \\*\"\}\\\]" \
- "get children of struct_declarations.int_ptr_ptr"
+mi_list_varobj_children "struct_declarations.int_ptr_ptr" {
+ {{struct_declarations.int_ptr_ptr.\*int_ptr_ptr} {\*int_ptr_ptr} 1 {int \*}}
+} "get children of struct_declarations.int_ptr_ptr"
#gdbtk_test c_variable-4.13 {children of int_ptr_ptr} {
# get_children struct_declarations.int_ptr_ptr
@@ -143,9 +151,8 @@ mi_gdb_test "-var-info-num-children struct_declarations.int_ptr_ptr" \
# Test: c_variable-4.15
# Desc: children of struct_declarations.long_array
-mi_gdb_test "-var-list-children struct_declarations.long_array" \
- "\\^done,numchild=\"12\",children=\\\[child=\{name=\"struct_declarations.long_array.0\",exp=\"0\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.long_array.1\",exp=\"1\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.long_array.2\",exp=\"2\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.long_array.3\",exp=\"3\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.long_array.4\",exp=\"4\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.long_array.5\",exp=\"5\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.long_array.6\",exp=\"6\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.long_array.7\",exp=\"7\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.long_array.8\",exp=\"8\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.long_array.9\",exp=\"9\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.long_array.10\",exp=\"10\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.long_array.11\",exp=\"11\",numchild=\"0\",type=\"long int\"\}\\\]" \
- "get children of struct_declarations.long_array"
+mi_list_array_varobj_children "struct_declarations.long_array" 12 "long int" \
+ "get children of struct_declarations.long_array"
# Test: c_variable-4.16
# Desc: number of children of struct_declarations.long_array
@@ -155,11 +162,9 @@ mi_gdb_test "-var-info-num-children struct_declarations.long_array" \
# Test: c_variable-4.17
# Desc: children of struct_declarations.func_ptr
-mi_gdb_test "-var-list-children struct_declarations.func_ptr" \
- "\\^done,numchild=\"0\"" \
+mi_list_varobj_children "struct_declarations.func_ptr" {} \
"get children of struct_declarations.func_ptr"
-
# Test: c_variable-4.18
# Desc: number of children of struct_declarations.func_ptr
mi_gdb_test "-var-info-num-children struct_declarations.func_ptr" \
@@ -169,8 +174,7 @@ mi_gdb_test "-var-info-num-children struct_declarations.func_ptr" \
# Test: c_variable-4.19
# Desc: children of struct_declarations.func_ptr_struct
-mi_gdb_test "-var-list-children struct_declarations.func_ptr_struct" \
- "\\^done,numchild=\"0\"" \
+mi_list_varobj_children "struct_declarations.func_ptr_struct" {} \
"get children of struct_declarations.func_ptr_struct"
# Test: c_variable-4.20
@@ -182,22 +186,23 @@ mi_gdb_test "-var-info-num-children struct_declarations.func_ptr_struct" \
# Test: c_variable-4.21
# Desc: children of struct_declarations.func_ptr_ptr
-mi_gdb_test "-var-list-children struct_declarations.func_ptr_ptr" \
- "\\^done,numchild=\"0\"" \
+mi_list_varobj_children "struct_declarations.func_ptr_ptr" {} \
"get children of struct_declarations.func_ptr_ptr"
# Test: c_variable-4.22
# Desc: number of children of struct_declarations.func_ptr_ptr
mi_gdb_test "-var-info-num-children struct_declarations.func_ptr_ptr" \
- "\\^done,numchild=\"0\"" \
- "get number of children of struct_declarations.func_ptr_ptr"
-
+ "\\^done,numchild=\"0\"" \
+ "get number of children of struct_declarations.func_ptr_ptr"
# Test: c_variable-4.23
# Desc: children of struct_declarations.u1
-mi_gdb_test "-var-list-children struct_declarations.u1" \
- "\\^done,numchild=\"4\",children=\\\[child=\{name=\"struct_declarations.u1.a\",exp=\"a\",numchild=\"0\",type=\"int\"\},child=\{name=\"struct_declarations.u1.b\",exp=\"b\",numchild=\"1\",type=\"char \\*\"\},child=\{name=\"struct_declarations.u1.c\",exp=\"c\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.u1.d\",exp=\"d\",numchild=\"0\",type=\"enum foo\"\}\\\]" \
- "get children of struct_declarations.u1"
+mi_list_varobj_children "struct_declarations.u1" {
+ {struct_declarations.u1.a a 0 int}
+ {struct_declarations.u1.b b 1 {char \*}}
+ {struct_declarations.u1.c c 0 {long int}}
+ {struct_declarations.u1.d d 0 {enum foo}}
+} "get children of struct_declarations.u1"
# Test: c_variable-4.24
# Desc: number of children of struct_declarations.u1
@@ -207,9 +212,13 @@ mi_gdb_test "-var-info-num-children struct_declarations.u1" \
# Test: c_variable-4.25
# Desc: children of struct_declarations.s2
-mi_gdb_test "-var-list-children struct_declarations.s2" \
- "\\^done,numchild=\"4\",children=\\\[child=\{name=\"struct_declarations.s2.u2\",exp=\"u2\",numchild=\"3\",type=\"union \{\\.\\.\\.\}\"\},child=\{name=\"struct_declarations.s2.g\",exp=\"g\",numchild=\"0\",type=\"int\"\},child=\{name=\"struct_declarations.s2.h\",exp=\"h\",numchild=\"0\",type=\"char\"\},child=\{name=\"struct_declarations.s2.i\",exp=\"i\",numchild=\"10\",type=\"long int \\\[10\\\]\"\}\\\]" \
- "get children of struct_declarations.s2"
+mi_list_varobj_children "struct_declarations.s2" {
+ {struct_declarations.s2.u2 u2 3 {union \{\.\.\.\}}}
+ {struct_declarations.s2.g g 0 int}
+ {struct_declarations.s2.h h 0 char}
+ {struct_declarations.s2.i i 10 {long int \[10\]}}
+} "get children of struct_declarations.s2"
+
#gdbtk_test c_variable-4.25 {children of struct_declarations.s2} {
# get_children struct_declarations.s2
#} {u2 g h i}
@@ -221,119 +230,18 @@ mi_gdb_test "-var-info-num-children struct_declarations.s2" \
"get number of children of struct_declarations.s2"
-# Test: c_variable-4.27
-# Desc: children of struct_declarations.long_array.1
-mi_gdb_test "-var-list-children struct_declarations.long_array.1" \
- "\\^done,numchild=\"0\"" \
- "get children of struct_declarations.long_array.1"
-
-# Test: c_variable-4.28
-# Desc: number of children of struct_declarations.long_array.1
-mi_gdb_test "-var-info-num-children struct_declarations.long_array.1" \
- "\\^done,numchild=\"0\"" \
- "get number of children of struct_declarations.long_array.1"
-
-# Test: c_variable-4.29
-# Desc: children of struct_declarations.long_array.2
-mi_gdb_test "-var-list-children struct_declarations.long_array.2" \
- "\\^done,numchild=\"0\"" \
- "get children of struct_declarations.long_array.2"
-
-# Test: c_variable-4.30
-# Desc: number of children of struct_declarations.long_array.2
-mi_gdb_test "-var-info-num-children struct_declarations.long_array.2" \
- "\\^done,numchild=\"0\"" \
- "get number of children of struct_declarations.long_array.2"
-
-# Test: c_variable-4.31
-# Desc: children of struct_declarations.long_array.3
-mi_gdb_test "-var-list-children struct_declarations.long_array.3" \
- "\\^done,numchild=\"0\"" \
- "get children of struct_declarations.long_array.3"
+for {set i 1} {$i <= 9} {incr i} {
+ mi_list_varobj_children "struct_declarations.long_array.$i" {} \
+ "get children of struct_declarations.long_array.$i"
-# Test: c_variable-4.32
-# Desc: number of children of struct_declarations.long_array.3
-mi_gdb_test "-var-info-num-children struct_declarations.long_array.3" \
+ mi_gdb_test "-var-info-num-children struct_declarations.long_array.$i" \
"\\^done,numchild=\"0\"" \
- "get number of children of struct_declarations.long_array.3"
-
-# Test: c_variable-4.33
-# Desc: children of struct_declarations.long_array.4
-mi_gdb_test "-var-list-children struct_declarations.long_array.4" \
- "\\^done,numchild=\"0\"" \
- "get children of struct_declarations.long_array.4"
-
-# Test: c_variable-4.34
-# Desc: number of children of struct_declarations.long_array.4
-mi_gdb_test "-var-info-num-children struct_declarations.long_array.4" \
- "\\^done,numchild=\"0\"" \
- "get number of children of struct_declarations.long_array.4"
-
-# Test: c_variable-4.35
-# Desc: children of struct_declarations.long_array.5
-mi_gdb_test "-var-list-children struct_declarations.long_array.5" \
- "\\^done,numchild=\"0\"" \
- "get children of struct_declarations.long_array.5"
-
-# Test: c_variable-4.36
-# Desc: number of children of struct_declarations.long_array.5
-mi_gdb_test "-var-info-num-children struct_declarations.long_array.5" \
- "\\^done,numchild=\"0\"" \
- "get number of children of struct_declarations.long_array.5"
-
-# Test: c_variable-4.37
-# Desc: children of struct_declarations.long_array.6
-mi_gdb_test "-var-list-children struct_declarations.long_array.6" \
- "\\^done,numchild=\"0\"" \
- "get children of struct_declarations.long_array.6"
-
-# Test: c_variable-4.38
-# Desc: number of children of struct_declarations.long_array.6
-mi_gdb_test "-var-info-num-children struct_declarations.long_array.6" \
- "\\^done,numchild=\"0\"" \
- "get number of children of struct_declarations.long_array.6"
-
-# Test: c_variable-4.39
-# Desc: children of struct_declarations.long_array.7
-mi_gdb_test "-var-list-children struct_declarations.long_array.7" \
- "\\^done,numchild=\"0\"" \
- "get children of struct_declarations.long_array.7"
-
-# Test: c_variable-4.40
-# Desc: number of children of struct_declarations.long_array.7
-mi_gdb_test "-var-info-num-children struct_declarations.long_array.7" \
- "\\^done,numchild=\"0\"" \
- "get number of children of struct_declarations.long_array.7"
-
-# Test: c_variable-4.41
-# Desc: children of struct_declarations.long_array.8
-mi_gdb_test "-var-list-children struct_declarations.long_array.8" \
- "\\^done,numchild=\"0\"" \
- "get children of struct_declarations.long_array.8"
-
-# Test: c_variable-4.42
-# Desc: number of children of struct_declarations.long_array.8
-mi_gdb_test "-var-info-num-children struct_declarations.long_array.8" \
- "\\^done,numchild=\"0\"" \
- "get number of children of struct_declarations.long_array.8"
-
-
-# Test: c_variable-4.43
-# Desc: children of struct_declarations.long_array.9
-mi_gdb_test "-var-list-children struct_declarations.long_array.9" \
- "\\^done,numchild=\"0\"" \
- "get children of struct_declarations.long_array.9"
-
-# Test: c_variable-4.44
-# Desc: number of children of struct_declarations.long_array.9
-mi_gdb_test "-var-info-num-children struct_declarations.long_array.9" \
- "\\^done,numchild=\"0\"" \
- "get number of children of struct_declarations.long_array.9"
+ "get number of children of struct_declarations.long_array.$i"
+}
# Test: c_variable-4.45
# Desc: children of struct_declarations.u1.a
-mi_gdb_test "-var-list-children struct_declarations.u1.a" \
- "\\^done,numchild=\"0\"" \
+mi_list_varobj_children "struct_declarations.u1.a" {} \
"get children of struct_declarations.u1.a"
# Test: c_variable-4.46
@@ -344,9 +252,9 @@ mi_gdb_test "-var-info-num-children struct_declarations.u1.a" \
# Test: c_variable-4.47
# Desc: children of struct_declarations.u1.b
-mi_gdb_test "-var-list-children struct_declarations.u1.b" \
- "\\^done,numchild=\"1\",children=\\\[child=\{name=\"struct_declarations.u1.b.\\*b\",exp=\"\\*b\",numchild=\"0\",type=\"char\"\}\\\]" \
- "get children of struct_declarations.u1.b"
+mi_list_varobj_children "struct_declarations.u1.b" {
+ {{struct_declarations.u1.b.\*b} {\*b} 0 char}
+} "get children of struct_declarations.u1.b"
# Test: c_variable-4.48
# Desc: number of children of struct_declarations.u1.b
@@ -356,8 +264,7 @@ mi_gdb_test "-var-info-num-children struct_declarations.u1.b" \
# Test: c_variable-4.49
# Desc: children of struct_declarations.u1.c
-mi_gdb_test "-var-list-children struct_declarations.u1.c" \
- "\\^done,numchild=\"0\"" \
+mi_list_varobj_children "struct_declarations.u1.c" {} \
"get children of struct_declarations.u1.c"
# Test: c_variable-4.50
@@ -368,8 +275,7 @@ mi_gdb_test "-var-info-num-children struct_declarations.u1.c" \
# Test: c_variable-4.51
# Desc: children of struct_declarations.u1.d
-mi_gdb_test "-var-list-children struct_declarations.u1.d" \
- "\\^done,numchild=\"0\"" \
+mi_list_varobj_children "struct_declarations.u1.d" {} \
"get children of struct_declarations.u1.d"
@@ -382,9 +288,11 @@ mi_gdb_test "-var-info-num-children struct_declarations.u1.d" \
# Test: c_variable-4.53
# Desc: children of struct_declarations.s2.u2
-mi_gdb_test "-var-list-children struct_declarations.s2.u2" \
- "\\^done,numchild=\"3\",children=\\\[child=\{name=\"struct_declarations.s2.u2.u1s1\",exp=\"u1s1\",numchild=\"4\",type=\"struct \{\\.\\.\\.\}\"\},child=\{name=\"struct_declarations.s2.u2.f\",exp=\"f\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.s2.u2.u1s2\",exp=\"u1s2\",numchild=\"2\",type=\"struct \{\\.\\.\\.\}\"\}\\\]" \
- "get children of struct_declarations.s2.u2"
+mi_list_varobj_children "struct_declarations.s2.u2" {
+ {"struct_declarations.s2.u2.u1s1" "u1s1" 4 {struct \{\.\.\.\}}}
+ {struct_declarations.s2.u2.f f 0 "long int"}
+ {struct_declarations.s2.u2.u1s2 u1s2 2 {struct \{\.\.\.\}}}
+} "get children of struct_declarations.s2.u2"
# Test: c_variable-4.54
# Desc: number of children of struct_declarations.s2.u2
@@ -394,8 +302,7 @@ mi_gdb_test "-var-info-num-children struct_declarations.s2.u2" \
# Test: c_variable-4.55
# Desc: children of struct_declarations.s2.g
-mi_gdb_test "-var-list-children struct_declarations.s2.g" \
- "\\^done,numchild=\"0\"" \
+mi_list_varobj_children struct_declarations.s2.g {} \
"get children of struct_declarations.s2.g"
# Test: c_variable-4.56
@@ -407,8 +314,7 @@ mi_gdb_test "-var-info-num-children struct_declarations.s2.g" \
# Test: c_variable-4.57
# Desc: children of struct_declarations.s2.h
-mi_gdb_test "-var-list-children struct_declarations.s2.h" \
- "\\^done,numchild=\"0\"" \
+mi_list_varobj_children struct_declarations.s2.h {} \
"get children of struct_declarations.s2.h"
# Test: c_variable-4.58
@@ -420,8 +326,11 @@ mi_gdb_test "-var-info-num-children struct_declarations.s2.h" \
# Test: c_variable-4.59
# Desc: children of struct_declarations.s2.i
-mi_gdb_test "-var-list-children struct_declarations.s2.i" \
- "\\^done,numchild=\"10\",children=\\\[child=\{name=\"struct_declarations.s2.i.0\",exp=\"0\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.s2.i.1\",exp=\"1\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.s2.i.2\",exp=\"2\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.s2.i.3\",exp=\"3\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.s2.i.4\",exp=\"4\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.s2.i.5\",exp=\"5\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.s2.i.6\",exp=\"6\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.s2.i.7\",exp=\"7\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.s2.i.8\",exp=\"8\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.s2.i.9\",exp=\"9\",numchild=\"0\",type=\"long int\"\}\\\]" \
+set t {}
+for {set i 0} {$i < 10} {incr i} {
+ lappend t [list struct_declarations.s2.i.$i $i 0 "long int"]
+}
+mi_list_varobj_children struct_declarations.s2.i $t \
"get children of struct_declarations.s2.i"
# Test: c_variable-4.60
@@ -432,9 +341,12 @@ mi_gdb_test "-var-info-num-children struct_declarations.s2.i" \
# Test: c_variable-4.61
# Desc: children of struct_declarations.s2.u2.u1s1
-mi_gdb_test "-var-list-children struct_declarations.s2.u2.u1s1" \
- "\\^done,numchild=\"4\",children=\\\[child=\{name=\"struct_declarations.s2.u2.u1s1.d\",exp=\"d\",numchild=\"0\",type=\"int\"\},child=\{name=\"struct_declarations.s2.u2.u1s1.e\",exp=\"e\",numchild=\"10\",type=\"char \\\[10\\\]\"\},child=\{name=\"struct_declarations.s2.u2.u1s1.func\",exp=\"func\",numchild=\"0\",type=\"int \\*\\(\\*\\)\\((void)?\\)\"\},child=\{name=\"struct_declarations.s2.u2.u1s1.foo\",exp=\"foo\",numchild=\"0\",type=\"efoo\"\}\\\]" \
- "get children of struct_declarations.s2.u2.u1s1"
+mi_list_varobj_children struct_declarations.s2.u2.u1s1 {
+ {struct_declarations.s2.u2.u1s1.d d 0 int}
+ {struct_declarations.s2.u2.u1s1.e e 10 {char \[10\]}}
+ {struct_declarations.s2.u2.u1s1.func func 0 {int \*\(\*\)\((void)?\)}}
+ {struct_declarations.s2.u2.u1s1.foo foo 0 efoo}
+} "get children of struct_declarations.s2.u2.u1s1"
# Test: c_variable-4.62
# Desc: number of children of struct_declarations.s2.u2.u1s1
@@ -444,8 +356,7 @@ mi_gdb_test "-var-info-num-children struct_declarations.s2.u2.u1s1" \
# Test: c_variable-4.63
# Desc: children of struct_declarations.s2.u2.f
-mi_gdb_test "-var-list-children struct_declarations.s2.u2.f" \
- "\\^done,numchild=\"0\"" \
+mi_list_varobj_children struct_declarations.s2.u2.f {} \
"get children of struct_declarations.s2.u2.f"
# Test: c_variable-4.64
@@ -456,9 +367,10 @@ mi_gdb_test "-var-info-num-children struct_declarations.s2.u2.f" \
# Test: c_variable-4.65
# Desc: children of struct_declarations.s2.u2.u1s2
-mi_gdb_test "-var-list-children struct_declarations.s2.u2.u1s2" \
- "\\^done,numchild=\"2\",children=\\\[child=\{name=\"struct_declarations.s2.u2.u1s2.array_ptr\",exp=\"array_ptr\",numchild=\"2\",type=\"char \\\[2\\\]\"\},child=\{name=\"struct_declarations.s2.u2.u1s2.func\",exp=\"func\",numchild=\"0\",type=\"int \\(\\*\\)\\((int, char \\*)?\\)\"\}\\\]" \
- "get children of struct_declarations.s2.u2.u1s2"
+mi_list_varobj_children struct_declarations.s2.u2.u1s2 {
+ {struct_declarations.s2.u2.u1s2.array_ptr array_ptr 2 {char \[2\]}}
+ {struct_declarations.s2.u2.u1s2.func func 0 {int \(\*\)\((int, char \*)?\)}}
+} "get children of struct_declarations.s2.u2.u1s2"
# Test: c_variable-4.66
# Desc: number of children of struct_declarations.s2.u2.u1s2
@@ -468,8 +380,7 @@ mi_gdb_test "-var-info-num-children struct_declarations.s2.u2.u1s2" \
# Test: c_variable-4.67
# Desc: children of struct_declarations.s2.u2.u1s1.d
-mi_gdb_test "-var-list-children struct_declarations.s2.u2.u1s1.d" \
- "\\^done,numchild=\"0\"" \
+mi_list_varobj_children struct_declarations.s2.u2.u1s1.d {} \
"get children of struct_declarations.s2.u2.u1s1.d"
# Test: c_variable-4.68
@@ -480,8 +391,11 @@ mi_gdb_test "-var-info-num-children struct_declarations.s2.u2.u1s1.d" \
# Test: c_variable-4.69
# Desc: children of struct_declarations.s2.u2.u1s1.e
-mi_gdb_test "-var-list-children struct_declarations.s2.u2.u1s1.e" \
- "\\^done,numchild=\"10\",children=\\\[child=\{name=\"struct_declarations.s2.u2.u1s1.e.0\",exp=\"0\",numchild=\"0\",type=\"char\"\},child=\{name=\"struct_declarations.s2.u2.u1s1.e.1\",exp=\"1\",numchild=\"0\",type=\"char\"\},child=\{name=\"struct_declarations.s2.u2.u1s1.e.2\",exp=\"2\",numchild=\"0\",type=\"char\"\},child={name=\"struct_declarations.s2.u2.u1s1.e.3\",exp=\"3\",numchild=\"0\",type=\"char\"\},child=\{name=\"struct_declarations.s2.u2.u1s1.e.4\",exp=\"4\",numchild=\"0\",type=\"char\"\},child=\{name=\"struct_declarations.s2.u2.u1s1.e.5\",exp=\"5\",numchild=\"0\",type=\"char\"\},child=\{name=\"struct_declarations.s2.u2.u1s1.e.6\",exp=\"6\",numchild=\"0\",type=\"char\"\},child=\{name=\"struct_declarations.s2.u2.u1s1.e.7\",exp=\"7\",numchild=\"0\",type=\"char\"\},child=\{name=\"struct_declarations.s2.u2.u1s1.e.8\",exp=\"8\",numchild=\"0\",type=\"char\"\},child=\{name=\"struct_declarations.s2.u2.u1s1.e.9\",exp=\"9\",numchild=\"0\",type=\"char\"\}\\\]" \
+set t {}
+for {set i 0} {$i < 10} {incr i} {
+ lappend t [list struct_declarations.s2.u2.u1s1.e.$i $i 0 char]
+}
+mi_list_varobj_children struct_declarations.s2.u2.u1s1.e $t \
"get children of struct_declarations.s2.u2.u1s1.e"
# Test: c_variable-4.70
@@ -493,8 +407,7 @@ mi_gdb_test "-var-info-num-children struct_declarations.s2.u2.u1s1.e" \
# Test: c_variable-4.71
# Desc: children of struct_declarations.s2.u2.u1s1.func
-mi_gdb_test "-var-list-children struct_declarations.s2.u2.u1s1.func" \
- "\\^done,numchild=\"0\"" \
+mi_list_varobj_children struct_declarations.s2.u2.u1s1.func {} \
"get children of struct_declarations.s2.u2.u1s1.func"
# Test: c_variable-4.72
@@ -506,8 +419,7 @@ mi_gdb_test "-var-info-num-children struct_declarations.s2.u2.u1s1.func" \
# Test: c_variable-4.73
# Desc: children of struct_declarations.s2.u2.u1s1.foo
-mi_gdb_test "-var-list-children struct_declarations.s2.u2.u1s1.foo" \
- "\\^done,numchild=\"0\"" \
+mi_list_varobj_children struct_declarations.s2.u2.u1s1.foo {} \
"get children of struct_declarations.s2.u2.u1s1.foo"
# Test: c_variable-4.74
@@ -519,9 +431,10 @@ mi_gdb_test "-var-info-num-children struct_declarations.s2.u2.u1s1.foo" \
# Test: c_variable-4.75
# Desc: children of struct_declarations.s2.u2.u1s2.array_ptr
-mi_gdb_test "-var-list-children struct_declarations.s2.u2.u1s2.array_ptr" \
- "\\^done,numchild=\"2\",children=\\\[child=\{name=\"struct_declarations.s2.u2.u1s2.array_ptr.0\",exp=\"0\",numchild=\"0\",type=\"char\"\},child={name=\"struct_declarations.s2.u2.u1s2.array_ptr.1\",exp=\"1\",numchild=\"0\",type=\"char\"\}\\\]" \
- "get children of struct_declarations.s2.u2.u1s2.array_ptr"
+mi_list_varobj_children struct_declarations.s2.u2.u1s2.array_ptr {
+ {struct_declarations.s2.u2.u1s2.array_ptr.0 0 0 char}
+ {struct_declarations.s2.u2.u1s2.array_ptr.1 1 0 char}
+} "get children of struct_declarations.s2.u2.u1s2.array_ptr"
# Test: c_variable-4.76
# Desc: number of children of struct_declarations.s2.u2.u1s2.array_ptr
@@ -531,8 +444,7 @@ mi_gdb_test "-var-info-num-children struct_declarations.s2.u2.u1s2.array_ptr" \
# Test: c_variable-4.77
# Desc: children of struct_declarations.s2.u2.u1s2.func
-mi_gdb_test "-var-list-children struct_declarations.s2.u2.u1s2.func" \
- "\\^done,numchild=\"0\"" \
+mi_list_varobj_children struct_declarations.s2.u2.u1s2.func {} \
"get children of struct_declarations.s2.u2.u1s2.func"
# Test: c_variable-4.78
@@ -543,10 +455,10 @@ mi_gdb_test "-var-info-num-children struct_declarations.s2.u2.u1s2.func" \
# Test: c_variable-4.79
# Desc: children of struct_declarations.int_ptr_ptr.*int_ptr_ptr
-mi_gdb_test "-var-list-children struct_declarations.int_ptr_ptr.*int_ptr_ptr" \
- "\\^done,numchild=\"1\",children=\\\[child=\{name=\"struct_declarations.int_ptr_ptr.\\*int_ptr_ptr.\\*\\*int_ptr_ptr\",exp=\"\\*\\*int_ptr_ptr\",numchild=\"0\",type=\"int\"\}\\\]" \
- "get children of struct_declarations.int_ptr_ptr.*int_ptr_ptr"
-#} {**int_ptr_ptr}
+mi_list_varobj_children "struct_declarations.int_ptr_ptr.*int_ptr_ptr" {
+ {{struct_declarations.int_ptr_ptr.\*int_ptr_ptr.\*\*int_ptr_ptr} \
+ {\*\*int_ptr_ptr} 0 int}
+} "get children of struct_declarations.int_ptr_ptr.*int_ptr_ptr"
# Test: c_variable-4.80
# Desc: Number of children of struct_declarations.int_ptr_ptr.*int_ptr_ptr
@@ -562,15 +474,25 @@ mi_step_to do_children_tests {} ".*${srcfile}" \
# 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"
+mi_create_varobj weird weird "create local variable weird"
# Test: c_variable-4.82
# Desc: children of 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=\"12\",type=\"long int \\\[12\\\]\"\},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 \{\\.\\.\\.\}\"\}\\\]" \
- "get children of weird"
+mi_list_varobj_children "weird" {
+ {weird.integer integer 0 int}
+ {weird.character character 0 char}
+ {weird.char_ptr char_ptr 1 "char \\*"}
+ {weird.long_int long_int 0 "long int"}
+ {weird.int_ptr_ptr int_ptr_ptr 1 "int \\*\\*"}
+ {weird.long_array long_array 12 "long int \\[12\\]"}
+ {weird.func_ptr func_ptr 0 "void \\(\\*\\)\\((void)?\\)"}
+ {weird.func_ptr_struct func_ptr_struct 0 \
+ "struct _struct_decl \\(\\*\\)(\\(int, char \\*, long int\\))?"}
+ {weird.func_ptr_ptr func_ptr_ptr 0 \
+ "struct _struct_decl \\*\\(\\*\\)\\((int, char \\*, long int)?\\)"}
+ {weird.u1 u1 4 "union \\{\\.\\.\\.\\}"}
+ {weird.s2 s2 4 "struct \\{\\.\\.\\.\\}"}
+} "get children of weird"
# Test: c_variable-4.83
# Desc: number of children of weird
@@ -581,8 +503,7 @@ mi_gdb_test "-var-info-num-children weird" \
# Test: c_variable-4.84
# Desc: children of weird->long_array
-mi_gdb_test "-var-list-children weird.long_array" \
- "\\^done,numchild=\"12\",children=\\\[child=\{name=\"weird.long_array.0\",exp=\"0\",numchild=\"0\",type=\"long int\"\},child=\{name=\"weird.long_array.1\",exp=\"1\",numchild=\"0\",type=\"long int\"\},child=\{name=\"weird.long_array.2\",exp=\"2\",numchild=\"0\",type=\"long int\"\},child=\{name=\"weird.long_array.3\",exp=\"3\",numchild=\"0\",type=\"long int\"\},child=\{name=\"weird.long_array.4\",exp=\"4\",numchild=\"0\",type=\"long int\"\},child=\{name=\"weird.long_array.5\",exp=\"5\",numchild=\"0\",type=\"long int\"\},child=\{name=\"weird.long_array.6\",exp=\"6\",numchild=\"0\",type=\"long int\"\},child=\{name=\"weird.long_array.7\",exp=\"7\",numchild=\"0\",type=\"long int\"\},child=\{name=\"weird.long_array.8\",exp=\"8\",numchild=\"0\",type=\"long int\"\},child=\{name=\"weird.long_array.9\",exp=\"9\",numchild=\"0\",type=\"long int\"\},child=\{name=\"weird.long_array.10\",exp=\"10\",numchild=\"0\",type=\"long int\"\},child=\{name=\"weird.long_array.11\",exp=\"11\",numchild=\"0\",type=\"long int\"\}\\\]" \
+mi_list_array_varobj_children weird.long_array 12 "long int" \
"get children of weird.long_array"
#gdbtk_test c_variable-4.84 {children of weird->long_array} {
# get_children weird.long_array
@@ -596,9 +517,9 @@ mi_gdb_test "-var-info-num-children weird.long_array" \
# Test: c_variable-4.86
# Desc: children of weird.int_ptr_ptr
-mi_gdb_test "-var-list-children weird.int_ptr_ptr" \
- "\\^done,numchild=\"1\",children=\\\[child=\{name=\"weird.int_ptr_ptr.\\*int_ptr_ptr\",exp=\"\\*int_ptr_ptr\",numchild=\"1\",type=\"int \\*\"\}\\\]" \
- "get children of weird.int_ptr_ptr"
+mi_list_varobj_children weird.int_ptr_ptr {
+ {{weird.int_ptr_ptr.\*int_ptr_ptr} {\*int_ptr_ptr} 1 {int \*}}
+} "get children of weird.int_ptr_ptr"
#gdbtk_test c_variable-4.86 {children of weird->int_ptr_ptr} {
# get_children weird.int_ptr_ptr
#} {*int_ptr_ptr}
@@ -611,9 +532,9 @@ mi_gdb_test "-var-info-num-children weird.int_ptr_ptr" \
# Test: c_variable-4.88
# Desc: children of *weird->int_ptr_ptr
-mi_gdb_test "-var-list-children weird.int_ptr_ptr.*int_ptr_ptr" \
- "\\^done,numchild=\"1\",children=\\\[child=\{name=\"weird.int_ptr_ptr.\\*int_ptr_ptr.\\*\\*int_ptr_ptr\",exp=\"\\*\\*int_ptr_ptr\",numchild=\"0\",type=\"int\"\}\\\]" \
- "get children of weird.int_ptr_ptr.*int_ptr_ptr"
+mi_list_varobj_children "weird.int_ptr_ptr.*int_ptr_ptr" {
+ {{weird.int_ptr_ptr.\*int_ptr_ptr.\*\*int_ptr_ptr} {\*\*int_ptr_ptr} 0 "int"}
+} "get children of weird.int_ptr_ptr.*int_ptr_ptr"
#gdbtk_test c_variable-4.88 {children of *weird->int_ptr_ptr} {
# get_children weird.int_ptr_ptr.*int_ptr_ptr
#} {**int_ptr_ptr}
@@ -626,16 +547,14 @@ mi_gdb_test "-var-info-num-children weird.int_ptr_ptr.*int_ptr_ptr" \
# 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 \\*\\*\"" \
+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
-mi_gdb_test "-var-list-children weird->int_ptr_ptr" \
- "\\^done,numchild=\"1\",children=\\\[child=\{name=\"weird->int_ptr_ptr.\\*weird->int_ptr_ptr\",exp=\"\\*weird->int_ptr_ptr\",numchild=\"1\",type=\"int \\*\"\}\\\]" \
- "get children of weird->int_ptr_ptr"
-
+mi_list_varobj_children "weird->int_ptr_ptr" {
+ {{weird->int_ptr_ptr.\*weird->int_ptr_ptr} {\*weird->int_ptr_ptr} 1 {int \*}}
+} "get children of weird->int_ptr_ptr"
# Test: c_variable-4.92
# Desc: number of children of (weird->int_ptr_ptr)
@@ -645,9 +564,10 @@ mi_gdb_test "-var-info-num-children weird->int_ptr_ptr" \
# Test: c_variable-4.93
# Desc: children of *(weird->int_ptr_ptr)
-mi_gdb_test "-var-list-children weird->int_ptr_ptr.*weird->int_ptr_ptr" \
- "\\^done,numchild=\"1\",children=\\\[child=\{name=\"weird->int_ptr_ptr.\\*weird->int_ptr_ptr.\\*\\*weird->int_ptr_ptr\",exp=\"\\*\\*weird->int_ptr_ptr\",numchild=\"0\",type=\"int\"\}\\\]" \
- "get children of weird->int_ptr_ptr.*weird->int_ptr_ptr"
+mi_list_varobj_children "weird->int_ptr_ptr.*weird->int_ptr_ptr" {
+ {{weird->int_ptr_ptr.\*weird->int_ptr_ptr.\*\*weird->int_ptr_ptr} \
+ {\*\*weird->int_ptr_ptr} 0 int}
+} "get children of weird->int_ptr_ptr.*weird->int_ptr_ptr"
# Test: c_variable-4.94
# Desc: number of children of *(weird->int_ptr_ptr)
@@ -657,14 +577,12 @@ mi_gdb_test "-var-info-num-children weird->int_ptr_ptr.*weird->int_ptr_ptr" \
# Test: c_variable-4.95
# Desc: children of *(*(weird->int_ptr_ptr))
-mi_gdb_test "-var-list-children weird->int_ptr_ptr.*weird->int_ptr_ptr.**weird->int_ptr_ptr" \
- "\\^done,numchild=\"0\"" \
+mi_list_varobj_children "weird->int_ptr_ptr.*weird->int_ptr_ptr.**weird->int_ptr_ptr" {} \
"get children of weird->int_ptr_ptr.*weird->int_ptr_ptr.**weird->int_ptr_ptr"
# Test: c_variable-4.96
# Desc: number of children of *(*(weird->int_ptr_ptr))
-mi_gdb_test "-var-info-num-children weird->int_ptr_ptr.*weird->int_ptr_ptr.**weird->int_ptr_ptr" \
- "\\^done,numchild=\"0\"" \
+mi_list_varobj_children "weird->int_ptr_ptr.*weird->int_ptr_ptr.**weird->int_ptr_ptr" {} \
"get number of children of weird->int_ptr_ptr.*weird->int_ptr_ptr.**weird->int_ptr_ptr"
# Test: c_variable-4.97
@@ -865,13 +783,37 @@ mi_gdb_test "-var-update --all-values *" \
"\\^done,changelist=\\\[\{name=\"struct_declarations.long_array.11\",value=\"5678\",in_scope=\"true\",type_changed=\"false\"\}\\\]" \
"update all vars struct_declarations.long_array.11 changed, print values."
-mi_gdb_test "-var-list-children --all-values struct_declarations.long_array" \
- "\\^done,numchild=\"12\",children=\\\[child=\{name=\"struct_declarations.long_array.0\",exp=\"0\",numchild=\"0\",value=\"1234\",type=\"long int\"\},child=\{name=\"struct_declarations.long_array.1\",exp=\"1\",numchild=\"0\",value=\"2345\",type=\"long int\"\},child=\{name=\"struct_declarations.long_array.2\",exp=\"2\",numchild=\"0\",value=\"3456\",type=\"long int\"\},child=\{name=\"struct_declarations.long_array.3\",exp=\"3\",numchild=\"0\",value=\"4567\",type=\"long int\"\},child=\{name=\"struct_declarations.long_array.4\",exp=\"4\",numchild=\"0\",value=\"5678\",type=\"long int\"\},child=\{name=\"struct_declarations.long_array.5\",exp=\"5\",numchild=\"0\",value=\"6789\",type=\"long int\"\},child=\{name=\"struct_declarations.long_array.6\",exp=\"6\",numchild=\"0\",value=\"7890\",type=\"long int\"\},child=\{name=\"struct_declarations.long_array.7\",exp=\"7\",numchild=\"0\",value=\"8901\",type=\"long int\"\},child=\{name=\"struct_declarations.long_array.8\",exp=\"8\",numchild=\"0\",value=\"9012\",type=\"long int\"\},child=\{name=\"struct_declarations.long_array.9\",exp=\"9\",numchild=\"0\",value=\"1234\",type=\"long int\"\},child=\{name=\"struct_declarations.long_array.10\",exp=\"10\",numchild=\"0\",value=\"3456\",type=\"long int\"\},child=\{name=\"struct_declarations.long_array.11\",exp=\"11\",numchild=\"0\",value=\"5678\",type=\"long int\"\}\\\]" \
- "listing of names and values of children"
-
-mi_gdb_test "-var-list-children --simple-values struct_declarations" \
- "\\^done,numchild=\"11\",children=\\\[child=\{name=\"struct_declarations.integer\",exp=\"integer\",numchild=\"0\",value=\"123\",type=\"int\"\},child=\{name=\"struct_declarations.character\",exp=\"character\",numchild=\"0\",value=\"0 '\\\\\\\\0'\",type=\"char\"\},child=\{name=\"struct_declarations.char_ptr\",exp=\"char_ptr\",numchild=\"1\",value=\"$hex \\\\\"hello\\\\\"\",type=\"char \\*\"\},child=\{name=\"struct_declarations.long_int\",exp=\"long_int\",numchild=\"0\",value=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.int_ptr_ptr\",exp=\"int_ptr_ptr\",numchild=\"1\",value=\"$hex\",type=\"int \\*\\*\"\},child=\{name=\"struct_declarations.long_array\",exp=\"long_array\",numchild=\"12\",type=\"long int \\\[12\\\]\"\},child=\{name=\"struct_declarations.func_ptr\",exp=\"func_ptr\",numchild=\"0\",value=\"(@$hex: |)$hex <nothing>\",type=\"void \\(\\*\\)\\(void\\)\"\},child=\{name=\"struct_declarations.func_ptr_struct\",exp=\"func_ptr_struct\",numchild=\"0\",value=\"0\",type=\"struct _struct_decl \\(\\*\\)\\(int, char \\*, long int\\)\"\},child=\{name=\"struct_declarations.func_ptr_ptr\",exp=\"func_ptr_ptr\",numchild=\"0\",value=\"0\",type=\"struct _struct_decl \\*\\(\\*\\)\\(int, char \\*, long int\\)\"\},child=\{name=\"struct_declarations.u1\",exp=\"u1\",numchild=\"4\",type=\"union \{...\}\"\},child=\{name=\"struct_declarations.s2\",exp=\"s2\",numchild=\"4\",type=\"struct \{...\}\"\}\\\]" \
- "listing of children, simple types: names, type and values, complex types: names and types"
+mi_list_varobj_children {struct_declarations.long_array --all-values} {
+ {struct_declarations.long_array.0 0 0 "long int" 1234}
+ {struct_declarations.long_array.1 1 0 "long int" 2345}
+ {struct_declarations.long_array.2 2 0 "long int" 3456}
+ {struct_declarations.long_array.3 3 0 "long int" 4567}
+ {struct_declarations.long_array.4 4 0 "long int" 5678}
+ {struct_declarations.long_array.5 5 0 "long int" 6789}
+ {struct_declarations.long_array.6 6 0 "long int" 7890}
+ {struct_declarations.long_array.7 7 0 "long int" 8901}
+ {struct_declarations.long_array.8 8 0 "long int" 9012}
+ {struct_declarations.long_array.9 9 0 "long int" 1234}
+ {struct_declarations.long_array.10 10 0 "long int" 3456}
+ {struct_declarations.long_array.11 11 0 "long int" 5678}
+} "listing of names and values of children"
+
+mi_list_varobj_children {struct_declarations --simple-values} \
+ [list \
+ {struct_declarations.integer integer 0 int 123} \
+ {struct_declarations.character character 0 char {0 '\\\\0'}} \
+ [list struct_declarations.char_ptr char_ptr 1 "char \\*" "$hex \\\\\"hello\\\\\""] \
+ {struct_declarations.long_int long_int 0 "long int" 0} \
+ [list struct_declarations.int_ptr_ptr int_ptr_ptr 1 "int \\*\\*" "$hex"] \
+ {struct_declarations.long_array long_array 12 "long int \\[12\\]"} \
+ [list struct_declarations.func_ptr func_ptr 0 "void \\(\\*\\)\\((void)?\\)" "(@$hex: |)$hex <nothing>"] \
+ {struct_declarations.func_ptr_struct func_ptr_struct 0 \
+ "struct _struct_decl \\(\\*\\)(\\(int, char \\*, long int\\))?" 0} \
+ {struct_declarations.func_ptr_ptr func_ptr_ptr 0 \
+ "struct _struct_decl \\*\\(\\*\\)\\((int, char \\*, long int)?\\)" 0} \
+ {struct_declarations.u1 u1 4 "union \\{\\.\\.\\.\\}"} \
+ {struct_declarations.s2 s2 4 "struct \\{\\.\\.\\.\\}"} \
+] "listing of children, simple types: names, type and values, complex types: names and types"
# Delete all variables
mi_gdb_test "-var-delete struct_declarations" \
@@ -892,15 +834,14 @@ mi_execute_to "exec-step 43" "end-stepping-range" do_children_tests {} ".*${srcf
# 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 \\*\\*\\*\\*\"" \
+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
-mi_gdb_test "-var-list-children psnp->char_ptr" \
- "\\^done,numchild=\"1\",children=\\\[child=\{name=\"psnp->char_ptr.\\*psnp->char_ptr\",exp=\"\\*psnp->char_ptr\",numchild=\"1\",type=\"char \\*\\*\\*\"\}\\\]" \
- "get children of psnp->char_ptr"
+mi_list_varobj_children "psnp->char_ptr" {
+ {{psnp->char_ptr.\*psnp->char_ptr} {\*psnp->char_ptr} 1 {char \*\*\*}}
+} "get children of psnp->char_ptr"
# Test: c_variable-5.12
# Desc: number of children of psnp->char_ptr
@@ -910,9 +851,10 @@ mi_gdb_test "-var-info-num-children psnp->char_ptr" \
# Test: c_variable-5.13
# Desc: children of *(psnp->char_ptr)
-mi_gdb_test "-var-list-children psnp->char_ptr.*psnp->char_ptr" \
- "\\^done,numchild=\"1\",children=\\\[child=\{name=\"psnp->char_ptr.\\*psnp->char_ptr.\\*\\*psnp->char_ptr\",exp=\"\\*\\*psnp->char_ptr\",numchild=\"1\",type=\"char \\*\\*\"\}\\\]" \
- "get children of psnp->char_ptr.*psnp->char_ptr"
+mi_list_varobj_children "psnp->char_ptr.*psnp->char_ptr" {
+ {{psnp->char_ptr.\*psnp->char_ptr.\*\*psnp->char_ptr} \
+ {\*\*psnp->char_ptr} 1 {char \*\*}}
+} "get children of psnp->char_ptr.*psnp->char_ptr"
# Test: c_variable-5.14
# Desc: number of children of *(psnp->char_ptr)
@@ -922,15 +864,17 @@ mi_gdb_test "-var-info-num-children psnp->char_ptr.*psnp->char_ptr" \
# Test: c_variable-5.15
# Desc: children of *(*(psnp->char_ptr))
-mi_gdb_test "-var-list-children psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr" \
- "\\^done,numchild=\"1\",children=\\\[child=\{name=\"psnp->char_ptr.\\*psnp->char_ptr.\\*\\*psnp->char_ptr.\\*\\*\\*psnp->char_ptr\",exp=\"\\*\\*\\*psnp->char_ptr\",numchild=\"1\",type=\"char \\*\"\}\\\]" \
- "get children of psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr"
+mi_list_varobj_children "psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr" {
+ {{psnp->char_ptr.\*psnp->char_ptr.\*\*psnp->char_ptr.\*\*\*psnp->char_ptr} \
+ {\*\*\*psnp->char_ptr} 1 {char \*}}
+} "get children of psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr"
# Test: c_variable-5.15B
# Desc: children of *(*(*(psnp->char_ptr)))
-mi_gdb_test "-var-list-children psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr.***psnp->char_ptr" \
- "\\^done,numchild=\"1\",children=\\\[child=\{name=\"psnp->char_ptr.\\*psnp->char_ptr.\\*\\*psnp->char_ptr.\\*\\*\\*psnp->char_ptr.\\*\\*\\*\\*psnp->char_ptr\",exp=\"\\*\\*\\*\\*psnp->char_ptr\",numchild=\"0\",type=\"char\"\}\\\]" \
- "get children of psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr"
+mi_list_varobj_children "psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr.***psnp->char_ptr" {
+ {{psnp->char_ptr.\*psnp->char_ptr.\*\*psnp->char_ptr.\*\*\*psnp->char_ptr.\*\*\*\*psnp->char_ptr} \
+ {\*\*\*\*psnp->char_ptr} 0 char}
+} "get children of psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr.***psnp->char_ptr"
# Test: c_variable-5.16
# Desc: number of children of *(*(psnp->char_ptr))
@@ -940,9 +884,10 @@ mi_gdb_test "-var-info-num-children psnp->char_ptr.*psnp->char_ptr.**psnp->char_
# Test: c_variable-5.17
# Desc: children of *(*(*(psnp->char_ptr)))
-mi_gdb_test "-var-list-children psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr.***psnp->char_ptr" \
- "\\^done,numchild=\"1\",children=\\\[child=\{name=\"psnp->char_ptr.\\*psnp->char_ptr.\\*\\*psnp->char_ptr.\\*\\*\\*psnp->char_ptr.\\*\\*\\*\\*psnp->char_ptr\",exp=\"\\*\\*\\*\\*psnp->char_ptr\",numchild=\"0\",type=\"char\"\}\\\]" \
- "get children of psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr.***psnp->char_ptr"
+mi_list_varobj_children "psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr.***psnp->char_ptr" {
+ {{psnp->char_ptr.\*psnp->char_ptr.\*\*psnp->char_ptr.\*\*\*psnp->char_ptr.\*\*\*\*psnp->char_ptr} \
+ {\*\*\*\*psnp->char_ptr} 0 char}
+} "get children of psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr.***psnp->char_ptr"
# Test: c_variable-5.18
# Desc: number of children of *(*(*(psnp->char_ptr)))
@@ -952,8 +897,7 @@ mi_gdb_test "-var-info-num-children psnp->char_ptr.*psnp->char_ptr.**psnp->char_
# Test: c_variable-5.17B
# Desc: children of *(*(*(*(psnp->char_ptr))))
-mi_gdb_test "-var-list-children psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr.***psnp->char_ptr.****psnp->char_ptr" \
- "\\^done,numchild=\"0\"" \
+mi_list_varobj_children "psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr.***psnp->char_ptr.****psnp->char_ptr" {} \
"get children of psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr.***psnp->char_ptr.****psnp->char_ptr"
# Test: c_variable-5.18B
@@ -962,18 +906,16 @@ mi_gdb_test "-var-info-num-children psnp->char_ptr.*psnp->char_ptr.**psnp->char_
"\\^done,numchild=\"0\"" \
"get number of children of psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr.***psnp->char_ptr.****psnp->char_ptr"
-
# 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 \\*\\*\\*\\*\"" \
+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
-mi_gdb_test "-var-list-children psnp->long_ptr" \
- "\\^done,numchild=\"1\",children=\\\[child=\{name=\"psnp->long_ptr.\\*psnp->long_ptr\",exp=\"\\*psnp->long_ptr\",numchild=\"1\",type=\"long int \\*\\*\\*\"\}\\\]" \
- "get children of psnp->long_ptr"
+mi_list_varobj_children "psnp->long_ptr" {
+ {{psnp->long_ptr.\*psnp->long_ptr} {\*psnp->long_ptr} 1 {long int \*\*\*}}
+} "get children of psnp->long_ptr"
# Test: c_variable-5.21
# Desc: number of children of psnp->long_ptr
@@ -983,9 +925,9 @@ mi_gdb_test "-var-info-num-children psnp->long_ptr" \
# Test: c_variable-5.22
# Desc: children of *(psnp->long_ptr)
-mi_gdb_test "-var-list-children psnp->long_ptr.*psnp->long_ptr" \
- "\\^done,numchild=\"1\",children=\\\[child=\{name=\"psnp->long_ptr.\\*psnp->long_ptr.\\*\\*psnp->long_ptr\",exp=\"\\*\\*psnp->long_ptr\",numchild=\"1\",type=\"long int \\*\\*\"\}\\\]" \
- "get children of psnp->long_ptr.*psnp->long_ptr"
+mi_list_varobj_children "psnp->long_ptr.*psnp->long_ptr" {
+ {{psnp->long_ptr.\*psnp->long_ptr.\*\*psnp->long_ptr} {\*\*psnp->long_ptr} 1 {long int \*\*}}
+} "get children of psnp->long_ptr.*psnp->long_ptr"
# Test: c_variable-5.23
@@ -996,9 +938,10 @@ mi_gdb_test "-var-info-num-children psnp->long_ptr.*psnp->long_ptr" \
# Test: c_variable-5.24
# Desc: children of *(*(psnp->long_ptr))
-mi_gdb_test "-var-list-children psnp->long_ptr.*psnp->long_ptr.**psnp->long_ptr" \
- "\\^done,numchild=\"1\",children=\\\[child=\{name=\"psnp->long_ptr.\\*psnp->long_ptr.\\*\\*psnp->long_ptr.\\*\\*\\*psnp->long_ptr\",exp=\"\\*\\*\\*psnp->long_ptr\",numchild=\"1\",type=\"long int \\*\"\}\\\]" \
- "get children of psnp->long_ptr.*psnp->long_ptr.**psnp->long_ptr"
+mi_list_varobj_children "psnp->long_ptr.*psnp->long_ptr.**psnp->long_ptr" {
+ {{psnp->long_ptr.\*psnp->long_ptr.\*\*psnp->long_ptr.\*\*\*psnp->long_ptr} \
+ {\*\*\*psnp->long_ptr} 1 {long int \*}}
+} "get children of psnp->long_ptr.*psnp->long_ptr.**psnp->long_ptr"
# Test: c_variable-5.25
# Desc: number of children of *(*(psnp->long_ptr))
@@ -1008,9 +951,10 @@ mi_gdb_test "-var-info-num-children psnp->long_ptr.*psnp->long_ptr.**psnp->long_
# Test: c_variable-5.26
# Desc: children of *(*(*(psnp->long_ptr)))
-mi_gdb_test "-var-list-children psnp->long_ptr.*psnp->long_ptr.**psnp->long_ptr.***psnp->long_ptr" \
- "\\^done,numchild=\"1\",children=\\\[child=\{name=\"psnp->long_ptr.\\*psnp->long_ptr.\\*\\*psnp->long_ptr.\\*\\*\\*psnp->long_ptr.\\*\\*\\*\\*psnp->long_ptr\",exp=\"\\*\\*\\*\\*psnp->long_ptr\",numchild=\"0\",type=\"long int\"\}\\\]" \
- "get children of psnp->long_ptr.*psnp->long_ptr.**psnp->long_ptr.***psnp->long_ptr"
+mi_list_varobj_children "psnp->long_ptr.*psnp->long_ptr.**psnp->long_ptr.***psnp->long_ptr" {
+ {{psnp->long_ptr.\*psnp->long_ptr.\*\*psnp->long_ptr.\*\*\*psnp->long_ptr.\*\*\*\*psnp->long_ptr}
+ {\*\*\*\*psnp->long_ptr} 0 {long int}}
+} "get children of psnp->long_ptr.*psnp->long_ptr.**psnp->long_ptr.***psnp->long_ptr"
# Test: c_variable-5.27
# Desc: number of children of *(*(*(psnp->long_ptr)))
@@ -1020,8 +964,7 @@ mi_gdb_test "-var-info-num-children psnp->long_ptr.*psnp->long_ptr.**psnp->long_
# Test: c_variable-5.28
# Desc: children of *(*(*(*(psnp->long_ptr))))
-mi_gdb_test "-var-list-children psnp->long_ptr.*psnp->long_ptr.**psnp->long_ptr.***psnp->long_ptr.****psnp->long_ptr" \
- "\\^done,numchild=\"0\"" \
+mi_list_varobj_children "psnp->long_ptr.*psnp->long_ptr.**psnp->long_ptr.***psnp->long_ptr.****psnp->long_ptr" {} \
"get children of psnp->long_ptr.*psnp->long_ptr.**psnp->long_ptr.***psnp->long_ptr.****psnp->long_ptr"
# Test: c_variable-5.29
@@ -1032,15 +975,16 @@ mi_gdb_test "-var-info-num-children psnp->long_ptr.*psnp->long_ptr.**psnp->long_
# 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\\\]\"" \
+mi_create_varobj "psnp->ptrs" "psnp->ptrs" \
"create local variable psnp->ptrs"
# Test: c_variable-5.31
# Desc: children of psnp->ptrs
-mi_gdb_test "-var-list-children psnp->ptrs" \
- "\\^done,numchild=\"3\",children=\\\[child=\{name=\"psnp->ptrs.0\",exp=\"0\",numchild=\"4\",type=\"struct _struct_n_pointer \\*\"\},child=\{name=\"psnp->ptrs.1\",exp=\"1\",numchild=\"4\",type=\"struct _struct_n_pointer \\*\"\},child=\{name=\"psnp->ptrs.2\",exp=\"2\",numchild=\"4\",type=\"struct _struct_n_pointer \\*\"\}\\\]" \
- "get children of psnp->ptrs"
+mi_list_varobj_children "psnp->ptrs" {
+ {psnp->ptrs.0 0 4 {struct _struct_n_pointer \*}}
+ {psnp->ptrs.1 1 4 {struct _struct_n_pointer \*}}
+ {psnp->ptrs.2 2 4 {struct _struct_n_pointer \*}}
+} "get children of psnp->ptrs"
# Test: c_variable-5.32
# Desc: number of children of psnp->ptrs
@@ -1050,9 +994,12 @@ mi_gdb_test "-var-info-num-children psnp->ptrs" \
# Test: c_variable-5.33
# Desc: children of psnp->ptrs[0]
-mi_gdb_test "-var-list-children psnp->ptrs.0" \
- "\\^done,numchild=\"4\",children=\\\[child=\{name=\"psnp->ptrs.0.char_ptr\",exp=\"char_ptr\",numchild=\"1\",type=\"char \\*\\*\\*\\*\"\},child=\{name=\"psnp->ptrs.0.long_ptr\",exp=\"long_ptr\",numchild=\"1\",type=\"long int \\*\\*\\*\\*\"\},child=\{name=\"psnp->ptrs.0.ptrs\",exp=\"ptrs\",numchild=\"3\",type=\"struct _struct_n_pointer \\*\\\[3\\\]\"\},child=\{name=\"psnp->ptrs.0.next\",exp=\"next\",numchild=\"4\",type=\"struct _struct_n_pointer \\*\"\}\\\]" \
- "get children of psnp->ptrs.0"
+mi_list_varobj_children "psnp->ptrs.0" {
+ {psnp->ptrs.0.char_ptr char_ptr 1 {char \*\*\*\*}}
+ {psnp->ptrs.0.long_ptr long_ptr 1 {long int \*\*\*\*}}
+ {psnp->ptrs.0.ptrs ptrs 3 {struct _struct_n_pointer \*\[3\]}}
+ {psnp->ptrs.0.next next 4 {struct _struct_n_pointer \*}}
+} "get children of psnp->ptrs.0"
# Test: c_variable-5.34
# Desc: number of children of psnp->ptrs[0]
@@ -1062,9 +1009,12 @@ mi_gdb_test "-var-info-num-children psnp->ptrs.0" \
# Test: c_variable-5.35
# Desc: children of psnp->ptrs[0]->next
-mi_gdb_test "-var-list-children psnp->ptrs.0.next" \
- "\\^done,numchild=\"4\",children=\\\[child=\{name=\"psnp->ptrs.0.next.char_ptr\",exp=\"char_ptr\",numchild=\"1\",type=\"char \\*\\*\\*\\*\"\},child=\{name=\"psnp->ptrs.0.next.long_ptr\",exp=\"long_ptr\",numchild=\"1\",type=\"long int \\*\\*\\*\\*\"\},child=\{name=\"psnp->ptrs.0.next.ptrs\",exp=\"ptrs\",numchild=\"3\",type=\"struct _struct_n_pointer \\*\\\[3\\\]\"\},child=\{name=\"psnp->ptrs.0.next.next\",exp=\"next\",numchild=\"4\",type=\"struct _struct_n_pointer \\*\"\}\\\]" \
- "get children of psnp->ptrs.0.next"
+mi_list_varobj_children "psnp->ptrs.0.next" {
+ {psnp->ptrs.0.next.char_ptr char_ptr 1 {char \*\*\*\*}}
+ {psnp->ptrs.0.next.long_ptr long_ptr 1 {long int \*\*\*\*}}
+ {psnp->ptrs.0.next.ptrs ptrs 3 {struct _struct_n_pointer \*\[3\]}}
+ {psnp->ptrs.0.next.next next 4 {struct _struct_n_pointer \*}}
+} "get children of psnp->ptrs.0.next"
#} {char_ptr long_ptr ptrs next}
@@ -1077,9 +1027,9 @@ mi_gdb_test "-var-info-num-children psnp->ptrs.0.next" \
# Test: c_variable-5.37
# Desc: children of psnp->ptrs[0]->next->char_ptr
-mi_gdb_test "-var-list-children psnp->ptrs.0.next.char_ptr" \
- "\\^done,numchild=\"1\",children=\\\[child=\{name=\"psnp->ptrs.0.next.char_ptr.\\*char_ptr\",exp=\"\\*char_ptr\",numchild=\"1\",type=\"char \\*\\*\\*\"\}\\\]" \
- "get children of psnp->ptrs.0.next.char_ptr"
+mi_list_varobj_children "psnp->ptrs.0.next.char_ptr" {
+ {{psnp->ptrs.0.next.char_ptr.\*char_ptr} {\*char_ptr} 1 {char \*\*\*}}
+} "get children of psnp->ptrs.0.next.char_ptr"
#gdbtk_test c_variable-5.37 {children of psnp->ptrs[0]->next->char_ptr} {
# get_children psnp->ptrs.0.next.char_ptr
@@ -1093,9 +1043,9 @@ mi_gdb_test "-var-info-num-children psnp->ptrs.0.next.char_ptr" \
# Test: c_variable-5.39
# Desc: children of *psnp->ptrs[0]->next->char_ptr
-mi_gdb_test "-var-list-children psnp->ptrs.0.next.char_ptr.*char_ptr" \
- "\\^done,numchild=\"1\",children=\\\[child=\{name=\"psnp->ptrs.0.next.char_ptr.\\*char_ptr.\\*\\*char_ptr\",exp=\"\\*\\*char_ptr\",numchild=\"1\",type=\"char \\*\\*\"\}\\\]" \
- "get children of psnp->ptrs.0.next.char_ptr.*char_ptr"
+mi_list_varobj_children "psnp->ptrs.0.next.char_ptr.*char_ptr" {
+ {{psnp->ptrs.0.next.char_ptr.\*char_ptr.\*\*char_ptr} {\*\*char_ptr} 1 {char \*\*}}
+} "get children of psnp->ptrs.0.next.char_ptr.*char_ptr"
# Test: c_variable-5.40
# Desc: number of children of *psnp->ptrs[0]->next->char_ptr
@@ -1105,15 +1055,17 @@ mi_gdb_test "-var-info-num-children psnp->ptrs.0.next.char_ptr.*char_ptr" \
# Test: c_variable-5.41
# Desc: children of **psnp->ptrs[0]->next->char_ptr
-mi_gdb_test "-var-list-children psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr" \
- "\\^done,numchild=\"1\",children=\\\[child=\{name=\"psnp->ptrs.0.next.char_ptr.\\*char_ptr.\\*\\*char_ptr.\\*\\*\\*char_ptr\",exp=\"\\*\\*\\*char_ptr\",numchild=\"1\",type=\"char \\*\"\}\\\]" \
- "get children of psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr"
+mi_list_varobj_children "psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr" {
+ {{psnp->ptrs.0.next.char_ptr.\*char_ptr.\*\*char_ptr.\*\*\*char_ptr} \
+ {\*\*\*char_ptr} 1 {char \*}}
+} "get children of psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr"
# Test: c_variable-5.41B
# Desc: children of ***psnp->ptrs[0]->next->char_ptr
-mi_gdb_test "-var-list-children psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr.***char_ptr" \
- "\\^done,numchild=\"1\",children=\\\[child=\{name=\"psnp->ptrs.0.next.char_ptr.\\*char_ptr.\\*\\*char_ptr.\\*\\*\\*char_ptr.\\*\\*\\*\\*char_ptr\",exp=\"\\*\\*\\*\\*char_ptr\",numchild=\"0\",type=\"char\"\}\\\]" \
- "get children of psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr"
+mi_list_varobj_children "psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr.***char_ptr" {
+ {{psnp->ptrs.0.next.char_ptr.\*char_ptr.\*\*char_ptr.\*\*\*char_ptr.\*\*\*\*char_ptr} \
+ {\*\*\*\*char_ptr} 0 char}
+} "get children of psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr"
# Test: c_variable-5.42
# Desc: number of children of **psnp->ptrs[0]->next->char_ptr
@@ -1123,9 +1075,10 @@ mi_gdb_test "-var-info-num-children psnp->ptrs.0.next.char_ptr.*char_ptr.**char_
# Test: c_variable-5.43
# Desc: children of ***psnp->ptrs[0]->next->char_ptr
-mi_gdb_test "-var-list-children psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr.***char_ptr" \
- "\\^done,numchild=\"1\",children=\\\[child=\{name=\"psnp->ptrs.0.next.char_ptr.\\*char_ptr.\\*\\*char_ptr.\\*\\*\\*char_ptr.\\*\\*\\*\\*char_ptr\",exp=\"\\*\\*\\*\\*char_ptr\",numchild=\"0\",type=\"char\"\}\\\]" \
- "get children of psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr.***char_ptr"
+mi_list_varobj_children "psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr.***char_ptr" {
+ {{psnp->ptrs.0.next.char_ptr.\*char_ptr.\*\*char_ptr.\*\*\*char_ptr.\*\*\*\*char_ptr} \
+ {\*\*\*\*char_ptr} 0 char}
+} "get children of psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr.***char_ptr"
# Test: c_variable-5.44
# Desc: number of children of ***psnp->ptrs[0]->next->char_ptr
@@ -1135,8 +1088,7 @@ mi_gdb_test "-var-info-num-children psnp->ptrs.0.next.char_ptr.*char_ptr.**char_
# Test: c_variable-5.43B
# Desc: children of ****psnp->ptrs[0]->next->char_ptr
-mi_gdb_test "-var-list-children psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr.***char_ptr.****char_ptr" \
- "\\^done,numchild=\"0\"" \
+mi_list_varobj_children "psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr.***char_ptr.****char_ptr" {} \
"get children of psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr.***char_ptr"
# Test: c_variable-5.44B
@@ -1147,15 +1099,20 @@ mi_gdb_test "-var-info-num-children psnp->ptrs.0.next.char_ptr.*char_ptr.**char_
# Test: c_variable-5.45
# Desc: children of psnp->ptrs[0]->next->next
-mi_gdb_test "-var-list-children psnp->ptrs.0.next.next" \
- "\\^done,numchild=\"4\",children=\\\[child=\{name=\"psnp->ptrs.0.next.next.char_ptr\",exp=\"char_ptr\",numchild=\"1\",type=\"char \\*\\*\\*\\*\"\},child=\{name=\"psnp->ptrs.0.next.next.long_ptr\",exp=\"long_ptr\",numchild=\"1\",type=\"long int \\*\\*\\*\\*\"\},child=\{name=\"psnp->ptrs.0.next.next.ptrs\",exp=\"ptrs\",numchild=\"3\",type=\"struct _struct_n_pointer \\*\\\[3\\\]\"\},child=\{name=\"psnp->ptrs.0.next.next.next\",exp=\"next\",numchild=\"4\",type=\"struct _struct_n_pointer \\*\"\}\\\]" \
- "get children of psnp->ptrs.0.next.next"
+mi_list_varobj_children "psnp->ptrs.0.next.next" {
+ {psnp->ptrs.0.next.next.char_ptr char_ptr 1 {char \*\*\*\*}}
+ {psnp->ptrs.0.next.next.long_ptr long_ptr 1 {long int \*\*\*\*}}
+ {psnp->ptrs.0.next.next.ptrs ptrs 3 {struct _struct_n_pointer \*\[3\]}}
+ {psnp->ptrs.0.next.next.next next 4 {struct _struct_n_pointer \*}}
+} "get children of psnp->ptrs.0.next.next"
# Test: c_variable-5.46
# Desc: children of psnp->ptrs[0]->next->next->ptrs
-mi_gdb_test "-var-list-children psnp->ptrs.0.next.next.ptrs" \
- "\\^done,numchild=\"3\",children=\\\[child=\{name=\"psnp->ptrs.0.next.next.ptrs.0\",exp=\"0\",numchild=\"4\",type=\"struct _struct_n_pointer \\*\"\},child=\{name=\"psnp->ptrs.0.next.next.ptrs.1\",exp=\"1\",numchild=\"4\",type=\"struct _struct_n_pointer \\*\"\},child=\{name=\"psnp->ptrs.0.next.next.ptrs.2\",exp=\"2\",numchild=\"4\",type=\"struct _struct_n_pointer \\*\"\}\\\]" \
- "get children of psnp->ptrs.0.next.next.ptrs"
+mi_list_varobj_children "psnp->ptrs.0.next.next.ptrs" {
+ {psnp->ptrs.0.next.next.ptrs.0 0 4 {struct _struct_n_pointer \*}}
+ {psnp->ptrs.0.next.next.ptrs.1 1 4 {struct _struct_n_pointer \*}}
+ {psnp->ptrs.0.next.next.ptrs.2 2 4 {struct _struct_n_pointer \*}}
+} "get children of psnp->ptrs.0.next.next.ptrs"
# Step over "snp0.char_ptr = &b3;"
mi_step_to do_children_tests {} ".*${srcfile}" \
diff --git a/gdb/testsuite/gdb.mi/mi-var-cmd.exp b/gdb/testsuite/gdb.mi/mi-var-cmd.exp
index 57e1484..49303539 100644
--- a/gdb/testsuite/gdb.mi/mi-var-cmd.exp
+++ b/gdb/testsuite/gdb.mi/mi-var-cmd.exp
@@ -50,9 +50,7 @@ mi_gdb_load ${binfile}
# Test: c_variable-1.1
# 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"
+mi_create_varobj "global_simple" "global_simple" "create global variable"
# Test: c_variable-1.2
# Desc: Create non-existent variable
@@ -78,75 +76,46 @@ mi_continue_to_line $line_dlt_first_real "step to real start of do_locals_test"
# 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_create_varobj_checked linteger linteger 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_create_varobj_checked lpinteger lpinteger {int \*} "create local variable lpinteger"
-mi_gdb_test "-var-create lcharacter * lcharacter\[0\]" \
- "\\^done,name=\"lcharacter\",numchild=\"0\",value=\".*\",type=\"char\"" \
- "create local variable lcharacter "
+mi_create_varobj_checked lcharacter lcharacter\[0\] char "create local variable lcharacter"
-mi_gdb_test "-var-create lpcharacter * lpcharacter" \
- "\\^done,name=\"lpcharacter\",numchild=\"1\",value=\"$hex.*\",type=\"char \\*\"" \
- "create local variable lpcharacter"
+mi_create_varobj_checked lpcharacter lpcharacter {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_create_varobj_checked llong llong "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_create_varobj_checked lplong lplong {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_create_varobj_checked lfloat lfloat 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_create_varobj_checked lpfloat lpfloat {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_create_varobj_checked ldouble ldouble 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_create_varobj_checked lpdouble lpdouble {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_create_varobj_checked lsimple lsimple "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_create_varobj_checked lpsimple lpsimple {struct _simple_struct \*} "create local variable lpsimple"
-mi_gdb_test "-var-create func * func" \
- "\\^done,name=\"func\",numchild=\"0\",value=\".*\",type=\"void \\(\\*\\)\\((void|)\\)\"" \
- "create local variable func"
+mi_create_varobj_checked func func {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\"" \
+mi_create_varobj_checked lsimple.character lsimple.character "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\"" \
+mi_create_varobj_checked lsimple->integer lsimple->integer "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"
+# Desc: crate lsimple.integer
+mi_create_varobj_checked lsimple.integer lsimple.integer "int" \
+ "create lsimple.integer"
# Test: c_variable-1.9
@@ -438,13 +407,9 @@ mi_continue_to subroutine1
# 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_create_varobj_checked i i int "create i"
-mi_gdb_test "-var-create l * l" \
- "\\^done,name=\"l\",numchild=\"1\",value=\"$hex\",type=\"long int \\*\"" \
- "create l"
+mi_create_varobj_checked l l {long int \*} "create l"
# Test: c_variable-2.11
# Desc: create do_locals_tests local in subroutine1
@@ -579,7 +544,7 @@ mi_gdb_test "-var-delete l" \
mi_continue_to do_special_tests
mi_gdb_test "-var-create selected_a @ a" \
- {\^done,name="selected_a",numchild="0",value=\".*\",type="int"} \
+ {\^done,name="selected_a",numchild="0",value=\".*\",type="int".*} \
"create selected_a"
mi_continue_to incr_a
diff --git a/gdb/testsuite/gdb.mi/mi-var-display.exp b/gdb/testsuite/gdb.mi/mi-var-display.exp
index c28e0ba..acacfdc 100644
--- a/gdb/testsuite/gdb.mi/mi-var-display.exp
+++ b/gdb/testsuite/gdb.mi/mi-var-display.exp
@@ -64,9 +64,7 @@ gdb_expect {
# 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"
+mi_create_varobj bar bar "create local variable bar"
# Test: c_variable-6.2
# Desc: type of variable bar
@@ -118,9 +116,7 @@ mi_gdb_test "-var-delete bar" \
# 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"
+mi_create_varobj foo foo "create local variable foo"
# Test: c_variable-6.12
# Desc: type of variable foo
@@ -178,13 +174,23 @@ mi_gdb_test "-var-delete foo" \
# 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 \{\\.\\.\\.\}\"\}\\\]" \
- "get children local variable weird"
+mi_create_varobj weird weird "create local variable weird"
+
+mi_list_varobj_children weird {
+ {weird.integer integer 0 int}
+ {weird.character character 0 char}
+ {weird.char_ptr char_ptr 1 "char \\*"}
+ {weird.long_int long_int 0 "long int"}
+ {weird.int_ptr_ptr int_ptr_ptr 1 "int \\*\\*"}
+ {weird.long_array long_array 10 "long int \\[10\\]"}
+ {weird.func_ptr func_ptr 0 "void \\(\\*\\)\\((void)?\\)"}
+ {weird.func_ptr_struct func_ptr_struct 0 \
+ "struct _struct_decl \\(\\*\\)(\\(int, char \\*, long int\\))?"}
+ {weird.func_ptr_ptr func_ptr_ptr 0 \
+ "struct _struct_decl \\*\\(\\*\\)\\((int, char \\*, long int)?\\)"}
+ {weird.u1 u1 4 "union \\{\\.\\.\\.\\}"}
+ {weird.s2 s2 4 "struct \\{\\.\\.\\.\\}"}
+} "get children local variable weird"
# Test: c_variable-6.23
@@ -343,9 +349,7 @@ gdb_expect {
# 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"
+mi_create_varobj u u "create local variable u"
# Test: c_variable-7.11
# Desc: value of u
@@ -373,15 +377,14 @@ mi_gdb_test "-var-info-num-children u" \
# Test: c_variable-7.15
# Desc: children of u
-mi_gdb_test "-var-list-children u" \
- "\\^done,numchild=\"2\",children=\\\[child=\{name=\"u.integer\",exp=\"integer\",numchild=\"0\",type=\"int\"\},child=\{name=\"u.char_ptr\",exp=\"char_ptr\",numchild=\"1\",type=\"char \\*\"\}\\\]" \
- "get children of u"
+mi_list_varobj_children u {
+ {u.integer integer 0 int}
+ {u.char_ptr char_ptr 1 {char \*}}
+} "get children of u"
# 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"
+mi_create_varobj anonu anonu "create local variable anonu"
# Test: c_variable-7.21
# Desc: value of anonu
@@ -409,15 +412,15 @@ mi_gdb_test "-var-info-num-children anonu" \
# Test: c_variable-7.25
# Desc: children of anonu
-mi_gdb_test "-var-list-children anonu" \
- "\\^done,numchild=\"3\",children=\\\[child=\{name=\"anonu.a\",exp=\"a\",numchild=\"0\",type=\"int\"\},child=\{name=\"anonu.b\",exp=\"b\",numchild=\"0\",type=\"char\"\},child=\{name=\"anonu.c\",exp=\"c\",numchild=\"0\",type=\"long int\"\}\\\]" \
- "get children of anonu"
+mi_list_varobj_children "anonu" {
+ {anonu.a a 0 int}
+ {anonu.b b 0 char}
+ {anonu.c c 0 "long int"}
+} "get children of anonu"
# 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"
+mi_create_varobj s s "create local variable s"
# Test: c_variable-7.31
@@ -446,16 +449,19 @@ mi_gdb_test "-var-info-num-children s" \
# Test: c_variable-7.35
# Desc: children of s
-mi_gdb_test "-var-list-children s" \
- "\\^done,numchild=\"6\",children=\\\[child=\{name=\"s.integer\",exp=\"integer\",numchild=\"0\",type=\"int\"\},child=\{name=\"s.unsigned_integer\",exp=\"unsigned_integer\",numchild=\"0\",type=\"unsigned int\"\},child=\{name=\"s.character\",exp=\"character\",numchild=\"0\",type=\"char\"\},child=\{name=\"s.signed_character\",exp=\"signed_character\",numchild=\"0\",type=\"signed char\"\},child=\{name=\"s.char_ptr\",exp=\"char_ptr\",numchild=\"1\",type=\"char \\*\"\},child=\{name=\"s.array_of_10\",exp=\"array_of_10\",numchild=\"10\",type=\"int \\\[10\\\]\"\}\\\]" \
- "get children of s"
+mi_list_varobj_children s {
+ {s.integer integer 0 int}
+ {s.unsigned_integer unsigned_integer 0 "unsigned int"}
+ {s.character character 0 char}
+ {s.signed_character signed_character 0 "signed char"}
+ {s.char_ptr char_ptr 1 {char \*}}
+ {s.array_of_10 array_of_10 10 {int \[10\]}}
+} "get children of s"
#} {integer unsigned_integer character signed_character char_ptr array_of_10}
# 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"
+mi_create_varobj anons anons "create local variable anons"
# Test: c_variable-7.41
# Desc: value of anons
@@ -483,16 +489,15 @@ mi_gdb_test "-var-info-num-children anons" \
# Test: c_variable-7.45
# Desc: children of anons
-mi_gdb_test "-var-list-children anons" \
- "\\^done,numchild=\"3\",children=\\\[child=\{name=\"anons.a\",exp=\"a\",numchild=\"0\",type=\"int\"\},child=\{name=\"anons.b\",exp=\"b\",numchild=\"0\",type=\"char\"\},child=\{name=\"anons.c\",exp=\"c\",numchild=\"0\",type=\"long int\"\}\\\]" \
- "get children of anons"
-
+mi_list_varobj_children anons {
+ {anons.a a 0 int}
+ {anons.b b 0 char}
+ {anons.c c 0 "long int"}
+} "get children of anons"
# 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"
+mi_create_varobj e e "create local variable e"
setup_xfail "*-*-*"
# Test: c_variable-7.51
@@ -528,9 +533,7 @@ mi_gdb_test "-var-list-children e" \
# 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"
+mi_create_varobj anone anone "create local variable anone"
setup_xfail "*-*-*"
# Test: c_variable-7.61
@@ -610,11 +613,11 @@ gdb_expect {
# 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\"" \
+ "\\^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\"" \
+ "\\^done,name=\"a2\",numchild=\"0\",value=\".*\",type=\"int\".*" \
"create variable a2 in different scope"
#gdbtk_test c_variable-7.81 {create variables in different scopes} {
diff --git a/gdb/testsuite/gdb.mi/mi-var-invalidate.exp b/gdb/testsuite/gdb.mi/mi-var-invalidate.exp
index 77a7d4e..ab3e8c9 100644
--- a/gdb/testsuite/gdb.mi/mi-var-invalidate.exp
+++ b/gdb/testsuite/gdb.mi/mi-var-invalidate.exp
@@ -55,16 +55,12 @@ mi_gdb_reinitialize_dir $srcdir/$subdir
mi_gdb_load ${binfile}
# Desc: Create global variable.
-mi_gdb_test "-var-create global_simple * global_simple" \
- "\\^done,name=\"global_simple\",numchild=\"6\",value=\".*\",type=\"simpleton\"" \
- "create global variable"
+mi_create_varobj global_simple global_simple "create global variable"
mi_runto do_locals_tests
# Desc: create local variables
-mi_gdb_test "-var-create linteger * linteger" \
- "\\^done,name=\"linteger\",numchild=\"0\",value=\".*\",type=\"int\"" \
- "create local variable linteger"
+mi_create_varobj linteger linteger "create local variable linteger"
#
# Reload the same binary.
diff --git a/gdb/testsuite/gdb.mi/mi2-var-block.exp b/gdb/testsuite/gdb.mi/mi2-var-block.exp
index 063e691..7067c8b 100644
--- a/gdb/testsuite/gdb.mi/mi2-var-block.exp
+++ b/gdb/testsuite/gdb.mi/mi2-var-block.exp
@@ -44,9 +44,7 @@ mi_runto do_block_tests
# 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_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\"" \
@@ -66,9 +64,7 @@ mi_gdb_test "-var-delete foo" \
# 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"
+mi_create_varobj "foo" "foo" "create local variable foo"
# step to "foo2 = 123;"
mi_step_to "do_block_tests" "" "var-cmd.c" \
@@ -88,9 +84,7 @@ mi_step_to "do_block_tests" "" "var-cmd.c" \
# 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"
+mi_create_varobj "inner_foo" "foo" "create local variable inner_foo"
# step to "foo2 = 0;"
mi_step_to "do_block_tests" "" "var-cmd.c" \
@@ -99,9 +93,7 @@ mi_step_to "do_block_tests" "" "var-cmd.c" \
# 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"
+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
diff --git a/gdb/testsuite/gdb.mi/mi2-var-child.exp b/gdb/testsuite/gdb.mi/mi2-var-child.exp
index 91ada0f..91f7e9f 100644
--- a/gdb/testsuite/gdb.mi/mi2-var-child.exp
+++ b/gdb/testsuite/gdb.mi/mi2-var-child.exp
@@ -53,17 +53,29 @@ mi_continue_to_line $line_dlt_first_real "step to real start of do_children_test
# 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\"" \
+mi_create_varobj "struct_declarations" "struct_declarations" \
"create local variable struct_declarations"
# Test: c_variable-4.3
# Desc: children of struct_declarations
# STABS doesn't give us argument types for the func ptr structs, but
# Dwarf 2 does.
-mi_gdb_test "-var-list-children struct_declarations" \
- "\\^done,numchild=\"11\",children=\\\[child=\{name=\"struct_declarations.integer\",exp=\"integer\",numchild=\"0\",type=\"int\"\},child=\{name=\"struct_declarations.character\",exp=\"character\",numchild=\"0\",type=\"char\"\},child={name=\"struct_declarations.char_ptr\",exp=\"char_ptr\",numchild=\"1\",type=\"char \\*\"\},child=\{name=\"struct_declarations.long_int\",exp=\"long_int\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.int_ptr_ptr\",exp=\"int_ptr_ptr\",numchild=\"1\",type=\"int \\*\\*\"\},child=\{name=\"struct_declarations.long_array\",exp=\"long_array\",numchild=\"10\",type=\"long int \\\[10\\\]\"\},child=\{name=\"struct_declarations.func_ptr\",exp=\"func_ptr\",numchild=\"0\",type=\"void \\(\\*\\)\\((void)?\\)\"\},child=\{name=\"struct_declarations.func_ptr_struct\",exp=\"func_ptr_struct\",numchild=\"0\",type=\"struct _struct_decl \\(\\*\\)\\((int, char \\*, long int)?\\)\"\},child=\{name=\"struct_declarations.func_ptr_ptr\",exp=\"func_ptr_ptr\",numchild=\"0\",type=\"struct _struct_decl \\*\\(\\*\\)\\((int, char \\*, long int)?\\)\"\},child=\{name=\"struct_declarations.u1\",exp=\"u1\",numchild=\"4\",type=\"union \{\\.\\.\\.\}\"\},child=\{name=\"struct_declarations.s2\",exp=\"s2\",numchild=\"4\",type=\"struct \{\\.\\.\\.\}\"\}\\\]" \
- "get children of struct_declarations"
+mi_list_varobj_children "struct_declarations" {
+ {struct_declarations.integer integer 0 int}
+ {struct_declarations.character character 0 char}
+ {struct_declarations.char_ptr char_ptr 1 "char \\*"}
+ {struct_declarations.long_int long_int 0 "long int"}
+ {struct_declarations.int_ptr_ptr int_ptr_ptr 1 "int \\*\\*"}
+ {struct_declarations.long_array long_array 10 "long int \\[10\\]"}
+ {struct_declarations.func_ptr func_ptr 0 "void \\(\\*\\)\\((void)?\\)"}
+ {struct_declarations.func_ptr_struct func_ptr_struct 0 \
+ "struct _struct_decl \\(\\*\\)(\\(int, char \\*, long int\\))?"}
+ {struct_declarations.func_ptr_ptr func_ptr_ptr 0 \
+ "struct _struct_decl \\*\\(\\*\\)\\((int, char \\*, long int)?\\)"}
+ {struct_declarations.u1 u1 4 "union \\{\\.\\.\\.\\}"}
+ {struct_declarations.s2 s2 4 "struct \\{\\.\\.\\.\\}"}
+} "get children of struct_declarations"
+
#gdbtk_test c_variable-4.3 {children of struct_declarations} {
# get_children struct_declarations
@@ -77,9 +89,8 @@ mi_gdb_test "-var-info-num-children struct_declarations" \
# Test: c_variable-4.5
# Desc: children of struct_declarations.integer
-mi_gdb_test "-var-list-children struct_declarations.integer" \
- "\\^done,numchild=\"0\"" \
- "get children of struct_declarations.integer"
+mi_list_varobj_children "struct_declarations.integer" {} \
+ "get children of struct_declarations.integer"
# Test: c_variable-4.6
# Desc: number of children of struct_declarations.integer
@@ -89,8 +100,7 @@ mi_gdb_test "-var-info-num-children struct_declarations.integer" \
# Test: c_variable-4.7
# Desc: children of struct_declarations.character
-mi_gdb_test "-var-list-children struct_declarations.character" \
- "\\^done,numchild=\"0\"" \
+mi_list_varobj_children "struct_declarations.character" {} \
"get children of struct_declarations.character"
# Test: c_variable-4.8
@@ -101,9 +111,9 @@ mi_gdb_test "-var-info-num-children struct_declarations.character" \
# Test: c_variable-4.9
# Desc: children of struct_declarations.char_ptr
-mi_gdb_test "-var-list-children struct_declarations.char_ptr" \
- "\\^done,numchild=\"1\",children=\\\[child=\{name=\"struct_declarations.char_ptr.\\*char_ptr\",exp=\"\\*char_ptr\",numchild=\"0\",type=\"char\"\}\\\]" \
- "get children of struct_declarations.char_ptr"
+mi_list_varobj_children "struct_declarations.char_ptr" {
+ {{struct_declarations.char_ptr.\*char_ptr} {\*char_ptr} 0 char}
+} "get children of struct_declarations.char_ptr"
# Test: c_variable-4.10
# Desc: number of children of struct_declarations.char_ptr
@@ -113,8 +123,7 @@ mi_gdb_test "-var-info-num-children struct_declarations.char_ptr" \
# Test: c_variable-4.11
# Desc: children of struct_declarations.long_int
-mi_gdb_test "-var-list-children struct_declarations.long_int" \
- "\\^done,numchild=\"0\"" \
+mi_list_varobj_children "struct_declarations.long_int" {} \
"get children of struct_declarations.long_int"
# Test: c_variable-4.12
@@ -125,9 +134,9 @@ mi_gdb_test "-var-info-num-children struct_declarations.long_int" \
# Test: c_variable-4.13
# Desc: children of int_ptr_ptr
-mi_gdb_test "-var-list-children struct_declarations.int_ptr_ptr" \
- "\\^done,numchild=\"1\",children=\\\[child=\{name=\"struct_declarations.int_ptr_ptr.\\*int_ptr_ptr\",exp=\"\\*int_ptr_ptr\",numchild=\"1\",type=\"int \\*\"\}\\\]" \
- "get children of struct_declarations.int_ptr_ptr"
+mi_list_varobj_children "struct_declarations.int_ptr_ptr" {
+ {{struct_declarations.int_ptr_ptr.\*int_ptr_ptr} {\*int_ptr_ptr} 1 {int \*}}
+} "get children of struct_declarations.int_ptr_ptr"
#gdbtk_test c_variable-4.13 {children of int_ptr_ptr} {
# get_children struct_declarations.int_ptr_ptr
@@ -142,9 +151,8 @@ mi_gdb_test "-var-info-num-children struct_declarations.int_ptr_ptr" \
# Test: c_variable-4.15
# Desc: children of struct_declarations.long_array
-mi_gdb_test "-var-list-children struct_declarations.long_array" \
- "\\^done,numchild=\"10\",children=\\\[child=\{name=\"struct_declarations.long_array.0\",exp=\"0\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.long_array.1\",exp=\"1\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.long_array.2\",exp=\"2\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.long_array.3\",exp=\"3\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.long_array.4\",exp=\"4\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.long_array.5\",exp=\"5\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.long_array.6\",exp=\"6\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.long_array.7\",exp=\"7\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.long_array.8\",exp=\"8\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.long_array.9\",exp=\"9\",numchild=\"0\",type=\"long int\"\}\\\]" \
- "get children of struct_declarations.long_array"
+mi_list_array_varobj_children "struct_declarations.long_array" 10 "long int" \
+ "get children of struct_declarations.long_array"
# Test: c_variable-4.16
# Desc: number of children of struct_declarations.long_array
@@ -154,11 +162,9 @@ mi_gdb_test "-var-info-num-children struct_declarations.long_array" \
# Test: c_variable-4.17
# Desc: children of struct_declarations.func_ptr
-mi_gdb_test "-var-list-children struct_declarations.func_ptr" \
- "\\^done,numchild=\"0\"" \
+mi_list_varobj_children "struct_declarations.func_ptr" {} \
"get children of struct_declarations.func_ptr"
-
# Test: c_variable-4.18
# Desc: number of children of struct_declarations.func_ptr
mi_gdb_test "-var-info-num-children struct_declarations.func_ptr" \
@@ -168,8 +174,7 @@ mi_gdb_test "-var-info-num-children struct_declarations.func_ptr" \
# Test: c_variable-4.19
# Desc: children of struct_declarations.func_ptr_struct
-mi_gdb_test "-var-list-children struct_declarations.func_ptr_struct" \
- "\\^done,numchild=\"0\"" \
+mi_list_varobj_children "struct_declarations.func_ptr_struct" {} \
"get children of struct_declarations.func_ptr_struct"
# Test: c_variable-4.20
@@ -181,22 +186,23 @@ mi_gdb_test "-var-info-num-children struct_declarations.func_ptr_struct" \
# Test: c_variable-4.21
# Desc: children of struct_declarations.func_ptr_ptr
-mi_gdb_test "-var-list-children struct_declarations.func_ptr_ptr" \
- "\\^done,numchild=\"0\"" \
+mi_list_varobj_children "struct_declarations.func_ptr_ptr" {} \
"get children of struct_declarations.func_ptr_ptr"
# Test: c_variable-4.22
# Desc: number of children of struct_declarations.func_ptr_ptr
mi_gdb_test "-var-info-num-children struct_declarations.func_ptr_ptr" \
- "\\^done,numchild=\"0\"" \
- "get number of children of struct_declarations.func_ptr_ptr"
-
+ "\\^done,numchild=\"0\"" \
+ "get number of children of struct_declarations.func_ptr_ptr"
# Test: c_variable-4.23
# Desc: children of struct_declarations.u1
-mi_gdb_test "-var-list-children struct_declarations.u1" \
- "\\^done,numchild=\"4\",children=\\\[child=\{name=\"struct_declarations.u1.a\",exp=\"a\",numchild=\"0\",type=\"int\"\},child=\{name=\"struct_declarations.u1.b\",exp=\"b\",numchild=\"1\",type=\"char \\*\"\},child=\{name=\"struct_declarations.u1.c\",exp=\"c\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.u1.d\",exp=\"d\",numchild=\"0\",type=\"enum foo\"\}\\\]" \
- "get children of struct_declarations.u1"
+mi_list_varobj_children "struct_declarations.u1" {
+ {struct_declarations.u1.a a 0 int}
+ {struct_declarations.u1.b b 1 {char \*}}
+ {struct_declarations.u1.c c 0 {long int}}
+ {struct_declarations.u1.d d 0 {enum foo}}
+} "get children of struct_declarations.u1"
# Test: c_variable-4.24
# Desc: number of children of struct_declarations.u1
@@ -206,9 +212,13 @@ mi_gdb_test "-var-info-num-children struct_declarations.u1" \
# Test: c_variable-4.25
# Desc: children of struct_declarations.s2
-mi_gdb_test "-var-list-children struct_declarations.s2" \
- "\\^done,numchild=\"4\",children=\\\[child=\{name=\"struct_declarations.s2.u2\",exp=\"u2\",numchild=\"3\",type=\"union \{\\.\\.\\.\}\"\},child=\{name=\"struct_declarations.s2.g\",exp=\"g\",numchild=\"0\",type=\"int\"\},child=\{name=\"struct_declarations.s2.h\",exp=\"h\",numchild=\"0\",type=\"char\"\},child=\{name=\"struct_declarations.s2.i\",exp=\"i\",numchild=\"10\",type=\"long int \\\[10\\\]\"\}\\\]" \
- "get children of struct_declarations.s2"
+mi_list_varobj_children "struct_declarations.s2" {
+ {struct_declarations.s2.u2 u2 3 {union \{\.\.\.\}}}
+ {struct_declarations.s2.g g 0 int}
+ {struct_declarations.s2.h h 0 char}
+ {struct_declarations.s2.i i 10 {long int \[10\]}}
+} "get children of struct_declarations.s2"
+
#gdbtk_test c_variable-4.25 {children of struct_declarations.s2} {
# get_children struct_declarations.s2
#} {u2 g h i}
@@ -220,119 +230,18 @@ mi_gdb_test "-var-info-num-children struct_declarations.s2" \
"get number of children of struct_declarations.s2"
-# Test: c_variable-4.27
-# Desc: children of struct_declarations.long_array.1
-mi_gdb_test "-var-list-children struct_declarations.long_array.1" \
- "\\^done,numchild=\"0\"" \
- "get children of struct_declarations.long_array.1"
-
-# Test: c_variable-4.28
-# Desc: number of children of struct_declarations.long_array.1
-mi_gdb_test "-var-info-num-children struct_declarations.long_array.1" \
- "\\^done,numchild=\"0\"" \
- "get number of children of struct_declarations.long_array.1"
-
-# Test: c_variable-4.29
-# Desc: children of struct_declarations.long_array.2
-mi_gdb_test "-var-list-children struct_declarations.long_array.2" \
- "\\^done,numchild=\"0\"" \
- "get children of struct_declarations.long_array.2"
-
-# Test: c_variable-4.30
-# Desc: number of children of struct_declarations.long_array.2
-mi_gdb_test "-var-info-num-children struct_declarations.long_array.2" \
- "\\^done,numchild=\"0\"" \
- "get number of children of struct_declarations.long_array.2"
+for {set i 1} {$i <= 9} {incr i} {
+ mi_list_varobj_children "struct_declarations.long_array.$i" {} \
+ "get children of struct_declarations.long_array.$i"
-# Test: c_variable-4.31
-# Desc: children of struct_declarations.long_array.3
-mi_gdb_test "-var-list-children struct_declarations.long_array.3" \
+ mi_gdb_test "-var-info-num-children struct_declarations.long_array.$i" \
"\\^done,numchild=\"0\"" \
- "get children of struct_declarations.long_array.3"
-
-# Test: c_variable-4.32
-# Desc: number of children of struct_declarations.long_array.3
-mi_gdb_test "-var-info-num-children struct_declarations.long_array.3" \
- "\\^done,numchild=\"0\"" \
- "get number of children of struct_declarations.long_array.3"
-
-# Test: c_variable-4.33
-# Desc: children of struct_declarations.long_array.4
-mi_gdb_test "-var-list-children struct_declarations.long_array.4" \
- "\\^done,numchild=\"0\"" \
- "get children of struct_declarations.long_array.4"
-
-# Test: c_variable-4.34
-# Desc: number of children of struct_declarations.long_array.4
-mi_gdb_test "-var-info-num-children struct_declarations.long_array.4" \
- "\\^done,numchild=\"0\"" \
- "get number of children of struct_declarations.long_array.4"
-
-# Test: c_variable-4.35
-# Desc: children of struct_declarations.long_array.5
-mi_gdb_test "-var-list-children struct_declarations.long_array.5" \
- "\\^done,numchild=\"0\"" \
- "get children of struct_declarations.long_array.5"
-
-# Test: c_variable-4.36
-# Desc: number of children of struct_declarations.long_array.5
-mi_gdb_test "-var-info-num-children struct_declarations.long_array.5" \
- "\\^done,numchild=\"0\"" \
- "get number of children of struct_declarations.long_array.5"
-
-# Test: c_variable-4.37
-# Desc: children of struct_declarations.long_array.6
-mi_gdb_test "-var-list-children struct_declarations.long_array.6" \
- "\\^done,numchild=\"0\"" \
- "get children of struct_declarations.long_array.6"
-
-# Test: c_variable-4.38
-# Desc: number of children of struct_declarations.long_array.6
-mi_gdb_test "-var-info-num-children struct_declarations.long_array.6" \
- "\\^done,numchild=\"0\"" \
- "get number of children of struct_declarations.long_array.6"
-
-# Test: c_variable-4.39
-# Desc: children of struct_declarations.long_array.7
-mi_gdb_test "-var-list-children struct_declarations.long_array.7" \
- "\\^done,numchild=\"0\"" \
- "get children of struct_declarations.long_array.7"
-
-# Test: c_variable-4.40
-# Desc: number of children of struct_declarations.long_array.7
-mi_gdb_test "-var-info-num-children struct_declarations.long_array.7" \
- "\\^done,numchild=\"0\"" \
- "get number of children of struct_declarations.long_array.7"
-
-# Test: c_variable-4.41
-# Desc: children of struct_declarations.long_array.8
-mi_gdb_test "-var-list-children struct_declarations.long_array.8" \
- "\\^done,numchild=\"0\"" \
- "get children of struct_declarations.long_array.8"
-
-# Test: c_variable-4.42
-# Desc: number of children of struct_declarations.long_array.8
-mi_gdb_test "-var-info-num-children struct_declarations.long_array.8" \
- "\\^done,numchild=\"0\"" \
- "get number of children of struct_declarations.long_array.8"
-
-
-# Test: c_variable-4.43
-# Desc: children of struct_declarations.long_array.9
-mi_gdb_test "-var-list-children struct_declarations.long_array.9" \
- "\\^done,numchild=\"0\"" \
- "get children of struct_declarations.long_array.9"
-
-# Test: c_variable-4.44
-# Desc: number of children of struct_declarations.long_array.9
-mi_gdb_test "-var-info-num-children struct_declarations.long_array.9" \
- "\\^done,numchild=\"0\"" \
- "get number of children of struct_declarations.long_array.9"
+ "get number of children of struct_declarations.long_array.$i"
+}
# Test: c_variable-4.45
# Desc: children of struct_declarations.u1.a
-mi_gdb_test "-var-list-children struct_declarations.u1.a" \
- "\\^done,numchild=\"0\"" \
+mi_list_varobj_children "struct_declarations.u1.a" {} \
"get children of struct_declarations.u1.a"
# Test: c_variable-4.46
@@ -343,9 +252,9 @@ mi_gdb_test "-var-info-num-children struct_declarations.u1.a" \
# Test: c_variable-4.47
# Desc: children of struct_declarations.u1.b
-mi_gdb_test "-var-list-children struct_declarations.u1.b" \
- "\\^done,numchild=\"1\",children=\\\[child=\{name=\"struct_declarations.u1.b.\\*b\",exp=\"\\*b\",numchild=\"0\",type=\"char\"\}\\\]" \
- "get children of struct_declarations.u1.b"
+mi_list_varobj_children "struct_declarations.u1.b" {
+ {{struct_declarations.u1.b.\*b} {\*b} 0 char}
+} "get children of struct_declarations.u1.b"
# Test: c_variable-4.48
# Desc: number of children of struct_declarations.u1.b
@@ -355,8 +264,7 @@ mi_gdb_test "-var-info-num-children struct_declarations.u1.b" \
# Test: c_variable-4.49
# Desc: children of struct_declarations.u1.c
-mi_gdb_test "-var-list-children struct_declarations.u1.c" \
- "\\^done,numchild=\"0\"" \
+mi_list_varobj_children "struct_declarations.u1.c" {} \
"get children of struct_declarations.u1.c"
# Test: c_variable-4.50
@@ -367,8 +275,7 @@ mi_gdb_test "-var-info-num-children struct_declarations.u1.c" \
# Test: c_variable-4.51
# Desc: children of struct_declarations.u1.d
-mi_gdb_test "-var-list-children struct_declarations.u1.d" \
- "\\^done,numchild=\"0\"" \
+mi_list_varobj_children "struct_declarations.u1.d" {} \
"get children of struct_declarations.u1.d"
@@ -381,9 +288,11 @@ mi_gdb_test "-var-info-num-children struct_declarations.u1.d" \
# Test: c_variable-4.53
# Desc: children of struct_declarations.s2.u2
-mi_gdb_test "-var-list-children struct_declarations.s2.u2" \
- "\\^done,numchild=\"3\",children=\\\[child=\{name=\"struct_declarations.s2.u2.u1s1\",exp=\"u1s1\",numchild=\"4\",type=\"struct \{\\.\\.\\.\}\"\},child=\{name=\"struct_declarations.s2.u2.f\",exp=\"f\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.s2.u2.u1s2\",exp=\"u1s2\",numchild=\"2\",type=\"struct \{\\.\\.\\.\}\"\}\\\]" \
- "get children of struct_declarations.s2.u2"
+mi_list_varobj_children "struct_declarations.s2.u2" {
+ {"struct_declarations.s2.u2.u1s1" "u1s1" 4 {struct \{\.\.\.\}}}
+ {struct_declarations.s2.u2.f f 0 "long int"}
+ {struct_declarations.s2.u2.u1s2 u1s2 2 {struct \{\.\.\.\}}}
+} "get children of struct_declarations.s2.u2"
# Test: c_variable-4.54
# Desc: number of children of struct_declarations.s2.u2
@@ -393,8 +302,7 @@ mi_gdb_test "-var-info-num-children struct_declarations.s2.u2" \
# Test: c_variable-4.55
# Desc: children of struct_declarations.s2.g
-mi_gdb_test "-var-list-children struct_declarations.s2.g" \
- "\\^done,numchild=\"0\"" \
+mi_list_varobj_children struct_declarations.s2.g {} \
"get children of struct_declarations.s2.g"
# Test: c_variable-4.56
@@ -406,8 +314,7 @@ mi_gdb_test "-var-info-num-children struct_declarations.s2.g" \
# Test: c_variable-4.57
# Desc: children of struct_declarations.s2.h
-mi_gdb_test "-var-list-children struct_declarations.s2.h" \
- "\\^done,numchild=\"0\"" \
+mi_list_varobj_children struct_declarations.s2.h {} \
"get children of struct_declarations.s2.h"
# Test: c_variable-4.58
@@ -419,8 +326,11 @@ mi_gdb_test "-var-info-num-children struct_declarations.s2.h" \
# Test: c_variable-4.59
# Desc: children of struct_declarations.s2.i
-mi_gdb_test "-var-list-children struct_declarations.s2.i" \
- "\\^done,numchild=\"10\",children=\\\[child=\{name=\"struct_declarations.s2.i.0\",exp=\"0\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.s2.i.1\",exp=\"1\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.s2.i.2\",exp=\"2\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.s2.i.3\",exp=\"3\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.s2.i.4\",exp=\"4\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.s2.i.5\",exp=\"5\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.s2.i.6\",exp=\"6\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.s2.i.7\",exp=\"7\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.s2.i.8\",exp=\"8\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.s2.i.9\",exp=\"9\",numchild=\"0\",type=\"long int\"\}\\\]" \
+set t {}
+for {set i 0} {$i < 10} {incr i} {
+ lappend t [list struct_declarations.s2.i.$i $i 0 "long int"]
+}
+mi_list_varobj_children struct_declarations.s2.i $t \
"get children of struct_declarations.s2.i"
# Test: c_variable-4.60
@@ -431,9 +341,12 @@ mi_gdb_test "-var-info-num-children struct_declarations.s2.i" \
# Test: c_variable-4.61
# Desc: children of struct_declarations.s2.u2.u1s1
-mi_gdb_test "-var-list-children struct_declarations.s2.u2.u1s1" \
- "\\^done,numchild=\"4\",children=\\\[child=\{name=\"struct_declarations.s2.u2.u1s1.d\",exp=\"d\",numchild=\"0\",type=\"int\"\},child=\{name=\"struct_declarations.s2.u2.u1s1.e\",exp=\"e\",numchild=\"10\",type=\"char \\\[10\\\]\"\},child=\{name=\"struct_declarations.s2.u2.u1s1.func\",exp=\"func\",numchild=\"0\",type=\"int \\*\\(\\*\\)\\((void)?\\)\"\},child=\{name=\"struct_declarations.s2.u2.u1s1.foo\",exp=\"foo\",numchild=\"0\",type=\"efoo\"\}\\\]" \
- "get children of struct_declarations.s2.u2.u1s1"
+mi_list_varobj_children struct_declarations.s2.u2.u1s1 {
+ {struct_declarations.s2.u2.u1s1.d d 0 int}
+ {struct_declarations.s2.u2.u1s1.e e 10 {char \[10\]}}
+ {struct_declarations.s2.u2.u1s1.func func 0 {int \*\(\*\)\((void)?\)}}
+ {struct_declarations.s2.u2.u1s1.foo foo 0 efoo}
+} "get children of struct_declarations.s2.u2.u1s1"
# Test: c_variable-4.62
# Desc: number of children of struct_declarations.s2.u2.u1s1
@@ -443,8 +356,7 @@ mi_gdb_test "-var-info-num-children struct_declarations.s2.u2.u1s1" \
# Test: c_variable-4.63
# Desc: children of struct_declarations.s2.u2.f
-mi_gdb_test "-var-list-children struct_declarations.s2.u2.f" \
- "\\^done,numchild=\"0\"" \
+mi_list_varobj_children struct_declarations.s2.u2.f {} \
"get children of struct_declarations.s2.u2.f"
# Test: c_variable-4.64
@@ -455,9 +367,10 @@ mi_gdb_test "-var-info-num-children struct_declarations.s2.u2.f" \
# Test: c_variable-4.65
# Desc: children of struct_declarations.s2.u2.u1s2
-mi_gdb_test "-var-list-children struct_declarations.s2.u2.u1s2" \
- "\\^done,numchild=\"2\",children=\\\[child=\{name=\"struct_declarations.s2.u2.u1s2.array_ptr\",exp=\"array_ptr\",numchild=\"2\",type=\"char \\\[2\\\]\"\},child=\{name=\"struct_declarations.s2.u2.u1s2.func\",exp=\"func\",numchild=\"0\",type=\"int \\(\\*\\)\\((int, char \\*)?\\)\"\}\\\]" \
- "get children of struct_declarations.s2.u2.u1s2"
+mi_list_varobj_children struct_declarations.s2.u2.u1s2 {
+ {struct_declarations.s2.u2.u1s2.array_ptr array_ptr 2 {char \[2\]}}
+ {struct_declarations.s2.u2.u1s2.func func 0 {int \(\*\)\((int, char \*)?\)}}
+} "get children of struct_declarations.s2.u2.u1s2"
# Test: c_variable-4.66
# Desc: number of children of struct_declarations.s2.u2.u1s2
@@ -467,8 +380,7 @@ mi_gdb_test "-var-info-num-children struct_declarations.s2.u2.u1s2" \
# Test: c_variable-4.67
# Desc: children of struct_declarations.s2.u2.u1s1.d
-mi_gdb_test "-var-list-children struct_declarations.s2.u2.u1s1.d" \
- "\\^done,numchild=\"0\"" \
+mi_list_varobj_children struct_declarations.s2.u2.u1s1.d {} \
"get children of struct_declarations.s2.u2.u1s1.d"
# Test: c_variable-4.68
@@ -479,8 +391,11 @@ mi_gdb_test "-var-info-num-children struct_declarations.s2.u2.u1s1.d" \
# Test: c_variable-4.69
# Desc: children of struct_declarations.s2.u2.u1s1.e
-mi_gdb_test "-var-list-children struct_declarations.s2.u2.u1s1.e" \
- "\\^done,numchild=\"10\",children=\\\[child=\{name=\"struct_declarations.s2.u2.u1s1.e.0\",exp=\"0\",numchild=\"0\",type=\"char\"\},child=\{name=\"struct_declarations.s2.u2.u1s1.e.1\",exp=\"1\",numchild=\"0\",type=\"char\"\},child=\{name=\"struct_declarations.s2.u2.u1s1.e.2\",exp=\"2\",numchild=\"0\",type=\"char\"\},child={name=\"struct_declarations.s2.u2.u1s1.e.3\",exp=\"3\",numchild=\"0\",type=\"char\"\},child=\{name=\"struct_declarations.s2.u2.u1s1.e.4\",exp=\"4\",numchild=\"0\",type=\"char\"\},child=\{name=\"struct_declarations.s2.u2.u1s1.e.5\",exp=\"5\",numchild=\"0\",type=\"char\"\},child=\{name=\"struct_declarations.s2.u2.u1s1.e.6\",exp=\"6\",numchild=\"0\",type=\"char\"\},child=\{name=\"struct_declarations.s2.u2.u1s1.e.7\",exp=\"7\",numchild=\"0\",type=\"char\"\},child=\{name=\"struct_declarations.s2.u2.u1s1.e.8\",exp=\"8\",numchild=\"0\",type=\"char\"\},child=\{name=\"struct_declarations.s2.u2.u1s1.e.9\",exp=\"9\",numchild=\"0\",type=\"char\"\}\\\]" \
+set t {}
+for {set i 0} {$i < 10} {incr i} {
+ lappend t [list struct_declarations.s2.u2.u1s1.e.$i $i 0 char]
+}
+mi_list_varobj_children struct_declarations.s2.u2.u1s1.e $t \
"get children of struct_declarations.s2.u2.u1s1.e"
# Test: c_variable-4.70
@@ -492,8 +407,7 @@ mi_gdb_test "-var-info-num-children struct_declarations.s2.u2.u1s1.e" \
# Test: c_variable-4.71
# Desc: children of struct_declarations.s2.u2.u1s1.func
-mi_gdb_test "-var-list-children struct_declarations.s2.u2.u1s1.func" \
- "\\^done,numchild=\"0\"" \
+mi_list_varobj_children struct_declarations.s2.u2.u1s1.func {} \
"get children of struct_declarations.s2.u2.u1s1.func"
# Test: c_variable-4.72
@@ -505,8 +419,7 @@ mi_gdb_test "-var-info-num-children struct_declarations.s2.u2.u1s1.func" \
# Test: c_variable-4.73
# Desc: children of struct_declarations.s2.u2.u1s1.foo
-mi_gdb_test "-var-list-children struct_declarations.s2.u2.u1s1.foo" \
- "\\^done,numchild=\"0\"" \
+mi_list_varobj_children struct_declarations.s2.u2.u1s1.foo {} \
"get children of struct_declarations.s2.u2.u1s1.foo"
# Test: c_variable-4.74
@@ -518,9 +431,10 @@ mi_gdb_test "-var-info-num-children struct_declarations.s2.u2.u1s1.foo" \
# Test: c_variable-4.75
# Desc: children of struct_declarations.s2.u2.u1s2.array_ptr
-mi_gdb_test "-var-list-children struct_declarations.s2.u2.u1s2.array_ptr" \
- "\\^done,numchild=\"2\",children=\\\[child=\{name=\"struct_declarations.s2.u2.u1s2.array_ptr.0\",exp=\"0\",numchild=\"0\",type=\"char\"\},child={name=\"struct_declarations.s2.u2.u1s2.array_ptr.1\",exp=\"1\",numchild=\"0\",type=\"char\"\}\\\]" \
- "get children of struct_declarations.s2.u2.u1s2.array_ptr"
+mi_list_varobj_children struct_declarations.s2.u2.u1s2.array_ptr {
+ {struct_declarations.s2.u2.u1s2.array_ptr.0 0 0 char}
+ {struct_declarations.s2.u2.u1s2.array_ptr.1 1 0 char}
+} "get children of struct_declarations.s2.u2.u1s2.array_ptr"
# Test: c_variable-4.76
# Desc: number of children of struct_declarations.s2.u2.u1s2.array_ptr
@@ -530,8 +444,7 @@ mi_gdb_test "-var-info-num-children struct_declarations.s2.u2.u1s2.array_ptr" \
# Test: c_variable-4.77
# Desc: children of struct_declarations.s2.u2.u1s2.func
-mi_gdb_test "-var-list-children struct_declarations.s2.u2.u1s2.func" \
- "\\^done,numchild=\"0\"" \
+mi_list_varobj_children struct_declarations.s2.u2.u1s2.func {} \
"get children of struct_declarations.s2.u2.u1s2.func"
# Test: c_variable-4.78
@@ -542,10 +455,10 @@ mi_gdb_test "-var-info-num-children struct_declarations.s2.u2.u1s2.func" \
# Test: c_variable-4.79
# Desc: children of struct_declarations.int_ptr_ptr.*int_ptr_ptr
-mi_gdb_test "-var-list-children struct_declarations.int_ptr_ptr.*int_ptr_ptr" \
- "\\^done,numchild=\"1\",children=\\\[child=\{name=\"struct_declarations.int_ptr_ptr.\\*int_ptr_ptr.\\*\\*int_ptr_ptr\",exp=\"\\*\\*int_ptr_ptr\",numchild=\"0\",type=\"int\"\}\\\]" \
- "get children of struct_declarations.int_ptr_ptr.*int_ptr_ptr"
-#} {**int_ptr_ptr}
+mi_list_varobj_children "struct_declarations.int_ptr_ptr.*int_ptr_ptr" {
+ {{struct_declarations.int_ptr_ptr.\*int_ptr_ptr.\*\*int_ptr_ptr} \
+ {\*\*int_ptr_ptr} 0 int}
+} "get children of struct_declarations.int_ptr_ptr.*int_ptr_ptr"
# Test: c_variable-4.80
# Desc: Number of children of struct_declarations.int_ptr_ptr.*int_ptr_ptr
@@ -561,15 +474,25 @@ mi_step_to do_children_tests {} {.*var-cmd.c} \
# 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"
+mi_create_varobj weird weird "create local variable weird"
# Test: c_variable-4.82
# Desc: children of 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 \{\\.\\.\\.\}\"\}\\\]" \
- "get children of weird"
+mi_list_varobj_children "weird" {
+ {weird.integer integer 0 int}
+ {weird.character character 0 char}
+ {weird.char_ptr char_ptr 1 "char \\*"}
+ {weird.long_int long_int 0 "long int"}
+ {weird.int_ptr_ptr int_ptr_ptr 1 "int \\*\\*"}
+ {weird.long_array long_array 10 "long int \\[10\\]"}
+ {weird.func_ptr func_ptr 0 "void \\(\\*\\)\\((void)?\\)"}
+ {weird.func_ptr_struct func_ptr_struct 0 \
+ "struct _struct_decl \\(\\*\\)(\\(int, char \\*, long int\\))?"}
+ {weird.func_ptr_ptr func_ptr_ptr 0 \
+ "struct _struct_decl \\*\\(\\*\\)\\((int, char \\*, long int)?\\)"}
+ {weird.u1 u1 4 "union \\{\\.\\.\\.\\}"}
+ {weird.s2 s2 4 "struct \\{\\.\\.\\.\\}"}
+} "get children of weird"
# Test: c_variable-4.83
# Desc: number of children of weird
@@ -580,8 +503,7 @@ mi_gdb_test "-var-info-num-children weird" \
# Test: c_variable-4.84
# Desc: children of weird->long_array
-mi_gdb_test "-var-list-children weird.long_array" \
- "\\^done,numchild=\"10\",children=\\\[child=\{name=\"weird.long_array.0\",exp=\"0\",numchild=\"0\",type=\"long int\"\},child=\{name=\"weird.long_array.1\",exp=\"1\",numchild=\"0\",type=\"long int\"\},child=\{name=\"weird.long_array.2\",exp=\"2\",numchild=\"0\",type=\"long int\"\},child=\{name=\"weird.long_array.3\",exp=\"3\",numchild=\"0\",type=\"long int\"\},child=\{name=\"weird.long_array.4\",exp=\"4\",numchild=\"0\",type=\"long int\"\},child=\{name=\"weird.long_array.5\",exp=\"5\",numchild=\"0\",type=\"long int\"\},child=\{name=\"weird.long_array.6\",exp=\"6\",numchild=\"0\",type=\"long int\"\},child=\{name=\"weird.long_array.7\",exp=\"7\",numchild=\"0\",type=\"long int\"\},child=\{name=\"weird.long_array.8\",exp=\"8\",numchild=\"0\",type=\"long int\"\},child=\{name=\"weird.long_array.9\",exp=\"9\",numchild=\"0\",type=\"long int\"\}\\\]" \
+mi_list_array_varobj_children weird.long_array 10 "long int" \
"get children of weird.long_array"
#gdbtk_test c_variable-4.84 {children of weird->long_array} {
# get_children weird.long_array
@@ -595,9 +517,9 @@ mi_gdb_test "-var-info-num-children weird.long_array" \
# Test: c_variable-4.86
# Desc: children of weird.int_ptr_ptr
-mi_gdb_test "-var-list-children weird.int_ptr_ptr" \
- "\\^done,numchild=\"1\",children=\\\[child=\{name=\"weird.int_ptr_ptr.\\*int_ptr_ptr\",exp=\"\\*int_ptr_ptr\",numchild=\"1\",type=\"int \\*\"\}\\\]" \
- "get children of weird.int_ptr_ptr"
+mi_list_varobj_children weird.int_ptr_ptr {
+ {{weird.int_ptr_ptr.\*int_ptr_ptr} {\*int_ptr_ptr} 1 {int \*}}
+} "get children of weird.int_ptr_ptr"
#gdbtk_test c_variable-4.86 {children of weird->int_ptr_ptr} {
# get_children weird.int_ptr_ptr
#} {*int_ptr_ptr}
@@ -610,9 +532,9 @@ mi_gdb_test "-var-info-num-children weird.int_ptr_ptr" \
# Test: c_variable-4.88
# Desc: children of *weird->int_ptr_ptr
-mi_gdb_test "-var-list-children weird.int_ptr_ptr.*int_ptr_ptr" \
- "\\^done,numchild=\"1\",children=\\\[child=\{name=\"weird.int_ptr_ptr.\\*int_ptr_ptr.\\*\\*int_ptr_ptr\",exp=\"\\*\\*int_ptr_ptr\",numchild=\"0\",type=\"int\"\}\\\]" \
- "get children of weird.int_ptr_ptr.*int_ptr_ptr"
+mi_list_varobj_children "weird.int_ptr_ptr.*int_ptr_ptr" {
+ {{weird.int_ptr_ptr.\*int_ptr_ptr.\*\*int_ptr_ptr} {\*\*int_ptr_ptr} 0 "int"}
+} "get children of weird.int_ptr_ptr.*int_ptr_ptr"
#gdbtk_test c_variable-4.88 {children of *weird->int_ptr_ptr} {
# get_children weird.int_ptr_ptr.*int_ptr_ptr
#} {**int_ptr_ptr}
@@ -625,16 +547,14 @@ mi_gdb_test "-var-info-num-children weird.int_ptr_ptr.*int_ptr_ptr" \
# 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 \\*\\*\"" \
+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
-mi_gdb_test "-var-list-children weird->int_ptr_ptr" \
- "\\^done,numchild=\"1\",children=\\\[child=\{name=\"weird->int_ptr_ptr.\\*weird->int_ptr_ptr\",exp=\"\\*weird->int_ptr_ptr\",numchild=\"1\",type=\"int \\*\"\}\\\]" \
- "get children of weird->int_ptr_ptr"
-
+mi_list_varobj_children "weird->int_ptr_ptr" {
+ {{weird->int_ptr_ptr.\*weird->int_ptr_ptr} {\*weird->int_ptr_ptr} 1 {int \*}}
+} "get children of weird->int_ptr_ptr"
# Test: c_variable-4.92
# Desc: number of children of (weird->int_ptr_ptr)
@@ -644,9 +564,10 @@ mi_gdb_test "-var-info-num-children weird->int_ptr_ptr" \
# Test: c_variable-4.93
# Desc: children of *(weird->int_ptr_ptr)
-mi_gdb_test "-var-list-children weird->int_ptr_ptr.*weird->int_ptr_ptr" \
- "\\^done,numchild=\"1\",children=\\\[child=\{name=\"weird->int_ptr_ptr.\\*weird->int_ptr_ptr.\\*\\*weird->int_ptr_ptr\",exp=\"\\*\\*weird->int_ptr_ptr\",numchild=\"0\",type=\"int\"\}\\\]" \
- "get children of weird->int_ptr_ptr.*weird->int_ptr_ptr"
+mi_list_varobj_children "weird->int_ptr_ptr.*weird->int_ptr_ptr" {
+ {{weird->int_ptr_ptr.\*weird->int_ptr_ptr.\*\*weird->int_ptr_ptr} \
+ {\*\*weird->int_ptr_ptr} 0 int}
+} "get children of weird->int_ptr_ptr.*weird->int_ptr_ptr"
# Test: c_variable-4.94
# Desc: number of children of *(weird->int_ptr_ptr)
@@ -656,14 +577,12 @@ mi_gdb_test "-var-info-num-children weird->int_ptr_ptr.*weird->int_ptr_ptr" \
# Test: c_variable-4.95
# Desc: children of *(*(weird->int_ptr_ptr))
-mi_gdb_test "-var-list-children weird->int_ptr_ptr.*weird->int_ptr_ptr.**weird->int_ptr_ptr" \
- "\\^done,numchild=\"0\"" \
+mi_list_varobj_children "weird->int_ptr_ptr.*weird->int_ptr_ptr.**weird->int_ptr_ptr" {} \
"get children of weird->int_ptr_ptr.*weird->int_ptr_ptr.**weird->int_ptr_ptr"
# Test: c_variable-4.96
# Desc: number of children of *(*(weird->int_ptr_ptr))
-mi_gdb_test "-var-info-num-children weird->int_ptr_ptr.*weird->int_ptr_ptr.**weird->int_ptr_ptr" \
- "\\^done,numchild=\"0\"" \
+mi_list_varobj_children "weird->int_ptr_ptr.*weird->int_ptr_ptr.**weird->int_ptr_ptr" {} \
"get number of children of weird->int_ptr_ptr.*weird->int_ptr_ptr.**weird->int_ptr_ptr"
# Test: c_variable-4.97
@@ -867,15 +786,14 @@ mi_execute_to "exec-step 43" "end-stepping-range" do_children_tests {} {.*var-cm
# 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 \\*\\*\\*\\*\"" \
+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
-mi_gdb_test "-var-list-children psnp->char_ptr" \
- "\\^done,numchild=\"1\",children=\\\[child=\{name=\"psnp->char_ptr.\\*psnp->char_ptr\",exp=\"\\*psnp->char_ptr\",numchild=\"1\",type=\"char \\*\\*\\*\"\}\\\]" \
- "get children of psnp->char_ptr"
+mi_list_varobj_children "psnp->char_ptr" {
+ {{psnp->char_ptr.\*psnp->char_ptr} {\*psnp->char_ptr} 1 {char \*\*\*}}
+} "get children of psnp->char_ptr"
# Test: c_variable-5.12
# Desc: number of children of psnp->char_ptr
@@ -885,9 +803,10 @@ mi_gdb_test "-var-info-num-children psnp->char_ptr" \
# Test: c_variable-5.13
# Desc: children of *(psnp->char_ptr)
-mi_gdb_test "-var-list-children psnp->char_ptr.*psnp->char_ptr" \
- "\\^done,numchild=\"1\",children=\\\[child=\{name=\"psnp->char_ptr.\\*psnp->char_ptr.\\*\\*psnp->char_ptr\",exp=\"\\*\\*psnp->char_ptr\",numchild=\"1\",type=\"char \\*\\*\"\}\\\]" \
- "get children of psnp->char_ptr.*psnp->char_ptr"
+mi_list_varobj_children "psnp->char_ptr.*psnp->char_ptr" {
+ {{psnp->char_ptr.\*psnp->char_ptr.\*\*psnp->char_ptr} \
+ {\*\*psnp->char_ptr} 1 {char \*\*}}
+} "get children of psnp->char_ptr.*psnp->char_ptr"
# Test: c_variable-5.14
# Desc: number of children of *(psnp->char_ptr)
@@ -897,15 +816,17 @@ mi_gdb_test "-var-info-num-children psnp->char_ptr.*psnp->char_ptr" \
# Test: c_variable-5.15
# Desc: children of *(*(psnp->char_ptr))
-mi_gdb_test "-var-list-children psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr" \
- "\\^done,numchild=\"1\",children=\\\[child=\{name=\"psnp->char_ptr.\\*psnp->char_ptr.\\*\\*psnp->char_ptr.\\*\\*\\*psnp->char_ptr\",exp=\"\\*\\*\\*psnp->char_ptr\",numchild=\"1\",type=\"char \\*\"\}\\\]" \
- "get children of psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr"
+mi_list_varobj_children "psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr" {
+ {{psnp->char_ptr.\*psnp->char_ptr.\*\*psnp->char_ptr.\*\*\*psnp->char_ptr} \
+ {\*\*\*psnp->char_ptr} 1 {char \*}}
+} "get children of psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr"
# Test: c_variable-5.15B
# Desc: children of *(*(*(psnp->char_ptr)))
-mi_gdb_test "-var-list-children psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr.***psnp->char_ptr" \
- "\\^done,numchild=\"1\",children=\\\[child=\{name=\"psnp->char_ptr.\\*psnp->char_ptr.\\*\\*psnp->char_ptr.\\*\\*\\*psnp->char_ptr.\\*\\*\\*\\*psnp->char_ptr\",exp=\"\\*\\*\\*\\*psnp->char_ptr\",numchild=\"0\",type=\"char\"\}\\\]" \
- "get children of psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr"
+mi_list_varobj_children "psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr.***psnp->char_ptr" {
+ {{psnp->char_ptr.\*psnp->char_ptr.\*\*psnp->char_ptr.\*\*\*psnp->char_ptr.\*\*\*\*psnp->char_ptr} \
+ {\*\*\*\*psnp->char_ptr} 0 char}
+} "get children of psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr.***psnp->char_ptr"
# Test: c_variable-5.16
# Desc: number of children of *(*(psnp->char_ptr))
@@ -915,9 +836,10 @@ mi_gdb_test "-var-info-num-children psnp->char_ptr.*psnp->char_ptr.**psnp->char_
# Test: c_variable-5.17
# Desc: children of *(*(*(psnp->char_ptr)))
-mi_gdb_test "-var-list-children psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr.***psnp->char_ptr" \
- "\\^done,numchild=\"1\",children=\\\[child=\{name=\"psnp->char_ptr.\\*psnp->char_ptr.\\*\\*psnp->char_ptr.\\*\\*\\*psnp->char_ptr.\\*\\*\\*\\*psnp->char_ptr\",exp=\"\\*\\*\\*\\*psnp->char_ptr\",numchild=\"0\",type=\"char\"\}\\\]" \
- "get children of psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr.***psnp->char_ptr"
+mi_list_varobj_children "psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr.***psnp->char_ptr" {
+ {{psnp->char_ptr.\*psnp->char_ptr.\*\*psnp->char_ptr.\*\*\*psnp->char_ptr.\*\*\*\*psnp->char_ptr} \
+ {\*\*\*\*psnp->char_ptr} 0 char}
+} "get children of psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr.***psnp->char_ptr"
# Test: c_variable-5.18
# Desc: number of children of *(*(*(psnp->char_ptr)))
@@ -927,8 +849,7 @@ mi_gdb_test "-var-info-num-children psnp->char_ptr.*psnp->char_ptr.**psnp->char_
# Test: c_variable-5.17B
# Desc: children of *(*(*(*(psnp->char_ptr))))
-mi_gdb_test "-var-list-children psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr.***psnp->char_ptr.****psnp->char_ptr" \
- "\\^done,numchild=\"0\"" \
+mi_list_varobj_children "psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr.***psnp->char_ptr.****psnp->char_ptr" {} \
"get children of psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr.***psnp->char_ptr.****psnp->char_ptr"
# Test: c_variable-5.18B
@@ -937,18 +858,16 @@ mi_gdb_test "-var-info-num-children psnp->char_ptr.*psnp->char_ptr.**psnp->char_
"\\^done,numchild=\"0\"" \
"get number of children of psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr.***psnp->char_ptr.****psnp->char_ptr"
-
# 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 \\*\\*\\*\\*\"" \
+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
-mi_gdb_test "-var-list-children psnp->long_ptr" \
- "\\^done,numchild=\"1\",children=\\\[child=\{name=\"psnp->long_ptr.\\*psnp->long_ptr\",exp=\"\\*psnp->long_ptr\",numchild=\"1\",type=\"long int \\*\\*\\*\"\}\\\]" \
- "get children of psnp->long_ptr"
+mi_list_varobj_children "psnp->long_ptr" {
+ {{psnp->long_ptr.\*psnp->long_ptr} {\*psnp->long_ptr} 1 {long int \*\*\*}}
+} "get children of psnp->long_ptr"
# Test: c_variable-5.21
# Desc: number of children of psnp->long_ptr
@@ -958,9 +877,9 @@ mi_gdb_test "-var-info-num-children psnp->long_ptr" \
# Test: c_variable-5.22
# Desc: children of *(psnp->long_ptr)
-mi_gdb_test "-var-list-children psnp->long_ptr.*psnp->long_ptr" \
- "\\^done,numchild=\"1\",children=\\\[child=\{name=\"psnp->long_ptr.\\*psnp->long_ptr.\\*\\*psnp->long_ptr\",exp=\"\\*\\*psnp->long_ptr\",numchild=\"1\",type=\"long int \\*\\*\"\}\\\]" \
- "get children of psnp->long_ptr.*psnp->long_ptr"
+mi_list_varobj_children "psnp->long_ptr.*psnp->long_ptr" {
+ {{psnp->long_ptr.\*psnp->long_ptr.\*\*psnp->long_ptr} {\*\*psnp->long_ptr} 1 {long int \*\*}}
+} "get children of psnp->long_ptr.*psnp->long_ptr"
# Test: c_variable-5.23
@@ -971,9 +890,10 @@ mi_gdb_test "-var-info-num-children psnp->long_ptr.*psnp->long_ptr" \
# Test: c_variable-5.24
# Desc: children of *(*(psnp->long_ptr))
-mi_gdb_test "-var-list-children psnp->long_ptr.*psnp->long_ptr.**psnp->long_ptr" \
- "\\^done,numchild=\"1\",children=\\\[child=\{name=\"psnp->long_ptr.\\*psnp->long_ptr.\\*\\*psnp->long_ptr.\\*\\*\\*psnp->long_ptr\",exp=\"\\*\\*\\*psnp->long_ptr\",numchild=\"1\",type=\"long int \\*\"\}\\\]" \
- "get children of psnp->long_ptr.*psnp->long_ptr.**psnp->long_ptr"
+mi_list_varobj_children "psnp->long_ptr.*psnp->long_ptr.**psnp->long_ptr" {
+ {{psnp->long_ptr.\*psnp->long_ptr.\*\*psnp->long_ptr.\*\*\*psnp->long_ptr} \
+ {\*\*\*psnp->long_ptr} 1 {long int \*}}
+} "get children of psnp->long_ptr.*psnp->long_ptr.**psnp->long_ptr"
# Test: c_variable-5.25
# Desc: number of children of *(*(psnp->long_ptr))
@@ -983,9 +903,10 @@ mi_gdb_test "-var-info-num-children psnp->long_ptr.*psnp->long_ptr.**psnp->long_
# Test: c_variable-5.26
# Desc: children of *(*(*(psnp->long_ptr)))
-mi_gdb_test "-var-list-children psnp->long_ptr.*psnp->long_ptr.**psnp->long_ptr.***psnp->long_ptr" \
- "\\^done,numchild=\"1\",children=\\\[child=\{name=\"psnp->long_ptr.\\*psnp->long_ptr.\\*\\*psnp->long_ptr.\\*\\*\\*psnp->long_ptr.\\*\\*\\*\\*psnp->long_ptr\",exp=\"\\*\\*\\*\\*psnp->long_ptr\",numchild=\"0\",type=\"long int\"\}\\\]" \
- "get children of psnp->long_ptr.*psnp->long_ptr.**psnp->long_ptr.***psnp->long_ptr"
+mi_list_varobj_children "psnp->long_ptr.*psnp->long_ptr.**psnp->long_ptr.***psnp->long_ptr" {
+ {{psnp->long_ptr.\*psnp->long_ptr.\*\*psnp->long_ptr.\*\*\*psnp->long_ptr.\*\*\*\*psnp->long_ptr}
+ {\*\*\*\*psnp->long_ptr} 0 {long int}}
+} "get children of psnp->long_ptr.*psnp->long_ptr.**psnp->long_ptr.***psnp->long_ptr"
# Test: c_variable-5.27
# Desc: number of children of *(*(*(psnp->long_ptr)))
@@ -995,8 +916,7 @@ mi_gdb_test "-var-info-num-children psnp->long_ptr.*psnp->long_ptr.**psnp->long_
# Test: c_variable-5.28
# Desc: children of *(*(*(*(psnp->long_ptr))))
-mi_gdb_test "-var-list-children psnp->long_ptr.*psnp->long_ptr.**psnp->long_ptr.***psnp->long_ptr.****psnp->long_ptr" \
- "\\^done,numchild=\"0\"" \
+mi_list_varobj_children "psnp->long_ptr.*psnp->long_ptr.**psnp->long_ptr.***psnp->long_ptr.****psnp->long_ptr" {} \
"get children of psnp->long_ptr.*psnp->long_ptr.**psnp->long_ptr.***psnp->long_ptr.****psnp->long_ptr"
# Test: c_variable-5.29
@@ -1005,17 +925,19 @@ mi_gdb_test "-var-info-num-children psnp->long_ptr.*psnp->long_ptr.**psnp->long_
"\\^done,numchild=\"0\"" \
"get number of children of psnp->long_ptr.*psnp->long_ptr.**psnp->long_ptr.***psnp->long_ptr.****psnp->long_ptr"
+
# 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\\\]\"" \
+mi_create_varobj "psnp->ptrs" "psnp->ptrs" \
"create local variable psnp->ptrs"
# Test: c_variable-5.31
# Desc: children of psnp->ptrs
-mi_gdb_test "-var-list-children psnp->ptrs" \
- "\\^done,numchild=\"3\",children=\\\[child=\{name=\"psnp->ptrs.0\",exp=\"0\",numchild=\"4\",type=\"struct _struct_n_pointer \\*\"\},child=\{name=\"psnp->ptrs.1\",exp=\"1\",numchild=\"4\",type=\"struct _struct_n_pointer \\*\"\},child=\{name=\"psnp->ptrs.2\",exp=\"2\",numchild=\"4\",type=\"struct _struct_n_pointer \\*\"\}\\\]" \
- "get children of psnp->ptrs"
+mi_list_varobj_children "psnp->ptrs" {
+ {psnp->ptrs.0 0 4 {struct _struct_n_pointer \*}}
+ {psnp->ptrs.1 1 4 {struct _struct_n_pointer \*}}
+ {psnp->ptrs.2 2 4 {struct _struct_n_pointer \*}}
+} "get children of psnp->ptrs"
# Test: c_variable-5.32
# Desc: number of children of psnp->ptrs
@@ -1025,9 +947,12 @@ mi_gdb_test "-var-info-num-children psnp->ptrs" \
# Test: c_variable-5.33
# Desc: children of psnp->ptrs[0]
-mi_gdb_test "-var-list-children psnp->ptrs.0" \
- "\\^done,numchild=\"4\",children=\\\[child=\{name=\"psnp->ptrs.0.char_ptr\",exp=\"char_ptr\",numchild=\"1\",type=\"char \\*\\*\\*\\*\"\},child=\{name=\"psnp->ptrs.0.long_ptr\",exp=\"long_ptr\",numchild=\"1\",type=\"long int \\*\\*\\*\\*\"\},child=\{name=\"psnp->ptrs.0.ptrs\",exp=\"ptrs\",numchild=\"3\",type=\"struct _struct_n_pointer \\*\\\[3\\\]\"\},child=\{name=\"psnp->ptrs.0.next\",exp=\"next\",numchild=\"4\",type=\"struct _struct_n_pointer \\*\"\}\\\]" \
- "get children of psnp->ptrs.0"
+mi_list_varobj_children "psnp->ptrs.0" {
+ {psnp->ptrs.0.char_ptr char_ptr 1 {char \*\*\*\*}}
+ {psnp->ptrs.0.long_ptr long_ptr 1 {long int \*\*\*\*}}
+ {psnp->ptrs.0.ptrs ptrs 3 {struct _struct_n_pointer \*\[3\]}}
+ {psnp->ptrs.0.next next 4 {struct _struct_n_pointer \*}}
+} "get children of psnp->ptrs.0"
# Test: c_variable-5.34
# Desc: number of children of psnp->ptrs[0]
@@ -1037,9 +962,12 @@ mi_gdb_test "-var-info-num-children psnp->ptrs.0" \
# Test: c_variable-5.35
# Desc: children of psnp->ptrs[0]->next
-mi_gdb_test "-var-list-children psnp->ptrs.0.next" \
- "\\^done,numchild=\"4\",children=\\\[child=\{name=\"psnp->ptrs.0.next.char_ptr\",exp=\"char_ptr\",numchild=\"1\",type=\"char \\*\\*\\*\\*\"\},child=\{name=\"psnp->ptrs.0.next.long_ptr\",exp=\"long_ptr\",numchild=\"1\",type=\"long int \\*\\*\\*\\*\"\},child=\{name=\"psnp->ptrs.0.next.ptrs\",exp=\"ptrs\",numchild=\"3\",type=\"struct _struct_n_pointer \\*\\\[3\\\]\"\},child=\{name=\"psnp->ptrs.0.next.next\",exp=\"next\",numchild=\"4\",type=\"struct _struct_n_pointer \\*\"\}\\\]" \
- "get children of psnp->ptrs.0.next"
+mi_list_varobj_children "psnp->ptrs.0.next" {
+ {psnp->ptrs.0.next.char_ptr char_ptr 1 {char \*\*\*\*}}
+ {psnp->ptrs.0.next.long_ptr long_ptr 1 {long int \*\*\*\*}}
+ {psnp->ptrs.0.next.ptrs ptrs 3 {struct _struct_n_pointer \*\[3\]}}
+ {psnp->ptrs.0.next.next next 4 {struct _struct_n_pointer \*}}
+} "get children of psnp->ptrs.0.next"
#} {char_ptr long_ptr ptrs next}
@@ -1052,9 +980,9 @@ mi_gdb_test "-var-info-num-children psnp->ptrs.0.next" \
# Test: c_variable-5.37
# Desc: children of psnp->ptrs[0]->next->char_ptr
-mi_gdb_test "-var-list-children psnp->ptrs.0.next.char_ptr" \
- "\\^done,numchild=\"1\",children=\\\[child=\{name=\"psnp->ptrs.0.next.char_ptr.\\*char_ptr\",exp=\"\\*char_ptr\",numchild=\"1\",type=\"char \\*\\*\\*\"\}\\\]" \
- "get children of psnp->ptrs.0.next.char_ptr"
+mi_list_varobj_children "psnp->ptrs.0.next.char_ptr" {
+ {{psnp->ptrs.0.next.char_ptr.\*char_ptr} {\*char_ptr} 1 {char \*\*\*}}
+} "get children of psnp->ptrs.0.next.char_ptr"
#gdbtk_test c_variable-5.37 {children of psnp->ptrs[0]->next->char_ptr} {
# get_children psnp->ptrs.0.next.char_ptr
@@ -1068,9 +996,9 @@ mi_gdb_test "-var-info-num-children psnp->ptrs.0.next.char_ptr" \
# Test: c_variable-5.39
# Desc: children of *psnp->ptrs[0]->next->char_ptr
-mi_gdb_test "-var-list-children psnp->ptrs.0.next.char_ptr.*char_ptr" \
- "\\^done,numchild=\"1\",children=\\\[child=\{name=\"psnp->ptrs.0.next.char_ptr.\\*char_ptr.\\*\\*char_ptr\",exp=\"\\*\\*char_ptr\",numchild=\"1\",type=\"char \\*\\*\"\}\\\]" \
- "get children of psnp->ptrs.0.next.char_ptr.*char_ptr"
+mi_list_varobj_children "psnp->ptrs.0.next.char_ptr.*char_ptr" {
+ {{psnp->ptrs.0.next.char_ptr.\*char_ptr.\*\*char_ptr} {\*\*char_ptr} 1 {char \*\*}}
+} "get children of psnp->ptrs.0.next.char_ptr.*char_ptr"
# Test: c_variable-5.40
# Desc: number of children of *psnp->ptrs[0]->next->char_ptr
@@ -1080,15 +1008,17 @@ mi_gdb_test "-var-info-num-children psnp->ptrs.0.next.char_ptr.*char_ptr" \
# Test: c_variable-5.41
# Desc: children of **psnp->ptrs[0]->next->char_ptr
-mi_gdb_test "-var-list-children psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr" \
- "\\^done,numchild=\"1\",children=\\\[child=\{name=\"psnp->ptrs.0.next.char_ptr.\\*char_ptr.\\*\\*char_ptr.\\*\\*\\*char_ptr\",exp=\"\\*\\*\\*char_ptr\",numchild=\"1\",type=\"char \\*\"\}\\\]" \
- "get children of psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr"
+mi_list_varobj_children "psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr" {
+ {{psnp->ptrs.0.next.char_ptr.\*char_ptr.\*\*char_ptr.\*\*\*char_ptr} \
+ {\*\*\*char_ptr} 1 {char \*}}
+} "get children of psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr"
# Test: c_variable-5.41B
# Desc: children of ***psnp->ptrs[0]->next->char_ptr
-mi_gdb_test "-var-list-children psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr.***char_ptr" \
- "\\^done,numchild=\"1\",children=\\\[child=\{name=\"psnp->ptrs.0.next.char_ptr.\\*char_ptr.\\*\\*char_ptr.\\*\\*\\*char_ptr.\\*\\*\\*\\*char_ptr\",exp=\"\\*\\*\\*\\*char_ptr\",numchild=\"0\",type=\"char\"\}\\\]" \
- "get children of psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr"
+mi_list_varobj_children "psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr.***char_ptr" {
+ {{psnp->ptrs.0.next.char_ptr.\*char_ptr.\*\*char_ptr.\*\*\*char_ptr.\*\*\*\*char_ptr} \
+ {\*\*\*\*char_ptr} 0 char}
+} "get children of psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr"
# Test: c_variable-5.42
# Desc: number of children of **psnp->ptrs[0]->next->char_ptr
@@ -1098,9 +1028,10 @@ mi_gdb_test "-var-info-num-children psnp->ptrs.0.next.char_ptr.*char_ptr.**char_
# Test: c_variable-5.43
# Desc: children of ***psnp->ptrs[0]->next->char_ptr
-mi_gdb_test "-var-list-children psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr.***char_ptr" \
- "\\^done,numchild=\"1\",children=\\\[child=\{name=\"psnp->ptrs.0.next.char_ptr.\\*char_ptr.\\*\\*char_ptr.\\*\\*\\*char_ptr.\\*\\*\\*\\*char_ptr\",exp=\"\\*\\*\\*\\*char_ptr\",numchild=\"0\",type=\"char\"\}\\\]" \
- "get children of psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr.***char_ptr"
+mi_list_varobj_children "psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr.***char_ptr" {
+ {{psnp->ptrs.0.next.char_ptr.\*char_ptr.\*\*char_ptr.\*\*\*char_ptr.\*\*\*\*char_ptr} \
+ {\*\*\*\*char_ptr} 0 char}
+} "get children of psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr.***char_ptr"
# Test: c_variable-5.44
# Desc: number of children of ***psnp->ptrs[0]->next->char_ptr
@@ -1110,8 +1041,7 @@ mi_gdb_test "-var-info-num-children psnp->ptrs.0.next.char_ptr.*char_ptr.**char_
# Test: c_variable-5.43B
# Desc: children of ****psnp->ptrs[0]->next->char_ptr
-mi_gdb_test "-var-list-children psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr.***char_ptr.****char_ptr" \
- "\\^done,numchild=\"0\"" \
+mi_list_varobj_children "psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr.***char_ptr.****char_ptr" {} \
"get children of psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr.***char_ptr"
# Test: c_variable-5.44B
@@ -1122,15 +1052,21 @@ mi_gdb_test "-var-info-num-children psnp->ptrs.0.next.char_ptr.*char_ptr.**char_
# Test: c_variable-5.45
# Desc: children of psnp->ptrs[0]->next->next
-mi_gdb_test "-var-list-children psnp->ptrs.0.next.next" \
- "\\^done,numchild=\"4\",children=\\\[child=\{name=\"psnp->ptrs.0.next.next.char_ptr\",exp=\"char_ptr\",numchild=\"1\",type=\"char \\*\\*\\*\\*\"\},child=\{name=\"psnp->ptrs.0.next.next.long_ptr\",exp=\"long_ptr\",numchild=\"1\",type=\"long int \\*\\*\\*\\*\"\},child=\{name=\"psnp->ptrs.0.next.next.ptrs\",exp=\"ptrs\",numchild=\"3\",type=\"struct _struct_n_pointer \\*\\\[3\\\]\"\},child=\{name=\"psnp->ptrs.0.next.next.next\",exp=\"next\",numchild=\"4\",type=\"struct _struct_n_pointer \\*\"\}\\\]" \
- "get children of psnp->ptrs.0.next.next"
+mi_list_varobj_children "psnp->ptrs.0.next.next" {
+ {psnp->ptrs.0.next.next.char_ptr char_ptr 1 {char \*\*\*\*}}
+ {psnp->ptrs.0.next.next.long_ptr long_ptr 1 {long int \*\*\*\*}}
+ {psnp->ptrs.0.next.next.ptrs ptrs 3 {struct _struct_n_pointer \*\[3\]}}
+ {psnp->ptrs.0.next.next.next next 4 {struct _struct_n_pointer \*}}
+} "get children of psnp->ptrs.0.next.next"
+
# Test: c_variable-5.46
# Desc: children of psnp->ptrs[0]->next->next->ptrs
-mi_gdb_test "-var-list-children psnp->ptrs.0.next.next.ptrs" \
- "\\^done,numchild=\"3\",children=\\\[child=\{name=\"psnp->ptrs.0.next.next.ptrs.0\",exp=\"0\",numchild=\"4\",type=\"struct _struct_n_pointer \\*\"\},child=\{name=\"psnp->ptrs.0.next.next.ptrs.1\",exp=\"1\",numchild=\"4\",type=\"struct _struct_n_pointer \\*\"\},child=\{name=\"psnp->ptrs.0.next.next.ptrs.2\",exp=\"2\",numchild=\"4\",type=\"struct _struct_n_pointer \\*\"\}\\\]" \
- "get children of psnp->ptrs.0.next.next.ptrs"
+mi_list_varobj_children "psnp->ptrs.0.next.next.ptrs" {
+ {psnp->ptrs.0.next.next.ptrs.0 0 4 {struct _struct_n_pointer \*}}
+ {psnp->ptrs.0.next.next.ptrs.1 1 4 {struct _struct_n_pointer \*}}
+ {psnp->ptrs.0.next.next.ptrs.2 2 4 {struct _struct_n_pointer \*}}
+} "get children of psnp->ptrs.0.next.next.ptrs"
# Step over "snp0.char_ptr = &b3;"
mi_step_to do_children_tests {} {.*var-cmd.c} \
diff --git a/gdb/testsuite/gdb.mi/mi2-var-cmd.exp b/gdb/testsuite/gdb.mi/mi2-var-cmd.exp
index c444e38..690ae3a 100644
--- a/gdb/testsuite/gdb.mi/mi2-var-cmd.exp
+++ b/gdb/testsuite/gdb.mi/mi2-var-cmd.exp
@@ -50,9 +50,7 @@ mi_gdb_load ${binfile}
# Test: c_variable-1.1
# 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"
+mi_create_varobj "global_simple" "global_simple" "create global variable"
# Test: c_variable-1.2
# Desc: Create non-existent variable
@@ -78,75 +76,46 @@ mi_continue_to_line $line_dlt_first_real "step to real start of do_locals_test"
# 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_create_varobj_checked linteger linteger 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_create_varobj_checked lpinteger lpinteger {int \*} "create local variable lpinteger"
-mi_gdb_test "-var-create lcharacter * lcharacter\[0\]" \
- "\\^done,name=\"lcharacter\",numchild=\"0\",value=\".*\",type=\"char\"" \
- "create local variable lcharacter "
+mi_create_varobj_checked lcharacter lcharacter\[0\] char "create local variable lcharacter"
-mi_gdb_test "-var-create lpcharacter * lpcharacter" \
- "\\^done,name=\"lpcharacter\",numchild=\"1\",value=\"$hex.*\",type=\"char \\*\"" \
- "create local variable lpcharacter"
+mi_create_varobj_checked lpcharacter lpcharacter {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_create_varobj_checked llong llong "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_create_varobj_checked lplong lplong {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_create_varobj_checked lfloat lfloat 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_create_varobj_checked lpfloat lpfloat {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_create_varobj_checked ldouble ldouble 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_create_varobj_checked lpdouble lpdouble {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_create_varobj_checked lsimple lsimple "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_create_varobj_checked lpsimple lpsimple {struct _simple_struct \*} "create local variable lpsimple"
-mi_gdb_test "-var-create func * func" \
- "\\^done,name=\"func\",numchild=\"0\",value=\".*\",type=\"void \\(\\*\\)\\((void|)\\)\"" \
- "create local variable func"
+mi_create_varobj_checked func func {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\"" \
+mi_create_varobj_checked lsimple.character lsimple.character "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\"" \
+mi_create_varobj_checked lsimple->integer lsimple->integer "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"
+# Desc: crate lsimple.integer
+mi_create_varobj_checked lsimple.integer lsimple.integer "int" \
+ "create lsimple.integer"
# Test: c_variable-1.9
@@ -401,13 +370,9 @@ mi_continue_to "subroutine1"
# 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_create_varobj_checked i i int "create i"
-mi_gdb_test "-var-create l * l" \
- "\\^done,name=\"l\",numchild=\"1\",value=\"$hex\",type=\"long int \\*\"" \
- "create l"
+mi_create_varobj_checked l l {long int \*} "create l"
# Test: c_variable-2.11
# Desc: create do_locals_tests local in subroutine1
@@ -542,7 +507,7 @@ mi_gdb_test "-var-delete l" \
mi_continue_to do_special_tests
mi_gdb_test "-var-create selected_a @ a" \
- {\^done,name="selected_a",numchild="0",value=".*",type="int"} \
+ {\^done,name="selected_a",numchild="0",value=".*",type="int".*} \
"create selected_a"
mi_continue_to incr_a
diff --git a/gdb/testsuite/gdb.mi/mi2-var-display.exp b/gdb/testsuite/gdb.mi/mi2-var-display.exp
index a955029..ec03da7 100644
--- a/gdb/testsuite/gdb.mi/mi2-var-display.exp
+++ b/gdb/testsuite/gdb.mi/mi2-var-display.exp
@@ -64,9 +64,7 @@ gdb_expect {
# 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"
+mi_create_varobj bar bar "create local variable bar"
# Test: c_variable-6.2
# Desc: type of variable bar
@@ -118,9 +116,7 @@ mi_gdb_test "-var-delete bar" \
# 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"
+mi_create_varobj foo foo "create local variable foo"
# Test: c_variable-6.12
# Desc: type of variable foo
@@ -178,13 +174,23 @@ mi_gdb_test "-var-delete foo" \
# 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 \{\\.\\.\\.\}\"\}\\\]" \
- "get children local variable weird"
+mi_create_varobj weird weird "create local variable weird"
+
+mi_list_varobj_children weird {
+ {weird.integer integer 0 int}
+ {weird.character character 0 char}
+ {weird.char_ptr char_ptr 1 "char \\*"}
+ {weird.long_int long_int 0 "long int"}
+ {weird.int_ptr_ptr int_ptr_ptr 1 "int \\*\\*"}
+ {weird.long_array long_array 10 "long int \\[10\\]"}
+ {weird.func_ptr func_ptr 0 "void \\(\\*\\)\\((void)?\\)"}
+ {weird.func_ptr_struct func_ptr_struct 0 \
+ "struct _struct_decl \\(\\*\\)(\\(int, char \\*, long int\\))?"}
+ {weird.func_ptr_ptr func_ptr_ptr 0 \
+ "struct _struct_decl \\*\\(\\*\\)\\((int, char \\*, long int)?\\)"}
+ {weird.u1 u1 4 "union \\{\\.\\.\\.\\}"}
+ {weird.s2 s2 4 "struct \\{\\.\\.\\.\\}"}
+} "get children local variable weird"
# Test: c_variable-6.23
@@ -343,9 +349,7 @@ gdb_expect {
# 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"
+mi_create_varobj u u "create local variable u"
# Test: c_variable-7.11
# Desc: value of u
@@ -373,15 +377,14 @@ mi_gdb_test "-var-info-num-children u" \
# Test: c_variable-7.15
# Desc: children of u
-mi_gdb_test "-var-list-children u" \
- "\\^done,numchild=\"2\",children=\\\[child=\{name=\"u.integer\",exp=\"integer\",numchild=\"0\",type=\"int\"\},child=\{name=\"u.char_ptr\",exp=\"char_ptr\",numchild=\"1\",type=\"char \\*\"\}\\\]" \
- "get children of u"
+mi_list_varobj_children u {
+ {u.integer integer 0 int}
+ {u.char_ptr char_ptr 1 {char \*}}
+} "get children of u"
# 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"
+mi_create_varobj anonu anonu "create local variable anonu"
# Test: c_variable-7.21
# Desc: value of anonu
@@ -409,15 +412,15 @@ mi_gdb_test "-var-info-num-children anonu" \
# Test: c_variable-7.25
# Desc: children of anonu
-mi_gdb_test "-var-list-children anonu" \
- "\\^done,numchild=\"3\",children=\\\[child=\{name=\"anonu.a\",exp=\"a\",numchild=\"0\",type=\"int\"\},child=\{name=\"anonu.b\",exp=\"b\",numchild=\"0\",type=\"char\"\},child=\{name=\"anonu.c\",exp=\"c\",numchild=\"0\",type=\"long int\"\}\\\]" \
- "get children of anonu"
+mi_list_varobj_children "anonu" {
+ {anonu.a a 0 int}
+ {anonu.b b 0 char}
+ {anonu.c c 0 "long int"}
+} "get children of anonu"
# 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"
+mi_create_varobj s s "create local variable s"
# Test: c_variable-7.31
@@ -446,16 +449,19 @@ mi_gdb_test "-var-info-num-children s" \
# Test: c_variable-7.35
# Desc: children of s
-mi_gdb_test "-var-list-children s" \
- "\\^done,numchild=\"6\",children=\\\[child=\{name=\"s.integer\",exp=\"integer\",numchild=\"0\",type=\"int\"\},child=\{name=\"s.unsigned_integer\",exp=\"unsigned_integer\",numchild=\"0\",type=\"unsigned int\"\},child=\{name=\"s.character\",exp=\"character\",numchild=\"0\",type=\"char\"\},child=\{name=\"s.signed_character\",exp=\"signed_character\",numchild=\"0\",type=\"signed char\"\},child=\{name=\"s.char_ptr\",exp=\"char_ptr\",numchild=\"1\",type=\"char \\*\"\},child=\{name=\"s.array_of_10\",exp=\"array_of_10\",numchild=\"10\",type=\"int \\\[10\\\]\"\}\\\]" \
- "get children of s"
+mi_list_varobj_children s {
+ {s.integer integer 0 int}
+ {s.unsigned_integer unsigned_integer 0 "unsigned int"}
+ {s.character character 0 char}
+ {s.signed_character signed_character 0 "signed char"}
+ {s.char_ptr char_ptr 1 {char \*}}
+ {s.array_of_10 array_of_10 10 {int \[10\]}}
+} "get children of s"
#} {integer unsigned_integer character signed_character char_ptr array_of_10}
# 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"
+mi_create_varobj anons anons "create local variable anons"
# Test: c_variable-7.41
# Desc: value of anons
@@ -483,16 +489,15 @@ mi_gdb_test "-var-info-num-children anons" \
# Test: c_variable-7.45
# Desc: children of anons
-mi_gdb_test "-var-list-children anons" \
- "\\^done,numchild=\"3\",children=\\\[child=\{name=\"anons.a\",exp=\"a\",numchild=\"0\",type=\"int\"\},child=\{name=\"anons.b\",exp=\"b\",numchild=\"0\",type=\"char\"\},child=\{name=\"anons.c\",exp=\"c\",numchild=\"0\",type=\"long int\"\}\\\]" \
- "get children of anons"
-
+mi_list_varobj_children anons {
+ {anons.a a 0 int}
+ {anons.b b 0 char}
+ {anons.c c 0 "long int"}
+} "get children of anons"
# 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"
+mi_create_varobj e e "create local variable e"
setup_xfail "*-*-*"
# Test: c_variable-7.51
@@ -528,9 +533,7 @@ mi_gdb_test "-var-list-children e" \
# 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"
+mi_create_varobj anone anone "create local variable anone"
setup_xfail "*-*-*"
# Test: c_variable-7.61
@@ -610,11 +613,11 @@ gdb_expect {
# 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\"" \
+ "\\^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\"" \
+ "\\^done,name=\"a2\",numchild=\"0\",value=\".*\",type=\"int\".*" \
"create variable a2 in different scope"
#gdbtk_test c_variable-7.81 {create variables in different scopes} {
diff --git a/gdb/testsuite/lib/mi-support.exp b/gdb/testsuite/lib/mi-support.exp
index a67b0cc..4941e3a 100644
--- a/gdb/testsuite/lib/mi-support.exp
+++ b/gdb/testsuite/lib/mi-support.exp
@@ -1020,6 +1020,14 @@ proc mi_create_varobj { name expression testname } {
$testname
}
+# Same as mi_create_varobj, but also checks the reported type
+# of the varobj.
+proc mi_create_varobj_checked { name expression type testname } {
+ mi_gdb_test "-var-create $name * $expression" \
+ "\\^done,name=\"$name\",numchild=\"\[0-9\]+\",value=\".*\",type=\"$type\".*" \
+ $testname
+}
+
# Deletes the specified NAME.
proc mi_delete_varobj { name testname } {
mi_gdb_test "-var-delete $name" \
@@ -1071,10 +1079,19 @@ proc mi_check_varobj_value { name value testname } {
# - Type
#
# If inner list has 3 elements, the gdb is expected to output no
-# type for a child.
+# type for a child and no value.
+#
+# If the inner list has 4 elements, gdb output is expected to
+# have no value.
#
proc mi_list_varobj_children { varname children testname } {
+ set options ""
+ if {[llength $varname] == 2} {
+ set options [lindex $varname 1]
+ set varname [lindex $varname 0]
+ }
+
set numchildren [llength $children]
set children_exp {}
set whatever "\"\[^\"\]+\""
@@ -1084,22 +1101,42 @@ proc mi_list_varobj_children { varname children testname } {
set name [lindex $item 0]
set exp [lindex $item 1]
set numchild [lindex $item 2]
- if {[llength $item] == 4} {
+ if {[llength $item] == 5} {
set type [lindex $item 3]
+ set value [lindex $item 4]
lappend children_exp\
- "child={name=\"$name\",exp=\"$exp\",numchild=\"$numchild\",type=\"$type\"}"
+ "child={name=\"$name\",exp=\"$exp\",numchild=\"$numchild\",value=\"$value\",type=\"$type\"\(,thread-id=\"\[0-9\]+\")?}"
+ } elseif {[llength $item] == 4} {
+ set type [lindex $item 3]
+
+ lappend children_exp\
+ "child={name=\"$name\",exp=\"$exp\",numchild=\"$numchild\",type=\"$type\"\(,thread-id=\"\[0-9\]+\")?}"
} else {
lappend children_exp\
- "child={name=\"$name\",exp=\"$exp\",numchild=\"$numchild\"}"
+ "child={name=\"$name\",exp=\"$exp\",numchild=\"$numchild\"(,thread-id=\"\[0-9\]+\")?}"
}
}
set children_exp_j [join $children_exp ","]
- set expected "\\^done,numchild=\"$numchildren\",children=\\\[$children_exp_j\\\]"
+ if {$numchildren} {
+ set expected "\\^done,numchild=\".*\",children=\\\[$children_exp_j.*\\\]"
+ } {
+ set expected "\\^done,numchild=\"0\""
+ }
verbose -log "Expecting: $expected"
- mi_gdb_test "-var-list-children $varname" $expected $testname
+ mi_gdb_test "-var-list-children $options $varname" $expected $testname
+}
+
+# Verifies that variable object VARNAME has NUMBER children,
+# where each one is named $VARNAME.<index-of-child> and has type TYPE.
+proc mi_list_array_varobj_children { varname number type testname } {
+ set t {}
+ for {set i 0} {$i < $number} {incr i} {
+ lappend t [list $varname.$i $i 0 $type]
+ }
+ mi_list_varobj_children $varname $t $testname
}
# A list of two-element lists. First element of each list is