1 # Copyright 2002-2023 Free Software Foundation, Inc.
3 # This program is free software; you can redistribute it and/or modify
4 # it under the terms of the GNU General Public License as published by
5 # the Free Software Foundation; either version 3 of the License, or
6 # (at your option) any later version.
8 # This program is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # GNU General Public License for more details.
13 # You should have received a copy of the GNU General Public License
14 # along with this program. If not, see <http://www.gnu.org/licenses/>.
16 # Test that children of classes are properly reported. Regression
19 if { [skip_cplus_tests] } { continue }
21 load_lib mi-support.exp
26 if {[gdb_compile $srcdir/$subdir/$srcfile $binfile executable {debug c++}] != ""} {
27 untested "failed to compile"
31 mi_clean_restart $binfile
35 mi_create_varobj "var1" "a" "create var for class A"
37 mi_list_varobj_children "var1" {
38 {var1.public public 2}
39 {var1.private private 2}
40 {var1.protected protected 2}
41 } "list children of class A"
43 mi_list_varobj_children "var1.public" {
44 {var1.public.x x 0 int}
45 {var1.public.buffer buffer 10 {char \[10\]}}
46 } "list children of A.public"
48 mi_list_varobj_children "var1.private" {
49 {var1.private.u u 0 int}
50 {var1.private.z z 0 float}
51 } "list children of A.private"
53 mi_list_varobj_children "var1.protected" {
54 {var1.protected.y y 0 int}
55 {var1.protected.b b 2 B}
56 } "list children of A.protected"
58 mi_list_varobj_children "var1.protected.b" {
59 {var1.protected.b.public public 2}
60 {var1.protected.b.private private 1}
61 } "list children of A.protected.b"
63 mi_list_varobj_children "var1.protected.b.public" {
64 {var1.protected.b.public.bx bx 0 int}
65 {var1.protected.b.public.by by 0 int}
66 } "list children of A.protected.b.public"
68 mi_list_varobj_children "var1.protected.b.private" {
69 {var1.protected.b.private.k k 0 int}
70 } "list children of A.protected.b.private"
72 mi_create_varobj "var2" "c" "create var for class C which has baseclass A"
74 mi_list_varobj_children "var2" {
76 {var2.public public 1}
77 {var2.private private 1}
78 } "list children of class C"