Updated copyright notices for most files.
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.mi / gdb701.exp
CommitLineData
9b254dd1 1# Copyright 2002, 2007, 2008 Free Software Foundation, Inc.
8038ed97
KS
2
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
e22f8b7c 5# the Free Software Foundation; either version 3 of the License, or
8038ed97 6# (at your option) any later version.
e22f8b7c 7#
8038ed97
KS
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.
e22f8b7c 12#
8038ed97 13# You should have received a copy of the GNU General Public License
e22f8b7c 14# along with this program. If not, see <http://www.gnu.org/licenses/>.
8038ed97
KS
15
16# Please email any bugs, comments, and/or additions to this file to:
17# bug-gdb@prep.ai.mit.edu
18
19#
20# test gdb/701
21#
22
23load_lib mi-support.exp
24set MIFLAGS "-i=mi"
25
26gdb_exit
27if [mi_gdb_start] {
28 continue
29}
30
31set testfile gdb701
32set srcfile "$testfile.c"
33set binfile $objdir/$subdir/$testfile
34if {[gdb_compile $srcdir/$subdir/$srcfile $binfile executable debug] != ""} {
b60f0898
JB
35 untested gdb701.exp
36 return -1
8038ed97
KS
37}
38
39# When varobj reports the types of objects, it often isn't really reporting
40# the type as GDB knows it. For example, in this testcase, we have a
41# structure which has been typedefed. A varobj of this type would really have
42# a type of "TYPE_CODE_TYPEDEF". It's target type is "TYPE_CODE_STRUCT". Varobj
43# should skip over the TYPEDEF type when figuring out the varobj's children.
44# If it doesn't, Bad Things Happen(TM).
45
46# Run to main
47mi_run_to_main
48
49# Step over "foo = 0"
50mi_next "step over \"foo = 0\""
51
3fddb3ad
NR
52mi_gdb_test "-var-create fooPtr * foo" \
53 "(&\".*\"\r\n)*\\^done,name=\"fooPtr\",numchild=\"3\",value=\".*\",type=\"Foo \\*\"" \
54 "create fooPtr"
8038ed97
KS
55
56mi_gdb_test "-var-list-children fooPtr" \
57 "(&\".*\"\r\n)*\\^done,numchild=\"3\",.*" \
58 "list children of fooPtr"
59
60foreach i [list x y z] {
61 mi_gdb_test "-var-list-children fooPtr.$i" \
62 "(&\".*\"\r\n)*\\^done,numchild=\"0\"" \
63 "list children of fooPtr.$i"
64}
65
66mi_gdb_exit
67return 0
This page took 0.501539 seconds and 4 git commands to generate.