Fixup testcases outputting own name as a test name and standardize failed compilation...
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.mi / gdb792.exp
index 748c86ebe7877dfb693cc387f31720627d6a2684..e723800adf2794a5dc03d1c53c0000760da5921b 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright 2002, 2003, 2007 Free Software Foundation, Inc.
+# Copyright 2002-2016 Free Software Foundation, Inc.
 
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -13,9 +13,6 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-# Please email any bugs, comments, and/or additions to this file to:
-# bug-gdb@prep.ai.mit.edu
-
 #
 # test gdb/792
 #
@@ -30,16 +27,14 @@ if [mi_gdb_start] {
     continue
 }
 
-set testfile gdb792
-set srcfile "$testfile.cc"
-set binfile $objdir/$subdir/$testfile
+standard_testfile .cc
 
-if [get_compiler_info ${binfile} "c++"] {
-    return -1;
+if [get_compiler_info "c++"] {
+    return -1
 }
 
 if {[gdb_compile $srcdir/$subdir/$srcfile $binfile executable {debug c++}] != ""} {
-  untested gdb792.exp
+  untested "failed to compile"
   return -1
 }
 
@@ -48,45 +43,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
This page took 0.028488 seconds and 4 git commands to generate.