Commit | Line | Data |
---|---|---|
e2882c85 | 1 | # Copyright 2002-2018 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 | 15 | |
8038ed97 KS |
16 | # |
17 | # test gdb/701 | |
18 | # | |
19 | ||
20 | load_lib mi-support.exp | |
21 | set MIFLAGS "-i=mi" | |
22 | ||
23 | gdb_exit | |
24 | if [mi_gdb_start] { | |
25 | continue | |
26 | } | |
27 | ||
298a9cf0 TT |
28 | standard_testfile |
29 | ||
8038ed97 | 30 | if {[gdb_compile $srcdir/$subdir/$srcfile $binfile executable debug] != ""} { |
84c93cd5 | 31 | untested "failed to compile" |
b60f0898 | 32 | return -1 |
8038ed97 KS |
33 | } |
34 | ||
35 | # When varobj reports the types of objects, it often isn't really reporting | |
36 | # the type as GDB knows it. For example, in this testcase, we have a | |
37 | # structure which has been typedefed. A varobj of this type would really have | |
38 | # a type of "TYPE_CODE_TYPEDEF". It's target type is "TYPE_CODE_STRUCT". Varobj | |
39 | # should skip over the TYPEDEF type when figuring out the varobj's children. | |
40 | # If it doesn't, Bad Things Happen(TM). | |
41 | ||
42 | # Run to main | |
43 | mi_run_to_main | |
44 | ||
45 | # Step over "foo = 0" | |
46 | mi_next "step over \"foo = 0\"" | |
47 | ||
9e8e3afe | 48 | mi_create_varobj "fooPtr" "foo" "create fooPtr" |
8038ed97 KS |
49 | |
50 | mi_gdb_test "-var-list-children fooPtr" \ | |
51 | "(&\".*\"\r\n)*\\^done,numchild=\"3\",.*" \ | |
52 | "list children of fooPtr" | |
53 | ||
54 | foreach i [list x y z] { | |
55 | mi_gdb_test "-var-list-children fooPtr.$i" \ | |
0cc7d26f | 56 | "(&\".*\"\r\n)*\\^done,numchild=\"0\",has_more=\"0\"" \ |
8038ed97 KS |
57 | "list children of fooPtr.$i" |
58 | } | |
59 | ||
60 | mi_gdb_exit | |
61 | return 0 |