2008-01-01 22:53:26 +00:00
|
|
|
# Copyright 2002, 2003, 2007, 2008 Free Software Foundation, Inc.
|
2002-11-05 22:31:32 +00:00
|
|
|
|
|
|
|
# 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
|
2007-08-23 18:14:19 +00:00
|
|
|
# the Free Software Foundation; either version 3 of the License, or
|
2002-11-05 22:31:32 +00:00
|
|
|
# (at your option) any later version.
|
2007-08-23 18:14:19 +00:00
|
|
|
#
|
2002-11-05 22:31:32 +00:00
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
2007-08-23 18:14:19 +00:00
|
|
|
#
|
2002-11-05 22:31:32 +00:00
|
|
|
# You should have received a copy of the GNU General Public License
|
2007-08-23 18:14:19 +00:00
|
|
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
2002-11-05 22:31:32 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# test gdb/792
|
|
|
|
#
|
|
|
|
|
2003-04-08 21:48:40 +00:00
|
|
|
if { [skip_cplus_tests] } { continue }
|
|
|
|
|
2002-11-05 22:31:32 +00:00
|
|
|
load_lib mi-support.exp
|
|
|
|
set MIFLAGS "-i=mi"
|
|
|
|
|
|
|
|
gdb_exit
|
|
|
|
if [mi_gdb_start] {
|
|
|
|
continue
|
|
|
|
}
|
|
|
|
|
|
|
|
set testfile gdb792
|
|
|
|
set srcfile "$testfile.cc"
|
|
|
|
set binfile $objdir/$subdir/$testfile
|
|
|
|
|
|
|
|
if [get_compiler_info ${binfile} "c++"] {
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
if {[gdb_compile $srcdir/$subdir/$srcfile $binfile executable {debug c++}] != ""} {
|
2006-08-10 05:27:22 +00:00
|
|
|
untested gdb792.exp
|
|
|
|
return -1
|
2002-11-05 22:31:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
# Test that children of classes are properly reported
|
|
|
|
|
|
|
|
# Run to main
|
|
|
|
mi_run_to_main
|
|
|
|
|
2008-03-26 13:24:22 +00:00
|
|
|
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"
|
2002-11-05 22:31:32 +00:00
|
|
|
|
|
|
|
mi_gdb_exit
|
|
|
|
return 0
|