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