2004-08-09 Michael Chastain <mec.gnu@mindspring.com>
* gdb.mi/gdb792.exp, gdb.mi/mi-basics.exp, gdb.mi/mi-break.exp,
gdb.mi/mi-console.exp, gdb.mi/mi-disassemble.exp,
gdb.mi/mi-eval.exp, gdb.mi/mi-file.exp, gdb.mi/mi-hack-cli.exp,
gdb.mi/mi-read-memory.exp, gdb.mi/mi-regs.exp,
gdb.mi/mi-return.exp, gdb.mi/mi-simplerun.exp,
gdb.mi/mi-stack.exp, gdb.mi/mi-stepi.exp, gdb.mi/mi-until.exp,
gdb.mi/mi-var-block.exp, gdb.mi/mi-var-child.exp,
gdb.mi/mi-var-cmd.exp, gdb.mi/mi-var-display.exp,
gdb.mi/mi-watch.exp: Update copyright years.
2004-08-09 16:32:44 +00:00
|
|
|
# Copyright 2002, 2003 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
|
|
|
|
# the Free Software Foundation; either version 2 of the License, or
|
|
|
|
# (at your option) any later version.
|
|
|
|
#
|
|
|
|
# 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.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
# along with this program; if not, write to the Free Software
|
|
|
|
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
|
|
|
|
# Please email any bugs, comments, and/or additions to this file to:
|
|
|
|
# bug-gdb@prep.ai.mit.edu
|
|
|
|
|
|
|
|
#
|
|
|
|
# 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
|
|
|
|
|
|
|
|
mi_gdb_test "-var-create - * a" \
|
|
|
|
"(&\".*\"\r\n)*\\^done,name=\"var1\",numchild=\"3\",type=\"A\"" \
|
|
|
|
"create var for class A"
|
|
|
|
|
|
|
|
mi_gdb_test "-var-list-children var1" \
|
2003-02-02 06:24:04 +00:00
|
|
|
"(&\".*\"\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\"\}\\\]" \
|
2002-11-05 22:31:32 +00:00
|
|
|
"list children of class A"
|
|
|
|
|
|
|
|
mi_gdb_test "-var-list-children var1.public" \
|
2003-02-02 06:24:04 +00:00
|
|
|
"(&\".*\"\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\\\]\"\}\\\]" \
|
2002-11-05 22:31:32 +00:00
|
|
|
"list children of A.public"
|
|
|
|
|
|
|
|
mi_gdb_test "-var-list-children var1.private" \
|
2003-02-02 06:24:04 +00:00
|
|
|
"(&\".*\"\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\"\}\\\]" \
|
2002-11-05 22:31:32 +00:00
|
|
|
"list children of A.private"
|
|
|
|
|
|
|
|
mi_gdb_test "-var-list-children var1.protected" \
|
2003-02-02 06:24:04 +00:00
|
|
|
"(&\".*\"\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\"\}\\\]" \
|
2002-11-05 22:31:32 +00:00
|
|
|
"list children of A.protected"
|
|
|
|
|
|
|
|
mi_gdb_test "-var-list-children var1.protected.b" \
|
2003-02-02 06:24:04 +00:00
|
|
|
"(&\".*\"\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\"\}\\\]" \
|
2002-11-05 22:31:32 +00:00
|
|
|
"list children of A.protected.b"
|
|
|
|
|
|
|
|
mi_gdb_test "-var-list-children var1.protected.b.public" \
|
2003-02-02 06:24:04 +00:00
|
|
|
"(&\".*\"\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\"\}\\\]" \
|
2002-11-05 22:31:32 +00:00
|
|
|
"list children of A.protected.b.public"
|
|
|
|
|
|
|
|
mi_gdb_test "-var-list-children var1.protected.b.private" \
|
2003-02-02 06:24:04 +00:00
|
|
|
"(&\".*\"\r\n)*\\^done,numchild=\"1\",children=\\\[child=\{name=\"var1\.protected\.b\.private\.k\",exp=\"k\",numchild=\"0\",type=\"int\"\}\\\]" \
|
2002-11-05 22:31:32 +00:00
|
|
|
"list children of A.protected.b.private"
|
|
|
|
|
|
|
|
mi_gdb_test "-var-create - * c" \
|
|
|
|
"(&\".*\"\r\n)*\\^done,name=\"var2\",numchild=\"3\",type=\"C\"" \
|
|
|
|
"create var for class C which has baseclass A"
|
|
|
|
|
|
|
|
mi_gdb_test "-var-list-children var2" \
|
2003-02-02 06:24:04 +00:00
|
|
|
"(&\".*\"\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\"\}\\\]" \
|
2002-11-05 22:31:32 +00:00
|
|
|
"list children of class C"
|
|
|
|
|
|
|
|
mi_gdb_exit
|
|
|
|
return 0
|