1 |
578 |
markom |
# Copyright (C) 1999 2000 Cygnus Solutions
|
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 |
|
|
# Test essential Machine interface (MI) operations
|
21 |
|
|
#
|
22 |
|
|
# Verify that, using the MI, we can create, update, delete variables.
|
23 |
|
|
#
|
24 |
|
|
|
25 |
|
|
|
26 |
|
|
load_lib mi-support.exp
|
27 |
|
|
set MIFLAGS "-i=mi0"
|
28 |
|
|
|
29 |
|
|
gdb_exit
|
30 |
|
|
if [mi_gdb_start] {
|
31 |
|
|
continue
|
32 |
|
|
}
|
33 |
|
|
|
34 |
|
|
set testfile "var-cmd"
|
35 |
|
|
set srcfile ${testfile}.c
|
36 |
|
|
set binfile ${objdir}/${subdir}/${testfile}
|
37 |
|
|
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-DFAKEARGV}] != "" } {
|
38 |
|
|
gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
|
39 |
|
|
}
|
40 |
|
|
|
41 |
|
|
mi_delete_breakpoints
|
42 |
|
|
mi_gdb_reinitialize_dir $srcdir/$subdir
|
43 |
|
|
mi_gdb_load ${binfile}
|
44 |
|
|
|
45 |
|
|
mi_gdb_test "200-break-insert do_children_tests" \
|
46 |
|
|
"200\\^done,bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"do_children_tests\",file=\".*var-cmd.c\",line=\"190\",times=\"0\"\}" \
|
47 |
|
|
"break-insert operation"
|
48 |
|
|
|
49 |
|
|
mi_run_cmd
|
50 |
|
|
# The running part has been checked already by mi_run_cmd
|
51 |
|
|
gdb_expect {
|
52 |
|
|
-re "\[\r\n\]*000\\*stopped,reason=\"breakpoint-hit\",bkptno=\"1\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\{\},file=\".*var-cmd.c\",line=\"190\"\}\r\n$mi_gdb_prompt$" {
|
53 |
|
|
pass "run to do_children_tests"
|
54 |
|
|
}
|
55 |
|
|
-re ".*$mi_gdb_prompt$" {fail "run to do_children_tests (2)"}
|
56 |
|
|
timeout {fail "run to do_children_tests (timeout 2)"}
|
57 |
|
|
}
|
58 |
|
|
|
59 |
|
|
##### #####
|
60 |
|
|
# #
|
61 |
|
|
# children tests #
|
62 |
|
|
# #
|
63 |
|
|
##### #####
|
64 |
|
|
|
65 |
|
|
|
66 |
|
|
# Test: c_variable-4.2
|
67 |
|
|
# Desc: create variable "struct_declarations"
|
68 |
|
|
mi_gdb_test "-var-create struct_declarations * struct_declarations" \
|
69 |
|
|
"\\^done,name=\"struct_declarations\",numchild=\"11\",type=\"struct _struct_decl\"" \
|
70 |
|
|
"create local variable struct_declarations"
|
71 |
|
|
|
72 |
|
|
# Test: c_variable-4.3
|
73 |
|
|
# Desc: children of struct_declarations
|
74 |
|
|
mi_gdb_test "-var-list-children struct_declarations" \
|
75 |
|
|
"\\^done,numchild=\"11\",children=\{child=\{name=\"struct_declarations.integer\",exp=\"integer\",numchild=\"0\",type=\"int\"\},child=\{name=\"struct_declarations.character\",exp=\"character\",numchild=\"0\",type=\"char\"\},child={name=\"struct_declarations.char_ptr\",exp=\"char_ptr\",numchild=\"1\",type=\"char \\*\"\},child=\{name=\"struct_declarations.long_int\",exp=\"long_int\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.int_ptr_ptr\",exp=\"int_ptr_ptr\",numchild=\"1\",type=\"int \\*\\*\"\},child=\{name=\"struct_declarations.long_array\",exp=\"long_array\",numchild=\"10\",type=\"long int \\\[10\\\]\"\},child=\{name=\"struct_declarations.func_ptr\",exp=\"func_ptr\",numchild=\"0\",type=\"void \\(\\*\\)\\(\\)\"\},child=\{name=\"struct_declarations.func_ptr_struct\",exp=\"func_ptr_struct\",numchild=\"0\",type=\"struct _struct_decl \\(\\*\\)\\(\\)\"\},child=\{name=\"struct_declarations.func_ptr_ptr\",exp=\"func_ptr_ptr\",numchild=\"0\",type=\"struct _struct_decl \\*\\(\\*\\)\\(\\)\"\},child=\{name=\"struct_declarations.u1\",exp=\"u1\",numchild=\"4\",type=\"union \{\\.\\.\\.\}\"\},child=\{name=\"struct_declarations.s2\",exp=\"s2\",numchild=\"4\",type=\"struct \{\\.\\.\\.\}\"\}\}" \
|
76 |
|
|
"get children of struct_declarations"
|
77 |
|
|
|
78 |
|
|
#gdbtk_test c_variable-4.3 {children of struct_declarations} {
|
79 |
|
|
# get_children struct_declarations
|
80 |
|
|
#} {integer character char_ptr long_int int_ptr_ptr long_array func_ptr func_ptr_struct func_ptr_ptr u1 s2}
|
81 |
|
|
|
82 |
|
|
# Test: c_variable-4.4
|
83 |
|
|
# Desc: number of children of struct_declarations
|
84 |
|
|
mi_gdb_test "-var-info-num-children struct_declarations" \
|
85 |
|
|
"\\^done,numchild=\"11\"" \
|
86 |
|
|
"get number of children of struct_declarations"
|
87 |
|
|
|
88 |
|
|
# Test: c_variable-4.5
|
89 |
|
|
# Desc: children of struct_declarations.integer
|
90 |
|
|
mi_gdb_test "-var-list-children struct_declarations.integer" \
|
91 |
|
|
"\\^done,numchild=\"0\"" \
|
92 |
|
|
"get children of struct_declarations.integer"
|
93 |
|
|
|
94 |
|
|
# Test: c_variable-4.6
|
95 |
|
|
# Desc: number of children of struct_declarations.integer
|
96 |
|
|
mi_gdb_test "-var-info-num-children struct_declarations.integer" \
|
97 |
|
|
"\\^done,numchild=\"0\"" \
|
98 |
|
|
"get number of children of struct_declarations.integer"
|
99 |
|
|
|
100 |
|
|
# Test: c_variable-4.7
|
101 |
|
|
# Desc: children of struct_declarations.character
|
102 |
|
|
mi_gdb_test "-var-list-children struct_declarations.character" \
|
103 |
|
|
"\\^done,numchild=\"0\"" \
|
104 |
|
|
"get children of struct_declarations.character"
|
105 |
|
|
|
106 |
|
|
# Test: c_variable-4.8
|
107 |
|
|
# Desc: number of children of struct_declarations.character
|
108 |
|
|
mi_gdb_test "-var-info-num-children struct_declarations.character" \
|
109 |
|
|
"\\^done,numchild=\"0\"" \
|
110 |
|
|
"get number of children of struct_declarations.character"
|
111 |
|
|
|
112 |
|
|
# Test: c_variable-4.9
|
113 |
|
|
# Desc: children of struct_declarations.char_ptr
|
114 |
|
|
mi_gdb_test "-var-list-children struct_declarations.char_ptr" \
|
115 |
|
|
"\\^done,numchild=\"1\",children=\{child=\{name=\"struct_declarations.char_ptr.\\*char_ptr\",exp=\"\\*char_ptr\",numchild=\"0\",type=\"char\"\}\}" \
|
116 |
|
|
"get children of struct_declarations.char_ptr"
|
117 |
|
|
|
118 |
|
|
# Test: c_variable-4.10
|
119 |
|
|
# Desc: number of children of struct_declarations.char_ptr
|
120 |
|
|
mi_gdb_test "-var-info-num-children struct_declarations.char_ptr" \
|
121 |
|
|
"\\^done,numchild=\"1\"" \
|
122 |
|
|
"get number of children of struct_declarations.char_ptr"
|
123 |
|
|
|
124 |
|
|
# Test: c_variable-4.11
|
125 |
|
|
# Desc: children of struct_declarations.long_int
|
126 |
|
|
mi_gdb_test "-var-list-children struct_declarations.long_int" \
|
127 |
|
|
"\\^done,numchild=\"0\"" \
|
128 |
|
|
"get children of struct_declarations.long_int"
|
129 |
|
|
|
130 |
|
|
# Test: c_variable-4.12
|
131 |
|
|
# Desc: number of children of struct_declarations.long_int
|
132 |
|
|
mi_gdb_test "-var-info-num-children struct_declarations.long_int" \
|
133 |
|
|
"\\^done,numchild=\"0\"" \
|
134 |
|
|
"get number of children of struct_declarations.long_int"
|
135 |
|
|
|
136 |
|
|
# Test: c_variable-4.13
|
137 |
|
|
# Desc: children of int_ptr_ptr
|
138 |
|
|
mi_gdb_test "-var-list-children struct_declarations.int_ptr_ptr" \
|
139 |
|
|
"\\^done,numchild=\"1\",children=\{child=\{name=\"struct_declarations.int_ptr_ptr.\\*int_ptr_ptr\",exp=\"\\*int_ptr_ptr\",numchild=\"1\",type=\"int \\*\"\}\}" \
|
140 |
|
|
"get children of struct_declarations.int_ptr_ptr"
|
141 |
|
|
|
142 |
|
|
#gdbtk_test c_variable-4.13 {children of int_ptr_ptr} {
|
143 |
|
|
# get_children struct_declarations.int_ptr_ptr
|
144 |
|
|
#} {*int_ptr_ptr}
|
145 |
|
|
|
146 |
|
|
# Test: c_variable-4.14
|
147 |
|
|
# Desc: number of children of int_ptr_ptr
|
148 |
|
|
mi_gdb_test "-var-info-num-children struct_declarations.int_ptr_ptr" \
|
149 |
|
|
"\\^done,numchild=\"1\"" \
|
150 |
|
|
"get number of children of struct_declarations.int_ptr_ptr"
|
151 |
|
|
|
152 |
|
|
|
153 |
|
|
# Test: c_variable-4.15
|
154 |
|
|
# Desc: children of struct_declarations.long_array
|
155 |
|
|
mi_gdb_test "-var-list-children struct_declarations.long_array" \
|
156 |
|
|
"\\^done,numchild=\"10\",children=\{child=\{name=\"struct_declarations.long_array.0\",exp=\"0\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.long_array.1\",exp=\"1\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.long_array.2\",exp=\"2\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.long_array.3\",exp=\"3\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.long_array.4\",exp=\"4\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.long_array.5\",exp=\"5\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.long_array.6\",exp=\"6\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.long_array.7\",exp=\"7\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.long_array.8\",exp=\"8\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.long_array.9\",exp=\"9\",numchild=\"0\",type=\"long int\"\}\}" \
|
157 |
|
|
"get children of struct_declarations.long_array"
|
158 |
|
|
|
159 |
|
|
# Test: c_variable-4.16
|
160 |
|
|
# Desc: number of children of struct_declarations.long_array
|
161 |
|
|
mi_gdb_test "-var-info-num-children struct_declarations.long_array" \
|
162 |
|
|
"\\^done,numchild=\"10\"" \
|
163 |
|
|
"get number of children of struct_declarations.long_array"
|
164 |
|
|
|
165 |
|
|
# Test: c_variable-4.17
|
166 |
|
|
# Desc: children of struct_declarations.func_ptr
|
167 |
|
|
mi_gdb_test "-var-list-children struct_declarations.func_ptr" \
|
168 |
|
|
"\\^done,numchild=\"0\"" \
|
169 |
|
|
"get children of struct_declarations.func_ptr"
|
170 |
|
|
|
171 |
|
|
|
172 |
|
|
# Test: c_variable-4.18
|
173 |
|
|
# Desc: number of children of struct_declarations.func_ptr
|
174 |
|
|
mi_gdb_test "-var-info-num-children struct_declarations.func_ptr" \
|
175 |
|
|
"\\^done,numchild=\"0\"" \
|
176 |
|
|
"get number of children of struct_declarations.func_ptr"
|
177 |
|
|
|
178 |
|
|
|
179 |
|
|
# Test: c_variable-4.19
|
180 |
|
|
# Desc: children of struct_declarations.func_ptr_struct
|
181 |
|
|
mi_gdb_test "-var-list-children struct_declarations.func_ptr_struct" \
|
182 |
|
|
"\\^done,numchild=\"0\"" \
|
183 |
|
|
"get children of struct_declarations.func_ptr_struct"
|
184 |
|
|
|
185 |
|
|
# Test: c_variable-4.20
|
186 |
|
|
# Desc: number of children of struct_declarations.func_ptr_struct
|
187 |
|
|
mi_gdb_test "-var-info-num-children struct_declarations.func_ptr_struct" \
|
188 |
|
|
"\\^done,numchild=\"0\"" \
|
189 |
|
|
"get number of children of struct_declarations.func_ptr_struct"
|
190 |
|
|
|
191 |
|
|
|
192 |
|
|
# Test: c_variable-4.21
|
193 |
|
|
# Desc: children of struct_declarations.func_ptr_ptr
|
194 |
|
|
mi_gdb_test "-var-list-children struct_declarations.func_ptr_ptr" \
|
195 |
|
|
"\\^done,numchild=\"0\"" \
|
196 |
|
|
"get children of struct_declarations.func_ptr_ptr"
|
197 |
|
|
|
198 |
|
|
# Test: c_variable-4.22
|
199 |
|
|
# Desc: number of children of struct_declarations.func_ptr_ptr
|
200 |
|
|
mi_gdb_test "-var-info-num-children struct_declarations.func_ptr_ptr" \
|
201 |
|
|
"\\^done,numchild=\"0\"" \
|
202 |
|
|
"get number of children of struct_declarations.func_ptr_ptr"
|
203 |
|
|
|
204 |
|
|
|
205 |
|
|
# Test: c_variable-4.23
|
206 |
|
|
# Desc: children of struct_declarations.u1
|
207 |
|
|
mi_gdb_test "-var-list-children struct_declarations.u1" \
|
208 |
|
|
"\\^done,numchild=\"4\",children=\{child=\{name=\"struct_declarations.u1.a\",exp=\"a\",numchild=\"0\",type=\"int\"\},child=\{name=\"struct_declarations.u1.b\",exp=\"b\",numchild=\"1\",type=\"char \\*\"\},child=\{name=\"struct_declarations.u1.c\",exp=\"c\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.u1.d\",exp=\"d\",numchild=\"0\",type=\"enum foo\"\}\}" \
|
209 |
|
|
"get children of struct_declarations.u1"
|
210 |
|
|
|
211 |
|
|
# Test: c_variable-4.24
|
212 |
|
|
# Desc: number of children of struct_declarations.u1
|
213 |
|
|
mi_gdb_test "-var-info-num-children struct_declarations.u1" \
|
214 |
|
|
"\\^done,numchild=\"4\"" \
|
215 |
|
|
"get number of children of struct_declarations.u1"
|
216 |
|
|
|
217 |
|
|
# Test: c_variable-4.25
|
218 |
|
|
# Desc: children of struct_declarations.s2
|
219 |
|
|
mi_gdb_test "-var-list-children struct_declarations.s2" \
|
220 |
|
|
"\\^done,numchild=\"4\",children=\{child=\{name=\"struct_declarations.s2.u2\",exp=\"u2\",numchild=\"3\",type=\"union \{\\.\\.\\.\}\"\},child=\{name=\"struct_declarations.s2.g\",exp=\"g\",numchild=\"0\",type=\"int\"\},child=\{name=\"struct_declarations.s2.h\",exp=\"h\",numchild=\"0\",type=\"char\"\},child=\{name=\"struct_declarations.s2.i\",exp=\"i\",numchild=\"10\",type=\"long int \\\[10\\\]\"\}\}" \
|
221 |
|
|
"get children of struct_declarations.s2"
|
222 |
|
|
#gdbtk_test c_variable-4.25 {children of struct_declarations.s2} {
|
223 |
|
|
# get_children struct_declarations.s2
|
224 |
|
|
#} {u2 g h i}
|
225 |
|
|
|
226 |
|
|
# Test: c_variable-4.26
|
227 |
|
|
# Desc: number of children of struct_declarations.s2
|
228 |
|
|
mi_gdb_test "-var-info-num-children struct_declarations.s2" \
|
229 |
|
|
"\\^done,numchild=\"4\"" \
|
230 |
|
|
"get number of children of struct_declarations.s2"
|
231 |
|
|
|
232 |
|
|
|
233 |
|
|
# Test: c_variable-4.27
|
234 |
|
|
# Desc: children of struct_declarations.long_array.1
|
235 |
|
|
mi_gdb_test "-var-list-children struct_declarations.long_array.1" \
|
236 |
|
|
"\\^done,numchild=\"0\"" \
|
237 |
|
|
"get children of struct_declarations.long_array.1"
|
238 |
|
|
|
239 |
|
|
# Test: c_variable-4.28
|
240 |
|
|
# Desc: number of children of struct_declarations.long_array.1
|
241 |
|
|
mi_gdb_test "-var-info-num-children struct_declarations.long_array.1" \
|
242 |
|
|
"\\^done,numchild=\"0\"" \
|
243 |
|
|
"get number of children of struct_declarations.long_array.1"
|
244 |
|
|
|
245 |
|
|
# Test: c_variable-4.29
|
246 |
|
|
# Desc: children of struct_declarations.long_array.2
|
247 |
|
|
mi_gdb_test "-var-list-children struct_declarations.long_array.2" \
|
248 |
|
|
"\\^done,numchild=\"0\"" \
|
249 |
|
|
"get children of struct_declarations.long_array.2"
|
250 |
|
|
|
251 |
|
|
# Test: c_variable-4.30
|
252 |
|
|
# Desc: number of children of struct_declarations.long_array.2
|
253 |
|
|
mi_gdb_test "-var-info-num-children struct_declarations.long_array.2" \
|
254 |
|
|
"\\^done,numchild=\"0\"" \
|
255 |
|
|
"get number of children of struct_declarations.long_array.2"
|
256 |
|
|
|
257 |
|
|
# Test: c_variable-4.31
|
258 |
|
|
# Desc: children of struct_declarations.long_array.3
|
259 |
|
|
mi_gdb_test "-var-list-children struct_declarations.long_array.3" \
|
260 |
|
|
"\\^done,numchild=\"0\"" \
|
261 |
|
|
"get children of struct_declarations.long_array.3"
|
262 |
|
|
|
263 |
|
|
# Test: c_variable-4.32
|
264 |
|
|
# Desc: number of children of struct_declarations.long_array.3
|
265 |
|
|
mi_gdb_test "-var-info-num-children struct_declarations.long_array.3" \
|
266 |
|
|
"\\^done,numchild=\"0\"" \
|
267 |
|
|
"get number of children of struct_declarations.long_array.3"
|
268 |
|
|
|
269 |
|
|
# Test: c_variable-4.33
|
270 |
|
|
# Desc: children of struct_declarations.long_array.4
|
271 |
|
|
mi_gdb_test "-var-list-children struct_declarations.long_array.4" \
|
272 |
|
|
"\\^done,numchild=\"0\"" \
|
273 |
|
|
"get children of struct_declarations.long_array.4"
|
274 |
|
|
|
275 |
|
|
# Test: c_variable-4.34
|
276 |
|
|
# Desc: number of children of struct_declarations.long_array.4
|
277 |
|
|
mi_gdb_test "-var-info-num-children struct_declarations.long_array.4" \
|
278 |
|
|
"\\^done,numchild=\"0\"" \
|
279 |
|
|
"get number of children of struct_declarations.long_array.4"
|
280 |
|
|
|
281 |
|
|
# Test: c_variable-4.35
|
282 |
|
|
# Desc: children of struct_declarations.long_array.5
|
283 |
|
|
mi_gdb_test "-var-list-children struct_declarations.long_array.5" \
|
284 |
|
|
"\\^done,numchild=\"0\"" \
|
285 |
|
|
"get children of struct_declarations.long_array.5"
|
286 |
|
|
|
287 |
|
|
# Test: c_variable-4.36
|
288 |
|
|
# Desc: number of children of struct_declarations.long_array.5
|
289 |
|
|
mi_gdb_test "-var-info-num-children struct_declarations.long_array.5" \
|
290 |
|
|
"\\^done,numchild=\"0\"" \
|
291 |
|
|
"get number of children of struct_declarations.long_array.5"
|
292 |
|
|
|
293 |
|
|
# Test: c_variable-4.37
|
294 |
|
|
# Desc: children of struct_declarations.long_array.6
|
295 |
|
|
mi_gdb_test "-var-list-children struct_declarations.long_array.6" \
|
296 |
|
|
"\\^done,numchild=\"0\"" \
|
297 |
|
|
"get children of struct_declarations.long_array.6"
|
298 |
|
|
|
299 |
|
|
# Test: c_variable-4.38
|
300 |
|
|
# Desc: number of children of struct_declarations.long_array.6
|
301 |
|
|
mi_gdb_test "-var-info-num-children struct_declarations.long_array.6" \
|
302 |
|
|
"\\^done,numchild=\"0\"" \
|
303 |
|
|
"get number of children of struct_declarations.long_array.6"
|
304 |
|
|
|
305 |
|
|
# Test: c_variable-4.39
|
306 |
|
|
# Desc: children of struct_declarations.long_array.7
|
307 |
|
|
mi_gdb_test "-var-list-children struct_declarations.long_array.7" \
|
308 |
|
|
"\\^done,numchild=\"0\"" \
|
309 |
|
|
"get children of struct_declarations.long_array.7"
|
310 |
|
|
|
311 |
|
|
# Test: c_variable-4.40
|
312 |
|
|
# Desc: number of children of struct_declarations.long_array.7
|
313 |
|
|
mi_gdb_test "-var-info-num-children struct_declarations.long_array.7" \
|
314 |
|
|
"\\^done,numchild=\"0\"" \
|
315 |
|
|
"get number of children of struct_declarations.long_array.7"
|
316 |
|
|
|
317 |
|
|
# Test: c_variable-4.41
|
318 |
|
|
# Desc: children of struct_declarations.long_array.8
|
319 |
|
|
mi_gdb_test "-var-list-children struct_declarations.long_array.8" \
|
320 |
|
|
"\\^done,numchild=\"0\"" \
|
321 |
|
|
"get children of struct_declarations.long_array.8"
|
322 |
|
|
|
323 |
|
|
# Test: c_variable-4.42
|
324 |
|
|
# Desc: number of children of struct_declarations.long_array.8
|
325 |
|
|
mi_gdb_test "-var-info-num-children struct_declarations.long_array.8" \
|
326 |
|
|
"\\^done,numchild=\"0\"" \
|
327 |
|
|
"get number of children of struct_declarations.long_array.8"
|
328 |
|
|
|
329 |
|
|
|
330 |
|
|
# Test: c_variable-4.43
|
331 |
|
|
# Desc: children of struct_declarations.long_array.9
|
332 |
|
|
mi_gdb_test "-var-list-children struct_declarations.long_array.9" \
|
333 |
|
|
"\\^done,numchild=\"0\"" \
|
334 |
|
|
"get children of struct_declarations.long_array.9"
|
335 |
|
|
|
336 |
|
|
# Test: c_variable-4.44
|
337 |
|
|
# Desc: number of children of struct_declarations.long_array.9
|
338 |
|
|
mi_gdb_test "-var-info-num-children struct_declarations.long_array.9" \
|
339 |
|
|
"\\^done,numchild=\"0\"" \
|
340 |
|
|
"get number of children of struct_declarations.long_array.9"
|
341 |
|
|
|
342 |
|
|
# Test: c_variable-4.45
|
343 |
|
|
# Desc: children of struct_declarations.u1.a
|
344 |
|
|
mi_gdb_test "-var-list-children struct_declarations.u1.a" \
|
345 |
|
|
"\\^done,numchild=\"0\"" \
|
346 |
|
|
"get children of struct_declarations.u1.a"
|
347 |
|
|
|
348 |
|
|
# Test: c_variable-4.46
|
349 |
|
|
# Desc: number of children of struct_declarations.u1.a
|
350 |
|
|
mi_gdb_test "-var-info-num-children struct_declarations.u1.a" \
|
351 |
|
|
"\\^done,numchild=\"0\"" \
|
352 |
|
|
"get number of children of struct_declarations.u1.a"
|
353 |
|
|
|
354 |
|
|
# Test: c_variable-4.47
|
355 |
|
|
# Desc: children of struct_declarations.u1.b
|
356 |
|
|
mi_gdb_test "-var-list-children struct_declarations.u1.b" \
|
357 |
|
|
"\\^done,numchild=\"1\",children=\{child=\{name=\"struct_declarations.u1.b.\\*b\",exp=\"\\*b\",numchild=\"0\",type=\"char\"\}\}" \
|
358 |
|
|
"get children of struct_declarations.u1.b"
|
359 |
|
|
|
360 |
|
|
# Test: c_variable-4.48
|
361 |
|
|
# Desc: number of children of struct_declarations.u1.b
|
362 |
|
|
mi_gdb_test "-var-info-num-children struct_declarations.u1.b" \
|
363 |
|
|
"\\^done,numchild=\"1\"" \
|
364 |
|
|
"get number of children of struct_declarations.u1.b"
|
365 |
|
|
|
366 |
|
|
# Test: c_variable-4.49
|
367 |
|
|
# Desc: children of struct_declarations.u1.c
|
368 |
|
|
mi_gdb_test "-var-list-children struct_declarations.u1.c" \
|
369 |
|
|
"\\^done,numchild=\"0\"" \
|
370 |
|
|
"get children of struct_declarations.u1.c"
|
371 |
|
|
|
372 |
|
|
# Test: c_variable-4.50
|
373 |
|
|
# Desc: number of children of struct_declarations.u1.c
|
374 |
|
|
mi_gdb_test "-var-info-num-children struct_declarations.u1.c" \
|
375 |
|
|
"\\^done,numchild=\"0\"" \
|
376 |
|
|
"get number of children of struct_declarations.u1.c"
|
377 |
|
|
|
378 |
|
|
# Test: c_variable-4.51
|
379 |
|
|
# Desc: children of struct_declarations.u1.d
|
380 |
|
|
mi_gdb_test "-var-list-children struct_declarations.u1.d" \
|
381 |
|
|
"\\^done,numchild=\"0\"" \
|
382 |
|
|
"get children of struct_declarations.u1.d"
|
383 |
|
|
|
384 |
|
|
|
385 |
|
|
# Test: c_variable-4.52
|
386 |
|
|
# Desc: number of children of struct_declarations.u1.d
|
387 |
|
|
mi_gdb_test "-var-info-num-children struct_declarations.u1.d" \
|
388 |
|
|
"\\^done,numchild=\"0\"" \
|
389 |
|
|
"get number of children of struct_declarations.u1.d"
|
390 |
|
|
|
391 |
|
|
|
392 |
|
|
# Test: c_variable-4.53
|
393 |
|
|
# Desc: children of struct_declarations.s2.u2
|
394 |
|
|
mi_gdb_test "-var-list-children struct_declarations.s2.u2" \
|
395 |
|
|
"\\^done,numchild=\"3\",children=\{child=\{name=\"struct_declarations.s2.u2.u1s1\",exp=\"u1s1\",numchild=\"4\",type=\"struct \{\\.\\.\\.\}\"\},child=\{name=\"struct_declarations.s2.u2.f\",exp=\"f\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.s2.u2.u1s2\",exp=\"u1s2\",numchild=\"2\",type=\"struct \{\\.\\.\\.\}\"\}\}" \
|
396 |
|
|
"get children of struct_declarations.s2.u2"
|
397 |
|
|
|
398 |
|
|
# Test: c_variable-4.54
|
399 |
|
|
# Desc: number of children of struct_declarations.s2.u2
|
400 |
|
|
mi_gdb_test "-var-info-num-children struct_declarations.s2.u2" \
|
401 |
|
|
"\\^done,numchild=\"3\"" \
|
402 |
|
|
"get number of children of struct_declarations.s2.u2"
|
403 |
|
|
|
404 |
|
|
# Test: c_variable-4.55
|
405 |
|
|
# Desc: children of struct_declarations.s2.g
|
406 |
|
|
mi_gdb_test "-var-list-children struct_declarations.s2.g" \
|
407 |
|
|
"\\^done,numchild=\"0\"" \
|
408 |
|
|
"get children of struct_declarations.s2.g"
|
409 |
|
|
|
410 |
|
|
# Test: c_variable-4.56
|
411 |
|
|
# Desc: number of children of struct_declarations.s2.g
|
412 |
|
|
mi_gdb_test "-var-info-num-children struct_declarations.s2.g" \
|
413 |
|
|
"\\^done,numchild=\"0\"" \
|
414 |
|
|
"get number of children of struct_declarations.s2.g"
|
415 |
|
|
|
416 |
|
|
|
417 |
|
|
# Test: c_variable-4.57
|
418 |
|
|
# Desc: children of struct_declarations.s2.h
|
419 |
|
|
mi_gdb_test "-var-list-children struct_declarations.s2.h" \
|
420 |
|
|
"\\^done,numchild=\"0\"" \
|
421 |
|
|
"get children of struct_declarations.s2.h"
|
422 |
|
|
|
423 |
|
|
# Test: c_variable-4.58
|
424 |
|
|
# Desc: number of children of struct_declarations.s2.h
|
425 |
|
|
mi_gdb_test "-var-info-num-children struct_declarations.s2.h" \
|
426 |
|
|
"\\^done,numchild=\"0\"" \
|
427 |
|
|
"get number of children of struct_declarations.s2.h"
|
428 |
|
|
|
429 |
|
|
|
430 |
|
|
# Test: c_variable-4.59
|
431 |
|
|
# Desc: children of struct_declarations.s2.i
|
432 |
|
|
mi_gdb_test "-var-list-children struct_declarations.s2.i" \
|
433 |
|
|
"\\^done,numchild=\"10\",children=\{child=\{name=\"struct_declarations.s2.i.0\",exp=\"0\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.s2.i.1\",exp=\"1\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.s2.i.2\",exp=\"2\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.s2.i.3\",exp=\"3\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.s2.i.4\",exp=\"4\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.s2.i.5\",exp=\"5\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.s2.i.6\",exp=\"6\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.s2.i.7\",exp=\"7\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.s2.i.8\",exp=\"8\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.s2.i.9\",exp=\"9\",numchild=\"0\",type=\"long int\"\}\}" \
|
434 |
|
|
"get children of struct_declarations.s2.i"
|
435 |
|
|
|
436 |
|
|
# Test: c_variable-4.60
|
437 |
|
|
# Desc: number of children of struct_declarations.s2.i
|
438 |
|
|
mi_gdb_test "-var-info-num-children struct_declarations.s2.i" \
|
439 |
|
|
"\\^done,numchild=\"10\"" \
|
440 |
|
|
"get number of children of struct_declarations.s2.i"
|
441 |
|
|
|
442 |
|
|
# Test: c_variable-4.61
|
443 |
|
|
# Desc: children of struct_declarations.s2.u2.u1s1
|
444 |
|
|
mi_gdb_test "-var-list-children struct_declarations.s2.u2.u1s1" \
|
445 |
|
|
"\\^done,numchild=\"4\",children=\{child=\{name=\"struct_declarations.s2.u2.u1s1.d\",exp=\"d\",numchild=\"0\",type=\"int\"\},child=\{name=\"struct_declarations.s2.u2.u1s1.e\",exp=\"e\",numchild=\"10\",type=\"char \\\[10\\\]\"\},child=\{name=\"struct_declarations.s2.u2.u1s1.func\",exp=\"func\",numchild=\"0\",type=\"int \\*\\(\\*\\)\\(\\)\"\},child=\{name=\"struct_declarations.s2.u2.u1s1.foo\",exp=\"foo\",numchild=\"0\",type=\"efoo\"\}\}" \
|
446 |
|
|
"get children of struct_declarations.s2.u2.u1s1"
|
447 |
|
|
|
448 |
|
|
# Test: c_variable-4.62
|
449 |
|
|
# Desc: number of children of struct_declarations.s2.u2.u1s1
|
450 |
|
|
mi_gdb_test "-var-info-num-children struct_declarations.s2.u2.u1s1" \
|
451 |
|
|
"\\^done,numchild=\"4\"" \
|
452 |
|
|
"get number of children of struct_declarations.s2.u2.u1s1"
|
453 |
|
|
|
454 |
|
|
# Test: c_variable-4.63
|
455 |
|
|
# Desc: children of struct_declarations.s2.u2.f
|
456 |
|
|
mi_gdb_test "-var-list-children struct_declarations.s2.u2.f" \
|
457 |
|
|
"\\^done,numchild=\"0\"" \
|
458 |
|
|
"get children of struct_declarations.s2.u2.f"
|
459 |
|
|
|
460 |
|
|
# Test: c_variable-4.64
|
461 |
|
|
# Desc: number of children of struct_declarations.s2.u2.f
|
462 |
|
|
mi_gdb_test "-var-info-num-children struct_declarations.s2.u2.f" \
|
463 |
|
|
"\\^done,numchild=\"0\"" \
|
464 |
|
|
"get number of children of struct_declarations.s2.u2.f"
|
465 |
|
|
|
466 |
|
|
# Test: c_variable-4.65
|
467 |
|
|
# Desc: children of struct_declarations.s2.u2.u1s2
|
468 |
|
|
mi_gdb_test "-var-list-children struct_declarations.s2.u2.u1s2" \
|
469 |
|
|
"\\^done,numchild=\"2\",children=\{child=\{name=\"struct_declarations.s2.u2.u1s2.array_ptr\",exp=\"array_ptr\",numchild=\"2\",type=\"char \\\[2\\\]\"\},child=\{name=\"struct_declarations.s2.u2.u1s2.func\",exp=\"func\",numchild=\"0\",type=\"int \\(\\*\\)\\(\\)\"\}\}" \
|
470 |
|
|
"get children of struct_declarations.s2.u2.u1s2"
|
471 |
|
|
|
472 |
|
|
# Test: c_variable-4.66
|
473 |
|
|
# Desc: number of children of struct_declarations.s2.u2.u1s2
|
474 |
|
|
mi_gdb_test "-var-info-num-children struct_declarations.s2.u2.u1s2" \
|
475 |
|
|
"\\^done,numchild=\"2\"" \
|
476 |
|
|
"get number of children of struct_declarations.s2.u2.u1s2"
|
477 |
|
|
|
478 |
|
|
# Test: c_variable-4.67
|
479 |
|
|
# Desc: children of struct_declarations.s2.u2.u1s1.d
|
480 |
|
|
mi_gdb_test "-var-list-children struct_declarations.s2.u2.u1s1.d" \
|
481 |
|
|
"\\^done,numchild=\"0\"" \
|
482 |
|
|
"get children of struct_declarations.s2.u2.u1s1.d"
|
483 |
|
|
|
484 |
|
|
# Test: c_variable-4.68
|
485 |
|
|
# Desc: number of children of struct_declarations.s2.u2.u1s1.d
|
486 |
|
|
mi_gdb_test "-var-info-num-children struct_declarations.s2.u2.u1s1.d" \
|
487 |
|
|
"\\^done,numchild=\"0\"" \
|
488 |
|
|
"get number of children of struct_declarations.s2.u2.u1s1.d"
|
489 |
|
|
|
490 |
|
|
# Test: c_variable-4.69
|
491 |
|
|
# Desc: children of struct_declarations.s2.u2.u1s1.e
|
492 |
|
|
mi_gdb_test "-var-list-children struct_declarations.s2.u2.u1s1.e" \
|
493 |
|
|
"\\^done,numchild=\"10\",children=\{child=\{name=\"struct_declarations.s2.u2.u1s1.e.0\",exp=\"0\",numchild=\"0\",type=\"char\"\},child=\{name=\"struct_declarations.s2.u2.u1s1.e.1\",exp=\"1\",numchild=\"0\",type=\"char\"\},child=\{name=\"struct_declarations.s2.u2.u1s1.e.2\",exp=\"2\",numchild=\"0\",type=\"char\"\},child={name=\"struct_declarations.s2.u2.u1s1.e.3\",exp=\"3\",numchild=\"0\",type=\"char\"\},child=\{name=\"struct_declarations.s2.u2.u1s1.e.4\",exp=\"4\",numchild=\"0\",type=\"char\"\},child=\{name=\"struct_declarations.s2.u2.u1s1.e.5\",exp=\"5\",numchild=\"0\",type=\"char\"\},child=\{name=\"struct_declarations.s2.u2.u1s1.e.6\",exp=\"6\",numchild=\"0\",type=\"char\"\},child=\{name=\"struct_declarations.s2.u2.u1s1.e.7\",exp=\"7\",numchild=\"0\",type=\"char\"\},child=\{name=\"struct_declarations.s2.u2.u1s1.e.8\",exp=\"8\",numchild=\"0\",type=\"char\"\},child=\{name=\"struct_declarations.s2.u2.u1s1.e.9\",exp=\"9\",numchild=\"0\",type=\"char\"\}\}" \
|
494 |
|
|
"get children of struct_declarations.s2.u2.u1s1.e"
|
495 |
|
|
|
496 |
|
|
# Test: c_variable-4.70
|
497 |
|
|
# Desc: number of children of struct_declarations.s2.u2.u1s1.e
|
498 |
|
|
mi_gdb_test "-var-info-num-children struct_declarations.s2.u2.u1s1.e" \
|
499 |
|
|
"\\^done,numchild=\"10\"" \
|
500 |
|
|
"get number of children of struct_declarations.s2.u2.u1s1.e"
|
501 |
|
|
|
502 |
|
|
|
503 |
|
|
# Test: c_variable-4.71
|
504 |
|
|
# Desc: children of struct_declarations.s2.u2.u1s1.func
|
505 |
|
|
mi_gdb_test "-var-list-children struct_declarations.s2.u2.u1s1.func" \
|
506 |
|
|
"\\^done,numchild=\"0\"" \
|
507 |
|
|
"get children of struct_declarations.s2.u2.u1s1.func"
|
508 |
|
|
|
509 |
|
|
# Test: c_variable-4.72
|
510 |
|
|
# Desc: number of children of struct_declarations.s2.u2.u1s1.func
|
511 |
|
|
mi_gdb_test "-var-info-num-children struct_declarations.s2.u2.u1s1.func" \
|
512 |
|
|
"\\^done,numchild=\"0\"" \
|
513 |
|
|
"get number of children of struct_declarations.s2.u2.u1s1.func"
|
514 |
|
|
|
515 |
|
|
|
516 |
|
|
# Test: c_variable-4.73
|
517 |
|
|
# Desc: children of struct_declarations.s2.u2.u1s1.foo
|
518 |
|
|
mi_gdb_test "-var-list-children struct_declarations.s2.u2.u1s1.foo" \
|
519 |
|
|
"\\^done,numchild=\"0\"" \
|
520 |
|
|
"get children of struct_declarations.s2.u2.u1s1.foo"
|
521 |
|
|
|
522 |
|
|
# Test: c_variable-4.74
|
523 |
|
|
# Desc: number of children of struct_declarations.s2.u2.u1s1.foo
|
524 |
|
|
mi_gdb_test "-var-info-num-children struct_declarations.s2.u2.u1s1.foo" \
|
525 |
|
|
"\\^done,numchild=\"0\"" \
|
526 |
|
|
"get number of children of struct_declarations.s2.u2.u1s1.foo"
|
527 |
|
|
|
528 |
|
|
|
529 |
|
|
# Test: c_variable-4.75
|
530 |
|
|
# Desc: children of struct_declarations.s2.u2.u1s2.array_ptr
|
531 |
|
|
mi_gdb_test "-var-list-children struct_declarations.s2.u2.u1s2.array_ptr" \
|
532 |
|
|
"\\^done,numchild=\"2\",children=\{child=\{name=\"struct_declarations.s2.u2.u1s2.array_ptr.0\",exp=\"0\",numchild=\"0\",type=\"char\"\},child={name=\"struct_declarations.s2.u2.u1s2.array_ptr.1\",exp=\"1\",numchild=\"0\",type=\"char\"\}\}" \
|
533 |
|
|
"get children of struct_declarations.s2.u2.u1s2.array_ptr"
|
534 |
|
|
|
535 |
|
|
# Test: c_variable-4.76
|
536 |
|
|
# Desc: number of children of struct_declarations.s2.u2.u1s2.array_ptr
|
537 |
|
|
mi_gdb_test "-var-info-num-children struct_declarations.s2.u2.u1s2.array_ptr" \
|
538 |
|
|
"\\^done,numchild=\"2\"" \
|
539 |
|
|
"get number of children of struct_declarations.s2.u2.u1s2.array_ptr"
|
540 |
|
|
|
541 |
|
|
# Test: c_variable-4.77
|
542 |
|
|
# Desc: children of struct_declarations.s2.u2.u1s2.func
|
543 |
|
|
mi_gdb_test "-var-list-children struct_declarations.s2.u2.u1s2.func" \
|
544 |
|
|
"\\^done,numchild=\"0\"" \
|
545 |
|
|
"get children of struct_declarations.s2.u2.u1s2.func"
|
546 |
|
|
|
547 |
|
|
# Test: c_variable-4.78
|
548 |
|
|
# Desc: number of children of struct_declarations.s2.u2.u1s2.func
|
549 |
|
|
mi_gdb_test "-var-info-num-children struct_declarations.s2.u2.u1s2.func" \
|
550 |
|
|
"\\^done,numchild=\"0\"" \
|
551 |
|
|
"get number of children of struct_declarations.s2.u2.u1s2.func"
|
552 |
|
|
|
553 |
|
|
# Test: c_variable-4.79
|
554 |
|
|
# Desc: children of struct_declarations.int_ptr_ptr.*int_ptr_ptr
|
555 |
|
|
mi_gdb_test "-var-list-children struct_declarations.int_ptr_ptr.*int_ptr_ptr" \
|
556 |
|
|
"\\^done,numchild=\"1\",children=\{child=\{name=\"struct_declarations.int_ptr_ptr.\\*int_ptr_ptr.\\*\\*int_ptr_ptr\",exp=\"\\*\\*int_ptr_ptr\",numchild=\"0\",type=\"int\"\}\}" \
|
557 |
|
|
"get children of struct_declarations.int_ptr_ptr.*int_ptr_ptr"
|
558 |
|
|
#} {**int_ptr_ptr}
|
559 |
|
|
|
560 |
|
|
# Test: c_variable-4.80
|
561 |
|
|
# Desc: Number of children of struct_declarations.int_ptr_ptr.*int_ptr_ptr
|
562 |
|
|
mi_gdb_test "-var-info-num-children struct_declarations.int_ptr_ptr.*int_ptr_ptr" \
|
563 |
|
|
"\\^done,numchild=\"1\"" \
|
564 |
|
|
"get number of children of struct_declarations.int_ptr_ptr.*int_ptr_ptr"
|
565 |
|
|
|
566 |
|
|
|
567 |
|
|
# Step to "struct_declarations.integer = 123;"
|
568 |
|
|
send_gdb "-exec-step\n"
|
569 |
|
|
gdb_expect {
|
570 |
|
|
-re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\{\},file=\".*var-cmd.c\",line=\"192\"\}\r\n$mi_gdb_prompt$" {
|
571 |
|
|
pass "step at do_children_tests"
|
572 |
|
|
}
|
573 |
|
|
timeout {
|
574 |
|
|
fail "step at do_children_tests (timeout)"
|
575 |
|
|
}
|
576 |
|
|
}
|
577 |
|
|
|
578 |
|
|
|
579 |
|
|
# Test: c_variable-4.81
|
580 |
|
|
# Desc: create local variable "weird"
|
581 |
|
|
mi_gdb_test "-var-create weird * weird" \
|
582 |
|
|
"\\^done,name=\"weird\",numchild=\"11\",type=\"weird_struct \\*\"" \
|
583 |
|
|
"create local variable weird"
|
584 |
|
|
|
585 |
|
|
# Test: c_variable-4.82
|
586 |
|
|
# Desc: children of weird
|
587 |
|
|
mi_gdb_test "-var-list-children weird" \
|
588 |
|
|
"\\^done,numchild=\"11\",children=\{child=\{name=\"weird.integer\",exp=\"integer\",numchild=\"0\",type=\"int\"\},child=\{name=\"weird.character\",exp=\"character\",numchild=\"0\",type=\"char\"\},child=\{name=\"weird.char_ptr\",exp=\"char_ptr\",numchild=\"1\",type=\"char \\*\"\},child=\{name=\"weird.long_int\",exp=\"long_int\",numchild=\"0\",type=\"long int\"\},child=\{name=\"weird.int_ptr_ptr\",exp=\"int_ptr_ptr\",numchild=\"1\",type=\"int \\*\\*\"\},child=\{name=\"weird.long_array\",exp=\"long_array\",numchild=\"10\",type=\"long int \\\[10\\\]\"\},child=\{name=\"weird.func_ptr\",exp=\"func_ptr\",numchild=\"0\",type=\"void \\(\\*\\)\\(\\)\"\},child=\{name=\"weird.func_ptr_struct\",exp=\"func_ptr_struct\",numchild=\"0\",type=\"struct _struct_decl \\(\\*\\)\\(\\)\"\},child=\{name=\"weird.func_ptr_ptr\",exp=\"func_ptr_ptr\",numchild=\"0\",type=\"struct _struct_decl \\*\\(\\*\\)\\(\\)\"\},child=\{name=\"weird.u1\",exp=\"u1\",numchild=\"4\",type=\"union \{\\.\\.\\.\}\"\},child=\{name=\"weird.s2\",exp=\"s2\",numchild=\"4\",type=\"struct \{\\.\\.\\.\}\"\}\}" \
|
589 |
|
|
"get children of weird"
|
590 |
|
|
|
591 |
|
|
# Test: c_variable-4.83
|
592 |
|
|
# Desc: number of children of weird
|
593 |
|
|
mi_gdb_test "-var-info-num-children weird" \
|
594 |
|
|
"\\^done,numchild=\"11\"" \
|
595 |
|
|
"get number of children of weird"
|
596 |
|
|
|
597 |
|
|
|
598 |
|
|
# Test: c_variable-4.84
|
599 |
|
|
# Desc: children of weird->long_array
|
600 |
|
|
mi_gdb_test "-var-list-children weird.long_array" \
|
601 |
|
|
"\\^done,numchild=\"10\",children=\{child=\{name=\"weird.long_array.0\",exp=\"0\",numchild=\"0\",type=\"long int\"\},child=\{name=\"weird.long_array.1\",exp=\"1\",numchild=\"0\",type=\"long int\"\},child=\{name=\"weird.long_array.2\",exp=\"2\",numchild=\"0\",type=\"long int\"\},child=\{name=\"weird.long_array.3\",exp=\"3\",numchild=\"0\",type=\"long int\"\},child=\{name=\"weird.long_array.4\",exp=\"4\",numchild=\"0\",type=\"long int\"\},child=\{name=\"weird.long_array.5\",exp=\"5\",numchild=\"0\",type=\"long int\"\},child=\{name=\"weird.long_array.6\",exp=\"6\",numchild=\"0\",type=\"long int\"\},child=\{name=\"weird.long_array.7\",exp=\"7\",numchild=\"0\",type=\"long int\"\},child=\{name=\"weird.long_array.8\",exp=\"8\",numchild=\"0\",type=\"long int\"\},child=\{name=\"weird.long_array.9\",exp=\"9\",numchild=\"0\",type=\"long int\"\}\}" \
|
602 |
|
|
"get children of weird.long_array"
|
603 |
|
|
#gdbtk_test c_variable-4.84 {children of weird->long_array} {
|
604 |
|
|
# get_children weird.long_array
|
605 |
|
|
#} {0 1 2 3 4 5 6 7 8 9}
|
606 |
|
|
|
607 |
|
|
# Test: c_variable-4.85
|
608 |
|
|
# Desc: number of children of weird.long_array
|
609 |
|
|
mi_gdb_test "-var-info-num-children weird.long_array" \
|
610 |
|
|
"\\^done,numchild=\"10\"" \
|
611 |
|
|
"get number of children of weird.long_array"
|
612 |
|
|
|
613 |
|
|
# Test: c_variable-4.86
|
614 |
|
|
# Desc: children of weird.int_ptr_ptr
|
615 |
|
|
mi_gdb_test "-var-list-children weird.int_ptr_ptr" \
|
616 |
|
|
"\\^done,numchild=\"1\",children=\{child=\{name=\"weird.int_ptr_ptr.\\*int_ptr_ptr\",exp=\"\\*int_ptr_ptr\",numchild=\"1\",type=\"int \\*\"\}\}" \
|
617 |
|
|
"get children of weird.int_ptr_ptr"
|
618 |
|
|
#gdbtk_test c_variable-4.86 {children of weird->int_ptr_ptr} {
|
619 |
|
|
# get_children weird.int_ptr_ptr
|
620 |
|
|
#} {*int_ptr_ptr}
|
621 |
|
|
|
622 |
|
|
# Test: c_variable-4.87
|
623 |
|
|
# Desc: number of children of weird.int_ptr_ptr
|
624 |
|
|
mi_gdb_test "-var-info-num-children weird.int_ptr_ptr" \
|
625 |
|
|
"\\^done,numchild=\"1\"" \
|
626 |
|
|
"get number of children of weird.int_ptr_ptr"
|
627 |
|
|
|
628 |
|
|
# Test: c_variable-4.88
|
629 |
|
|
# Desc: children of *weird->int_ptr_ptr
|
630 |
|
|
mi_gdb_test "-var-list-children weird.int_ptr_ptr.*int_ptr_ptr" \
|
631 |
|
|
"\\^done,numchild=\"1\",children=\{child=\{name=\"weird.int_ptr_ptr.\\*int_ptr_ptr.\\*\\*int_ptr_ptr\",exp=\"\\*\\*int_ptr_ptr\",numchild=\"0\",type=\"int\"\}\}" \
|
632 |
|
|
"get children of weird.int_ptr_ptr.*int_ptr_ptr"
|
633 |
|
|
#gdbtk_test c_variable-4.88 {children of *weird->int_ptr_ptr} {
|
634 |
|
|
# get_children weird.int_ptr_ptr.*int_ptr_ptr
|
635 |
|
|
#} {**int_ptr_ptr}
|
636 |
|
|
|
637 |
|
|
# Test: c_variable-4.89
|
638 |
|
|
# Desc: number of children *weird->int_ptr_ptr
|
639 |
|
|
mi_gdb_test "-var-info-num-children weird.int_ptr_ptr.*int_ptr_ptr" \
|
640 |
|
|
"\\^done,numchild=\"1\"" \
|
641 |
|
|
"get number of children of weird.int_ptr_ptr.*int_ptr_ptr"
|
642 |
|
|
|
643 |
|
|
# Test: c_variable-4.90
|
644 |
|
|
# Desc: create weird->int_ptr_ptr
|
645 |
|
|
mi_gdb_test "-var-create weird->int_ptr_ptr * weird->int_ptr_ptr" \
|
646 |
|
|
"\\^done,name=\"weird->int_ptr_ptr\",numchild=\"1\",type=\"int \\*\\*\"" \
|
647 |
|
|
"create local variable weird->int_ptr_ptr"
|
648 |
|
|
|
649 |
|
|
# Test: c_variable-4.91
|
650 |
|
|
# Desc: children of weird->int_ptr_ptr
|
651 |
|
|
mi_gdb_test "-var-list-children weird->int_ptr_ptr" \
|
652 |
|
|
"\\^done,numchild=\"1\",children=\{child=\{name=\"weird->int_ptr_ptr.\\*weird->int_ptr_ptr\",exp=\"\\*weird->int_ptr_ptr\",numchild=\"1\",type=\"int \\*\"\}\}" \
|
653 |
|
|
"get children of weird->int_ptr_ptr"
|
654 |
|
|
|
655 |
|
|
|
656 |
|
|
# Test: c_variable-4.92
|
657 |
|
|
# Desc: number of children of (weird->int_ptr_ptr)
|
658 |
|
|
mi_gdb_test "-var-info-num-children weird->int_ptr_ptr" \
|
659 |
|
|
"\\^done,numchild=\"1\"" \
|
660 |
|
|
"get number of children of weird->int_ptr_ptr"
|
661 |
|
|
|
662 |
|
|
# Test: c_variable-4.93
|
663 |
|
|
# Desc: children of *(weird->int_ptr_ptr)
|
664 |
|
|
mi_gdb_test "-var-list-children weird->int_ptr_ptr.*weird->int_ptr_ptr" \
|
665 |
|
|
"\\^done,numchild=\"1\",children=\{child=\{name=\"weird->int_ptr_ptr.\\*weird->int_ptr_ptr.\\*\\*weird->int_ptr_ptr\",exp=\"\\*\\*weird->int_ptr_ptr\",numchild=\"0\",type=\"int\"\}\}" \
|
666 |
|
|
"get children of weird->int_ptr_ptr.*weird->int_ptr_ptr"
|
667 |
|
|
|
668 |
|
|
# Test: c_variable-4.94
|
669 |
|
|
# Desc: number of children of *(weird->int_ptr_ptr)
|
670 |
|
|
mi_gdb_test "-var-info-num-children weird->int_ptr_ptr.*weird->int_ptr_ptr" \
|
671 |
|
|
"\\^done,numchild=\"1\"" \
|
672 |
|
|
"get number of children of weird->int_ptr_ptr.*weird->int_ptr_ptr"
|
673 |
|
|
|
674 |
|
|
# Test: c_variable-4.95
|
675 |
|
|
# Desc: children of *(*(weird->int_ptr_ptr))
|
676 |
|
|
mi_gdb_test "-var-list-children weird->int_ptr_ptr.*weird->int_ptr_ptr.**weird->int_ptr_ptr" \
|
677 |
|
|
"\\^done,numchild=\"0\"" \
|
678 |
|
|
"get children of weird->int_ptr_ptr.*weird->int_ptr_ptr.**weird->int_ptr_ptr"
|
679 |
|
|
|
680 |
|
|
# Test: c_variable-4.96
|
681 |
|
|
# Desc: number of children of *(*(weird->int_ptr_ptr))
|
682 |
|
|
mi_gdb_test "-var-info-num-children weird->int_ptr_ptr.*weird->int_ptr_ptr.**weird->int_ptr_ptr" \
|
683 |
|
|
"\\^done,numchild=\"0\"" \
|
684 |
|
|
"get number of children of weird->int_ptr_ptr.*weird->int_ptr_ptr.**weird->int_ptr_ptr"
|
685 |
|
|
|
686 |
|
|
# Test: c_variable-4.97
|
687 |
|
|
# Desc: is weird editable
|
688 |
|
|
mi_gdb_test "-var-show-attributes weird" \
|
689 |
|
|
"\\^done,attr=\"editable\"" \
|
690 |
|
|
"is weird editable"
|
691 |
|
|
|
692 |
|
|
# Test: c_variable-4.98
|
693 |
|
|
# Desc: is weird->int_ptr_ptr editable
|
694 |
|
|
mi_gdb_test "-var-show-attributes weird->int_ptr_ptr" \
|
695 |
|
|
"\\^done,attr=\"editable\"" \
|
696 |
|
|
"is weird->int_ptr_ptr editable"
|
697 |
|
|
|
698 |
|
|
# Test: c_variable-4.99
|
699 |
|
|
# Desc: is *(weird->int_ptr_ptr) editable
|
700 |
|
|
mi_gdb_test "-var-show-attributes weird.int_ptr_ptr.*int_ptr_ptr" \
|
701 |
|
|
"\\^done,attr=\"editable\"" \
|
702 |
|
|
"is weird.int_ptr_ptr.*int_ptr_ptr editable"
|
703 |
|
|
|
704 |
|
|
# Test: c_variable-4.100
|
705 |
|
|
# Desc: is *(*(weird->int_ptr_ptr)) editable
|
706 |
|
|
mi_gdb_test "-var-show-attributes weird.int_ptr_ptr.*int_ptr_ptr.**int_ptr_ptr" \
|
707 |
|
|
"\\^done,attr=\"editable\"" \
|
708 |
|
|
"is weird.int_ptr_ptr.*int_ptr_ptr.**int_ptr_ptr editable"
|
709 |
|
|
|
710 |
|
|
# Test: c_variable-4.101
|
711 |
|
|
# Desc: is weird->u1 editable
|
712 |
|
|
mi_gdb_test "-var-show-attributes weird.u1" \
|
713 |
|
|
"\\^done,attr=\"noneditable\"" \
|
714 |
|
|
"is weird.u1 editable"
|
715 |
|
|
|
716 |
|
|
# Test: c_variable-4.102
|
717 |
|
|
# Desc: is weird->s2 editable
|
718 |
|
|
mi_gdb_test "-var-show-attributes weird.s2" \
|
719 |
|
|
"\\^done,attr=\"noneditable\"" \
|
720 |
|
|
"is weird.s2 editable"
|
721 |
|
|
|
722 |
|
|
# Test: c_variable-4.103
|
723 |
|
|
# Desc: is struct_declarations.u1.a editable
|
724 |
|
|
mi_gdb_test "-var-show-attributes struct_declarations.u1.a" \
|
725 |
|
|
"\\^done,attr=\"editable\"" \
|
726 |
|
|
"is struct_declarations.u1.a editable"
|
727 |
|
|
|
728 |
|
|
# Test: c_variable-4.104
|
729 |
|
|
# Desc: is struct_declarations.u1.b editable
|
730 |
|
|
mi_gdb_test "-var-show-attributes struct_declarations.u1.b" \
|
731 |
|
|
"\\^done,attr=\"editable\"" \
|
732 |
|
|
"is struct_declarations.u1.b editable"
|
733 |
|
|
|
734 |
|
|
# Test: c_variable-4.105
|
735 |
|
|
# Desc: is struct_declarations.u1.c editable
|
736 |
|
|
mi_gdb_test "-var-show-attributes struct_declarations.u1.c" \
|
737 |
|
|
"\\^done,attr=\"editable\"" \
|
738 |
|
|
"is struct_declarations.u1.c editable"
|
739 |
|
|
|
740 |
|
|
# Test: c_variable-4.106
|
741 |
|
|
# Desc: is struct_declarations.long_array editable
|
742 |
|
|
mi_gdb_test "-var-show-attributes struct_declarations.long_array" \
|
743 |
|
|
"\\^done,attr=\"noneditable\"" \
|
744 |
|
|
"is struct_declarations.long_array editable"
|
745 |
|
|
|
746 |
|
|
# Test: c_variable-4.107
|
747 |
|
|
# Desc: is struct_declarations.long_array[0] editable
|
748 |
|
|
mi_gdb_test "-var-show-attributes struct_declarations.long_array.0" \
|
749 |
|
|
"\\^done,attr=\"editable\"" \
|
750 |
|
|
"is struct_declarations.long_array.0 editable"
|
751 |
|
|
|
752 |
|
|
# Test: c_variable-4.108
|
753 |
|
|
# Desc: is struct_declarations editable
|
754 |
|
|
mi_gdb_test "-var-show-attributes struct_declarations" \
|
755 |
|
|
"\\^done,attr=\"noneditable\"" \
|
756 |
|
|
"is struct_declarations editable"
|
757 |
|
|
|
758 |
|
|
mi_gdb_test "-var-delete weird" \
|
759 |
|
|
"\\^done,ndeleted=\"24\"" \
|
760 |
|
|
"delete var weird"
|
761 |
|
|
|
762 |
|
|
##### #####
|
763 |
|
|
# #
|
764 |
|
|
# children and update tests #
|
765 |
|
|
# #
|
766 |
|
|
##### #####
|
767 |
|
|
|
768 |
|
|
# Test: c_variable-5.1
|
769 |
|
|
# Desc: check that nothing changed
|
770 |
|
|
mi_gdb_test "-var-update *" \
|
771 |
|
|
"\\^done,changelist=\{\}" \
|
772 |
|
|
"update all vars. None changed"
|
773 |
|
|
|
774 |
|
|
# Step over "struct_declarations.integer = 123;"
|
775 |
|
|
send_gdb "-exec-step\n"
|
776 |
|
|
gdb_expect {
|
777 |
|
|
-re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\{\},file=\".*var-cmd.c\",line=\"193\"\}\r\n$mi_gdb_prompt$" {
|
778 |
|
|
pass "step at do_children_tests"
|
779 |
|
|
}
|
780 |
|
|
timeout {
|
781 |
|
|
fail "step at do_children_tests (timeout)"
|
782 |
|
|
}
|
783 |
|
|
}
|
784 |
|
|
|
785 |
|
|
# Test: c_variable-5.2
|
786 |
|
|
# Desc: check that integer changed
|
787 |
|
|
mi_gdb_test "-var-update *" \
|
788 |
|
|
"\\^done,changelist=\{name=\"struct_declarations.integer\",in_scope=\"true\",type_changed=\"false\"\}" \
|
789 |
|
|
"update all vars struct_declarations.integer"
|
790 |
|
|
|
791 |
|
|
# Step over:
|
792 |
|
|
# weird->char_ptr = "hello";
|
793 |
|
|
# bar = 2121;
|
794 |
|
|
# foo = &bar;
|
795 |
|
|
|
796 |
|
|
send_gdb "-exec-step 3\n"
|
797 |
|
|
gdb_expect {
|
798 |
|
|
-re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\{\},file=\".*var-cmd.c\",line=\"196\"\}\r\n$mi_gdb_prompt$" {
|
799 |
|
|
pass "step at do_children_tests"
|
800 |
|
|
}
|
801 |
|
|
timeout {
|
802 |
|
|
fail "step at do_children_tests (timeout)"
|
803 |
|
|
}
|
804 |
|
|
}
|
805 |
|
|
|
806 |
|
|
# Test: c_variable-5.3
|
807 |
|
|
# Desc: check that char_ptr changed
|
808 |
|
|
mi_gdb_test "-var-update *" \
|
809 |
|
|
"\\^done,changelist=\{name=\"struct_declarations.char_ptr\",in_scope=\"true\",type_changed=\"false\",name=\"struct_declarations.char_ptr.\\*char_ptr\",in_scope=\"true\",type_changed=\"false\"\}" \
|
810 |
|
|
"update all vars struct_declarations.char_ptr"
|
811 |
|
|
|
812 |
|
|
# Step over "struct_declarations.int_ptr_ptr = &foo;"
|
813 |
|
|
send_gdb "-exec-step\n"
|
814 |
|
|
gdb_expect {
|
815 |
|
|
-re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\{\},file=\".*var-cmd.c\",line=\"197\"\}\r\n$mi_gdb_prompt$" {
|
816 |
|
|
pass "step at do_children_tests"
|
817 |
|
|
}
|
818 |
|
|
timeout {
|
819 |
|
|
fail "step at do_children_tests (timeout)"
|
820 |
|
|
}
|
821 |
|
|
}
|
822 |
|
|
|
823 |
|
|
# Test: c_variable-5.4
|
824 |
|
|
# Desc: check that int_ptr_ptr and children changed
|
825 |
|
|
mi_gdb_test "-var-update *" \
|
826 |
|
|
"\\^done,changelist=\{name=\"weird->int_ptr_ptr\",in_scope=\"true\",type_changed=\"false\",name=\"weird->int_ptr_ptr.\\*weird->int_ptr_ptr\",in_scope=\"true\",type_changed=\"false\",name=\"weird->int_ptr_ptr.\\*weird->int_ptr_ptr.\\*\\*weird->int_ptr_ptr\",in_scope=\"true\",type_changed=\"false\",name=\"struct_declarations.int_ptr_ptr\",in_scope=\"true\",type_changed=\"false\",name=\"struct_declarations.int_ptr_ptr.\\*int_ptr_ptr\",in_scope=\"true\",type_changed=\"false\",name=\"struct_declarations.int_ptr_ptr.\\*int_ptr_ptr.\\*\\*int_ptr_ptr\",in_scope=\"true\",type_changed=\"false\"\}" \
|
827 |
|
|
"update all vars int_ptr_ptr and children changed"
|
828 |
|
|
|
829 |
|
|
# Step over "weird->long_array[0] = 1234;"
|
830 |
|
|
send_gdb "-exec-step\n"
|
831 |
|
|
gdb_expect {
|
832 |
|
|
-re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\{\},file=\".*var-cmd.c\",line=\"198\"\}\r\n$mi_gdb_prompt$" {
|
833 |
|
|
pass "step at do_children_tests"
|
834 |
|
|
}
|
835 |
|
|
timeout {
|
836 |
|
|
fail "step at do_children_tests (timeout)"
|
837 |
|
|
}
|
838 |
|
|
}
|
839 |
|
|
|
840 |
|
|
# Test: c_variable-5.5
|
841 |
|
|
# Desc: check that long_array[0] changed
|
842 |
|
|
mi_gdb_test "-var-update *" \
|
843 |
|
|
"\\^done,changelist=\{name=\"struct_declarations.long_array.0\",in_scope=\"true\",type_changed=\"false\"\}" \
|
844 |
|
|
"update all vars struct_declarations.long_array.0 changed"
|
845 |
|
|
|
846 |
|
|
# Step over "struct_declarations.long_array[1] = 2345;"
|
847 |
|
|
send_gdb "-exec-step\n"
|
848 |
|
|
gdb_expect {
|
849 |
|
|
-re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\{\},file=\".*var-cmd.c\",line=\"199\"\}\r\n$mi_gdb_prompt$" {
|
850 |
|
|
pass "step at do_children_tests"
|
851 |
|
|
}
|
852 |
|
|
timeout {
|
853 |
|
|
fail "step at do_children_tests (timeout)"
|
854 |
|
|
}
|
855 |
|
|
}
|
856 |
|
|
|
857 |
|
|
# Test: c_variable-5.6
|
858 |
|
|
# Desc: check that long_array[1] changed
|
859 |
|
|
mi_gdb_test "-var-update *" \
|
860 |
|
|
"\\^done,changelist=\{name=\"struct_declarations.long_array.1\",in_scope=\"true\",type_changed=\"false\"\}" \
|
861 |
|
|
"update all vars struct_declarations.long_array.1 changed"
|
862 |
|
|
|
863 |
|
|
# Step over "weird->long_array[2] = 3456;"
|
864 |
|
|
send_gdb "-exec-step\n"
|
865 |
|
|
gdb_expect {
|
866 |
|
|
-re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\{\},file=\".*var-cmd.c\",line=\"200\"\}\r\n$mi_gdb_prompt$" {
|
867 |
|
|
pass "step at do_children_tests"
|
868 |
|
|
}
|
869 |
|
|
timeout {
|
870 |
|
|
fail "step at do_children_tests (timeout)"
|
871 |
|
|
}
|
872 |
|
|
}
|
873 |
|
|
|
874 |
|
|
# Test: c_variable-5.7
|
875 |
|
|
# Desc: check that long_array[2] changed
|
876 |
|
|
mi_gdb_test "-var-update *" \
|
877 |
|
|
"\\^done,changelist=\{name=\"struct_declarations.long_array.2\",in_scope=\"true\",type_changed=\"false\"\}" \
|
878 |
|
|
"update all vars struct_declarations.long_array.2 changed"
|
879 |
|
|
|
880 |
|
|
# Step over:
|
881 |
|
|
# struct_declarations.long_array[3] = 4567;
|
882 |
|
|
# weird->long_array[4] = 5678;
|
883 |
|
|
# struct_declarations.long_array[5] = 6789;
|
884 |
|
|
# weird->long_array[6] = 7890;
|
885 |
|
|
# struct_declarations.long_array[7] = 8901;
|
886 |
|
|
# weird->long_array[8] = 9012;
|
887 |
|
|
# struct_declarations.long_array[9] = 1234;
|
888 |
|
|
send_gdb "-exec-step 7\n"
|
889 |
|
|
gdb_expect {
|
890 |
|
|
-re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\{\},file=\".*var-cmd.c\",line=\"208\"\}\r\n$mi_gdb_prompt$" {
|
891 |
|
|
pass "step at do_children_tests"
|
892 |
|
|
}
|
893 |
|
|
timeout {
|
894 |
|
|
fail "step at do_children_tests (timeout)"
|
895 |
|
|
}
|
896 |
|
|
}
|
897 |
|
|
|
898 |
|
|
# Test: c_variable-5.8
|
899 |
|
|
# Desc: check that long_array[3-9] changed
|
900 |
|
|
mi_gdb_test "-var-update *" \
|
901 |
|
|
"\\^done,changelist=\{name=\"struct_declarations.long_array.3\",in_scope=\"true\",type_changed=\"false\",name=\"struct_declarations.long_array.4\",in_scope=\"true\",type_changed=\"false\",name=\"struct_declarations.long_array.5\",in_scope=\"true\",type_changed=\"false\",name=\"struct_declarations.long_array.6\",in_scope=\"true\",type_changed=\"false\",name=\"struct_declarations.long_array.7\",in_scope=\"true\",type_changed=\"false\",name=\"struct_declarations.long_array.8\",in_scope=\"true\",type_changed=\"false\",name=\"struct_declarations.long_array.9\",in_scope=\"true\",type_changed=\"false\"\}" \
|
902 |
|
|
"update all vars struct_declarations.long_array.3-9 changed"
|
903 |
|
|
|
904 |
|
|
|
905 |
|
|
# Step over "weird->func_ptr = nothing;"
|
906 |
|
|
send_gdb "-exec-step\n"
|
907 |
|
|
gdb_expect {
|
908 |
|
|
-re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\{\},file=\".*var-cmd.c\",line=\"211\"\}\r\n$mi_gdb_prompt$" {
|
909 |
|
|
pass "step at do_children_tests"
|
910 |
|
|
}
|
911 |
|
|
timeout {
|
912 |
|
|
fail "step at do_children_tests (timeout)"
|
913 |
|
|
}
|
914 |
|
|
}
|
915 |
|
|
|
916 |
|
|
# Test: c_variable-5.9
|
917 |
|
|
# Desc: check that func_ptr changed
|
918 |
|
|
mi_gdb_test "-var-update *" \
|
919 |
|
|
"\\^done,changelist=\{name=\"struct_declarations.func_ptr\",in_scope=\"true\",type_changed=\"false\"\}" \
|
920 |
|
|
"update all vars struct_declarations.func_ptr changed"
|
921 |
|
|
|
922 |
|
|
# Delete all variables
|
923 |
|
|
mi_gdb_test "-var-delete struct_declarations" \
|
924 |
|
|
"\\^done,ndeleted=\"65\"" \
|
925 |
|
|
"delete var struct_declarations"
|
926 |
|
|
|
927 |
|
|
mi_gdb_test "-var-delete weird->int_ptr_ptr" \
|
928 |
|
|
"\\^done,ndeleted=\"3\"" \
|
929 |
|
|
"delete var weird->int_ptr_ptr"
|
930 |
|
|
|
931 |
|
|
# Step over all lines:
|
932 |
|
|
# ...
|
933 |
|
|
# psnp = &snp0;
|
934 |
|
|
send_gdb "-exec-step 43\n"
|
935 |
|
|
gdb_expect {
|
936 |
|
|
-re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\{\},file=\".*var-cmd.c\",line=\"254\"\}\r\n$mi_gdb_prompt$" {
|
937 |
|
|
pass "step at do_children_tests"
|
938 |
|
|
}
|
939 |
|
|
timeout {
|
940 |
|
|
fail "step at do_children_tests (timeout)"
|
941 |
|
|
}
|
942 |
|
|
}
|
943 |
|
|
|
944 |
|
|
# Test: c_variable-5.10
|
945 |
|
|
# Desc: create psnp->char_ptr
|
946 |
|
|
mi_gdb_test "-var-create psnp->char_ptr * psnp->char_ptr" \
|
947 |
|
|
"\\^done,name=\"psnp->char_ptr\",numchild=\"1\",type=\"char \\*\\*\\*\\*\"" \
|
948 |
|
|
"create local variable psnp->char_ptr"
|
949 |
|
|
|
950 |
|
|
# Test: c_variable-5.11
|
951 |
|
|
# Desc: children of psnp->char_ptr
|
952 |
|
|
mi_gdb_test "-var-list-children psnp->char_ptr" \
|
953 |
|
|
"\\^done,numchild=\"1\",children=\{child=\{name=\"psnp->char_ptr.\\*psnp->char_ptr\",exp=\"\\*psnp->char_ptr\",numchild=\"1\",type=\"char \\*\\*\\*\"\}\}" \
|
954 |
|
|
"get children of psnp->char_ptr"
|
955 |
|
|
|
956 |
|
|
# Test: c_variable-5.12
|
957 |
|
|
# Desc: number of children of psnp->char_ptr
|
958 |
|
|
mi_gdb_test "-var-info-num-children psnp->char_ptr" \
|
959 |
|
|
"\\^done,numchild=\"1\"" \
|
960 |
|
|
"get number of children of psnp->char_ptr"
|
961 |
|
|
|
962 |
|
|
# Test: c_variable-5.13
|
963 |
|
|
# Desc: children of *(psnp->char_ptr)
|
964 |
|
|
mi_gdb_test "-var-list-children psnp->char_ptr.*psnp->char_ptr" \
|
965 |
|
|
"\\^done,numchild=\"1\",children=\{child=\{name=\"psnp->char_ptr.\\*psnp->char_ptr.\\*\\*psnp->char_ptr\",exp=\"\\*\\*psnp->char_ptr\",numchild=\"1\",type=\"char \\*\\*\"\}\}" \
|
966 |
|
|
"get children of psnp->char_ptr.*psnp->char_ptr"
|
967 |
|
|
|
968 |
|
|
# Test: c_variable-5.14
|
969 |
|
|
# Desc: number of children of *(psnp->char_ptr)
|
970 |
|
|
mi_gdb_test "-var-info-num-children psnp->char_ptr.*psnp->char_ptr" \
|
971 |
|
|
"\\^done,numchild=\"1\"" \
|
972 |
|
|
"get number of children of psnp->char_ptr.*psnp->char_ptr"
|
973 |
|
|
|
974 |
|
|
# Test: c_variable-5.15
|
975 |
|
|
# Desc: children of *(*(psnp->char_ptr))
|
976 |
|
|
mi_gdb_test "-var-list-children psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr" \
|
977 |
|
|
"\\^done,numchild=\"1\",children=\{child=\{name=\"psnp->char_ptr.\\*psnp->char_ptr.\\*\\*psnp->char_ptr.\\*\\*\\*psnp->char_ptr\",exp=\"\\*\\*\\*psnp->char_ptr\",numchild=\"1\",type=\"char \\*\"\}\}" \
|
978 |
|
|
"get children of psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr"
|
979 |
|
|
|
980 |
|
|
# Test: c_variable-5.15B
|
981 |
|
|
# Desc: children of *(*(*(psnp->char_ptr)))
|
982 |
|
|
mi_gdb_test "-var-list-children psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr.***psnp->char_ptr" \
|
983 |
|
|
"\\^done,numchild=\"1\",children=\{child=\{name=\"psnp->char_ptr.\\*psnp->char_ptr.\\*\\*psnp->char_ptr.\\*\\*\\*psnp->char_ptr.\\*\\*\\*\\*psnp->char_ptr\",exp=\"\\*\\*\\*\\*psnp->char_ptr\",numchild=\"0\",type=\"char\"\}\}" \
|
984 |
|
|
"get children of psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr"
|
985 |
|
|
|
986 |
|
|
# Test: c_variable-5.16
|
987 |
|
|
# Desc: number of children of *(*(psnp->char_ptr))
|
988 |
|
|
mi_gdb_test "-var-info-num-children psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr" \
|
989 |
|
|
"\\^done,numchild=\"1\"" \
|
990 |
|
|
"get number of children of psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr"
|
991 |
|
|
|
992 |
|
|
# Test: c_variable-5.17
|
993 |
|
|
# Desc: children of *(*(*(psnp->char_ptr)))
|
994 |
|
|
mi_gdb_test "-var-list-children psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr.***psnp->char_ptr" \
|
995 |
|
|
"\\^done,numchild=\"1\",children=\{child=\{name=\"psnp->char_ptr.\\*psnp->char_ptr.\\*\\*psnp->char_ptr.\\*\\*\\*psnp->char_ptr.\\*\\*\\*\\*psnp->char_ptr\",exp=\"\\*\\*\\*\\*psnp->char_ptr\",numchild=\"0\",type=\"char\"\}\}" \
|
996 |
|
|
"get children of psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr.***psnp->char_ptr"
|
997 |
|
|
|
998 |
|
|
# Test: c_variable-5.18
|
999 |
|
|
# Desc: number of children of *(*(*(psnp->char_ptr)))
|
1000 |
|
|
mi_gdb_test "-var-info-num-children psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr.***psnp->char_ptr" \
|
1001 |
|
|
"\\^done,numchild=\"1\"" \
|
1002 |
|
|
"get number of children of psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr.***psnp->char_ptr"
|
1003 |
|
|
|
1004 |
|
|
# Test: c_variable-5.17B
|
1005 |
|
|
# Desc: children of *(*(*(*(psnp->char_ptr))))
|
1006 |
|
|
mi_gdb_test "-var-list-children psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr.***psnp->char_ptr.****psnp->char_ptr" \
|
1007 |
|
|
"\\^done,numchild=\"0\"" \
|
1008 |
|
|
"get children of psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr.***psnp->char_ptr.****psnp->char_ptr"
|
1009 |
|
|
|
1010 |
|
|
# Test: c_variable-5.18B
|
1011 |
|
|
# Desc: number of children of *(*(*(*(psnp->char_ptr))))
|
1012 |
|
|
mi_gdb_test "-var-info-num-children psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr.***psnp->char_ptr.****psnp->char_ptr" \
|
1013 |
|
|
"\\^done,numchild=\"0\"" \
|
1014 |
|
|
"get number of children of psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr.***psnp->char_ptr.****psnp->char_ptr"
|
1015 |
|
|
|
1016 |
|
|
|
1017 |
|
|
# Test: c_variable-5.19
|
1018 |
|
|
# Desc: create psnp->long_ptr
|
1019 |
|
|
mi_gdb_test "-var-create psnp->long_ptr * psnp->long_ptr" \
|
1020 |
|
|
"\\^done,name=\"psnp->long_ptr\",numchild=\"1\",type=\"long int \\*\\*\\*\\*\"" \
|
1021 |
|
|
"create local variable psnp->long_ptr"
|
1022 |
|
|
|
1023 |
|
|
# Test: c_variable-5.20
|
1024 |
|
|
# Desc: children of psnp->long_ptr
|
1025 |
|
|
mi_gdb_test "-var-list-children psnp->long_ptr" \
|
1026 |
|
|
"\\^done,numchild=\"1\",children=\{child=\{name=\"psnp->long_ptr.\\*psnp->long_ptr\",exp=\"\\*psnp->long_ptr\",numchild=\"1\",type=\"long int \\*\\*\\*\"\}\}" \
|
1027 |
|
|
"get children of psnp->long_ptr"
|
1028 |
|
|
|
1029 |
|
|
# Test: c_variable-5.21
|
1030 |
|
|
# Desc: number of children of psnp->long_ptr
|
1031 |
|
|
mi_gdb_test "-var-info-num-children psnp->long_ptr" \
|
1032 |
|
|
"\\^done,numchild=\"1\"" \
|
1033 |
|
|
"get number of children of psnp->long_ptr"
|
1034 |
|
|
|
1035 |
|
|
# Test: c_variable-5.22
|
1036 |
|
|
# Desc: children of *(psnp->long_ptr)
|
1037 |
|
|
mi_gdb_test "-var-list-children psnp->long_ptr.*psnp->long_ptr" \
|
1038 |
|
|
"\\^done,numchild=\"1\",children=\{child=\{name=\"psnp->long_ptr.\\*psnp->long_ptr.\\*\\*psnp->long_ptr\",exp=\"\\*\\*psnp->long_ptr\",numchild=\"1\",type=\"long int \\*\\*\"\}\}" \
|
1039 |
|
|
"get children of psnp->long_ptr.*psnp->long_ptr"
|
1040 |
|
|
|
1041 |
|
|
|
1042 |
|
|
# Test: c_variable-5.23
|
1043 |
|
|
# Desc: number of children of *(psnp->long_ptr)
|
1044 |
|
|
mi_gdb_test "-var-info-num-children psnp->long_ptr.*psnp->long_ptr" \
|
1045 |
|
|
"\\^done,numchild=\"1\"" \
|
1046 |
|
|
"get number of children of psnp->long_ptr.*psnp->long_ptr"
|
1047 |
|
|
|
1048 |
|
|
# Test: c_variable-5.24
|
1049 |
|
|
# Desc: children of *(*(psnp->long_ptr))
|
1050 |
|
|
mi_gdb_test "-var-list-children psnp->long_ptr.*psnp->long_ptr.**psnp->long_ptr" \
|
1051 |
|
|
"\\^done,numchild=\"1\",children=\{child=\{name=\"psnp->long_ptr.\\*psnp->long_ptr.\\*\\*psnp->long_ptr.\\*\\*\\*psnp->long_ptr\",exp=\"\\*\\*\\*psnp->long_ptr\",numchild=\"1\",type=\"long int \\*\"\}\}" \
|
1052 |
|
|
"get children of psnp->long_ptr.*psnp->long_ptr.**psnp->long_ptr"
|
1053 |
|
|
|
1054 |
|
|
# Test: c_variable-5.25
|
1055 |
|
|
# Desc: number of children of *(*(psnp->long_ptr))
|
1056 |
|
|
mi_gdb_test "-var-info-num-children psnp->long_ptr.*psnp->long_ptr.**psnp->long_ptr" \
|
1057 |
|
|
"\\^done,numchild=\"1\"" \
|
1058 |
|
|
"get number of children of psnp->long_ptr.*psnp->long_ptr.**psnp->long_ptr"
|
1059 |
|
|
|
1060 |
|
|
# Test: c_variable-5.26
|
1061 |
|
|
# Desc: children of *(*(*(psnp->long_ptr)))
|
1062 |
|
|
mi_gdb_test "-var-list-children psnp->long_ptr.*psnp->long_ptr.**psnp->long_ptr.***psnp->long_ptr" \
|
1063 |
|
|
"\\^done,numchild=\"1\",children=\{child=\{name=\"psnp->long_ptr.\\*psnp->long_ptr.\\*\\*psnp->long_ptr.\\*\\*\\*psnp->long_ptr.\\*\\*\\*\\*psnp->long_ptr\",exp=\"\\*\\*\\*\\*psnp->long_ptr\",numchild=\"0\",type=\"long int\"\}\}" \
|
1064 |
|
|
"get children of psnp->long_ptr.*psnp->long_ptr.**psnp->long_ptr.***psnp->long_ptr"
|
1065 |
|
|
|
1066 |
|
|
# Test: c_variable-5.27
|
1067 |
|
|
# Desc: number of children of *(*(*(psnp->long_ptr)))
|
1068 |
|
|
mi_gdb_test "-var-info-num-children psnp->long_ptr.*psnp->long_ptr.**psnp->long_ptr.***psnp->long_ptr" \
|
1069 |
|
|
"\\^done,numchild=\"1\"" \
|
1070 |
|
|
"get number of children of psnp->long_ptr.*psnp->long_ptr.**psnp->long_ptr.***psnp->long_ptr"
|
1071 |
|
|
|
1072 |
|
|
# Test: c_variable-5.28
|
1073 |
|
|
# Desc: children of *(*(*(*(psnp->long_ptr))))
|
1074 |
|
|
mi_gdb_test "-var-list-children psnp->long_ptr.*psnp->long_ptr.**psnp->long_ptr.***psnp->long_ptr.****psnp->long_ptr" \
|
1075 |
|
|
"\\^done,numchild=\"0\"" \
|
1076 |
|
|
"get children of psnp->long_ptr.*psnp->long_ptr.**psnp->long_ptr.***psnp->long_ptr.****psnp->long_ptr"
|
1077 |
|
|
|
1078 |
|
|
# Test: c_variable-5.29
|
1079 |
|
|
# Desc: number of children of *(*(*(*(psnp->long_ptr))))
|
1080 |
|
|
mi_gdb_test "-var-info-num-children psnp->long_ptr.*psnp->long_ptr.**psnp->long_ptr.***psnp->long_ptr.****psnp->long_ptr" \
|
1081 |
|
|
"\\^done,numchild=\"0\"" \
|
1082 |
|
|
"get number of children of psnp->long_ptr.*psnp->long_ptr.**psnp->long_ptr.***psnp->long_ptr.****psnp->long_ptr"
|
1083 |
|
|
|
1084 |
|
|
# Test: c_variable-5.30
|
1085 |
|
|
# Desc: create psnp->ptrs
|
1086 |
|
|
mi_gdb_test "-var-create psnp->ptrs * psnp->ptrs" \
|
1087 |
|
|
"\\^done,name=\"psnp->ptrs\",numchild=\"3\",type=\"struct _struct_n_pointer \\*\\\[3\\\]\"" \
|
1088 |
|
|
"create local variable psnp->ptrs"
|
1089 |
|
|
|
1090 |
|
|
# Test: c_variable-5.31
|
1091 |
|
|
# Desc: children of psnp->ptrs
|
1092 |
|
|
mi_gdb_test "-var-list-children psnp->ptrs" \
|
1093 |
|
|
"\\^done,numchild=\"3\",children=\{child=\{name=\"psnp->ptrs.0\",exp=\"0\",numchild=\"4\",type=\"struct _struct_n_pointer \\*\"\},child=\{name=\"psnp->ptrs.1\",exp=\"1\",numchild=\"4\",type=\"struct _struct_n_pointer \\*\"\},child=\{name=\"psnp->ptrs.2\",exp=\"2\",numchild=\"4\",type=\"struct _struct_n_pointer \\*\"\}\}" \
|
1094 |
|
|
"get children of psnp->ptrs"
|
1095 |
|
|
|
1096 |
|
|
# Test: c_variable-5.32
|
1097 |
|
|
# Desc: number of children of psnp->ptrs
|
1098 |
|
|
mi_gdb_test "-var-info-num-children psnp->ptrs" \
|
1099 |
|
|
"\\^done,numchild=\"3\"" \
|
1100 |
|
|
"get number of children of psnp->ptrs"
|
1101 |
|
|
|
1102 |
|
|
# Test: c_variable-5.33
|
1103 |
|
|
# Desc: children of psnp->ptrs[0]
|
1104 |
|
|
mi_gdb_test "-var-list-children psnp->ptrs.0" \
|
1105 |
|
|
"\\^done,numchild=\"4\",children=\{child=\{name=\"psnp->ptrs.0.char_ptr\",exp=\"char_ptr\",numchild=\"1\",type=\"char \\*\\*\\*\\*\"\},child=\{name=\"psnp->ptrs.0.long_ptr\",exp=\"long_ptr\",numchild=\"1\",type=\"long int \\*\\*\\*\\*\"\},child=\{name=\"psnp->ptrs.0.ptrs\",exp=\"ptrs\",numchild=\"3\",type=\"struct _struct_n_pointer \\*\\\[3\\\]\"\},child=\{name=\"psnp->ptrs.0.next\",exp=\"next\",numchild=\"4\",type=\"struct _struct_n_pointer \\*\"\}\}" \
|
1106 |
|
|
"get children of psnp->ptrs.0"
|
1107 |
|
|
|
1108 |
|
|
# Test: c_variable-5.34
|
1109 |
|
|
# Desc: number of children of psnp->ptrs[0]
|
1110 |
|
|
mi_gdb_test "-var-info-num-children psnp->ptrs.0" \
|
1111 |
|
|
"\\^done,numchild=\"4\"" \
|
1112 |
|
|
"get number of children of psnp->ptrs.0"
|
1113 |
|
|
|
1114 |
|
|
# Test: c_variable-5.35
|
1115 |
|
|
# Desc: children of psnp->ptrs[0]->next
|
1116 |
|
|
mi_gdb_test "-var-list-children psnp->ptrs.0.next" \
|
1117 |
|
|
"\\^done,numchild=\"4\",children=\{child=\{name=\"psnp->ptrs.0.next.char_ptr\",exp=\"char_ptr\",numchild=\"1\",type=\"char \\*\\*\\*\\*\"\},child=\{name=\"psnp->ptrs.0.next.long_ptr\",exp=\"long_ptr\",numchild=\"1\",type=\"long int \\*\\*\\*\\*\"\},child=\{name=\"psnp->ptrs.0.next.ptrs\",exp=\"ptrs\",numchild=\"3\",type=\"struct _struct_n_pointer \\*\\\[3\\\]\"\},child=\{name=\"psnp->ptrs.0.next.next\",exp=\"next\",numchild=\"4\",type=\"struct _struct_n_pointer \\*\"\}\}" \
|
1118 |
|
|
"get children of psnp->ptrs.0.next"
|
1119 |
|
|
|
1120 |
|
|
#} {char_ptr long_ptr ptrs next}
|
1121 |
|
|
|
1122 |
|
|
# Test: c_variable-5.36
|
1123 |
|
|
# Desc: number of children of psnp->ptrs[0]->next
|
1124 |
|
|
mi_gdb_test "-var-info-num-children psnp->ptrs.0.next" \
|
1125 |
|
|
"\\^done,numchild=\"4\"" \
|
1126 |
|
|
"get number of children of psnp->ptrs.0.next"
|
1127 |
|
|
|
1128 |
|
|
|
1129 |
|
|
# Test: c_variable-5.37
|
1130 |
|
|
# Desc: children of psnp->ptrs[0]->next->char_ptr
|
1131 |
|
|
mi_gdb_test "-var-list-children psnp->ptrs.0.next.char_ptr" \
|
1132 |
|
|
"\\^done,numchild=\"1\",children=\{child=\{name=\"psnp->ptrs.0.next.char_ptr.\\*char_ptr\",exp=\"\\*char_ptr\",numchild=\"1\",type=\"char \\*\\*\\*\"\}\}" \
|
1133 |
|
|
"get children of psnp->ptrs.0.next.char_ptr"
|
1134 |
|
|
|
1135 |
|
|
#gdbtk_test c_variable-5.37 {children of psnp->ptrs[0]->next->char_ptr} {
|
1136 |
|
|
# get_children psnp->ptrs.0.next.char_ptr
|
1137 |
|
|
#} {*char_ptr}
|
1138 |
|
|
|
1139 |
|
|
# Test: c_variable-5.38
|
1140 |
|
|
# Desc: number of children of psnp->ptrs[0]->next->char_ptr
|
1141 |
|
|
mi_gdb_test "-var-info-num-children psnp->ptrs.0.next.char_ptr" \
|
1142 |
|
|
"\\^done,numchild=\"1\"" \
|
1143 |
|
|
"get number of children of psnp->ptrs.0.next.char_ptr"
|
1144 |
|
|
|
1145 |
|
|
# Test: c_variable-5.39
|
1146 |
|
|
# Desc: children of *psnp->ptrs[0]->next->char_ptr
|
1147 |
|
|
mi_gdb_test "-var-list-children psnp->ptrs.0.next.char_ptr.*char_ptr" \
|
1148 |
|
|
"\\^done,numchild=\"1\",children=\{child=\{name=\"psnp->ptrs.0.next.char_ptr.\\*char_ptr.\\*\\*char_ptr\",exp=\"\\*\\*char_ptr\",numchild=\"1\",type=\"char \\*\\*\"\}\}" \
|
1149 |
|
|
"get children of psnp->ptrs.0.next.char_ptr.*char_ptr"
|
1150 |
|
|
|
1151 |
|
|
# Test: c_variable-5.40
|
1152 |
|
|
# Desc: number of children of *psnp->ptrs[0]->next->char_ptr
|
1153 |
|
|
mi_gdb_test "-var-info-num-children psnp->ptrs.0.next.char_ptr.*char_ptr" \
|
1154 |
|
|
"\\^done,numchild=\"1\"" \
|
1155 |
|
|
"get number of children of psnp->ptrs.0.next.char_ptr.*char_ptr"
|
1156 |
|
|
|
1157 |
|
|
# Test: c_variable-5.41
|
1158 |
|
|
# Desc: children of **psnp->ptrs[0]->next->char_ptr
|
1159 |
|
|
mi_gdb_test "-var-list-children psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr" \
|
1160 |
|
|
"\\^done,numchild=\"1\",children=\{child=\{name=\"psnp->ptrs.0.next.char_ptr.\\*char_ptr.\\*\\*char_ptr.\\*\\*\\*char_ptr\",exp=\"\\*\\*\\*char_ptr\",numchild=\"1\",type=\"char \\*\"\}\}" \
|
1161 |
|
|
"get children of psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr"
|
1162 |
|
|
|
1163 |
|
|
# Test: c_variable-5.41B
|
1164 |
|
|
# Desc: children of ***psnp->ptrs[0]->next->char_ptr
|
1165 |
|
|
mi_gdb_test "-var-list-children psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr.***char_ptr" \
|
1166 |
|
|
"\\^done,numchild=\"1\",children=\{child=\{name=\"psnp->ptrs.0.next.char_ptr.\\*char_ptr.\\*\\*char_ptr.\\*\\*\\*char_ptr.\\*\\*\\*\\*char_ptr\",exp=\"\\*\\*\\*\\*char_ptr\",numchild=\"0\",type=\"char\"\}\}" \
|
1167 |
|
|
"get children of psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr"
|
1168 |
|
|
|
1169 |
|
|
# Test: c_variable-5.42
|
1170 |
|
|
# Desc: number of children of **psnp->ptrs[0]->next->char_ptr
|
1171 |
|
|
mi_gdb_test "-var-info-num-children psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr" \
|
1172 |
|
|
"\\^done,numchild=\"1\"" \
|
1173 |
|
|
"get number of children of psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr"
|
1174 |
|
|
|
1175 |
|
|
# Test: c_variable-5.43
|
1176 |
|
|
# Desc: children of ***psnp->ptrs[0]->next->char_ptr
|
1177 |
|
|
mi_gdb_test "-var-list-children psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr.***char_ptr" \
|
1178 |
|
|
"\\^done,numchild=\"1\",children=\{child=\{name=\"psnp->ptrs.0.next.char_ptr.\\*char_ptr.\\*\\*char_ptr.\\*\\*\\*char_ptr.\\*\\*\\*\\*char_ptr\",exp=\"\\*\\*\\*\\*char_ptr\",numchild=\"0\",type=\"char\"\}\}" \
|
1179 |
|
|
"get children of psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr.***char_ptr"
|
1180 |
|
|
|
1181 |
|
|
# Test: c_variable-5.44
|
1182 |
|
|
# Desc: number of children of ***psnp->ptrs[0]->next->char_ptr
|
1183 |
|
|
mi_gdb_test "-var-info-num-children psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr.***char_ptr" \
|
1184 |
|
|
"\\^done,numchild=\"1\"" \
|
1185 |
|
|
"get number of children of psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr.***char_ptr"
|
1186 |
|
|
|
1187 |
|
|
# Test: c_variable-5.43B
|
1188 |
|
|
# Desc: children of ****psnp->ptrs[0]->next->char_ptr
|
1189 |
|
|
mi_gdb_test "-var-list-children psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr.***char_ptr.****char_ptr" \
|
1190 |
|
|
"\\^done,numchild=\"0\"" \
|
1191 |
|
|
"get children of psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr.***char_ptr"
|
1192 |
|
|
|
1193 |
|
|
# Test: c_variable-5.44B
|
1194 |
|
|
# Desc: number of children of ****psnp->ptrs[0]->next->char_ptr
|
1195 |
|
|
mi_gdb_test "-var-info-num-children psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr.***char_ptr.****char_ptr" \
|
1196 |
|
|
"\\^done,numchild=\"0\"" \
|
1197 |
|
|
"get number of children of psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr.***char_ptr"
|
1198 |
|
|
|
1199 |
|
|
# Test: c_variable-5.45
|
1200 |
|
|
# Desc: children of psnp->ptrs[0]->next->next
|
1201 |
|
|
mi_gdb_test "-var-list-children psnp->ptrs.0.next.next" \
|
1202 |
|
|
"\\^done,numchild=\"4\",children=\{child=\{name=\"psnp->ptrs.0.next.next.char_ptr\",exp=\"char_ptr\",numchild=\"1\",type=\"char \\*\\*\\*\\*\"\},child=\{name=\"psnp->ptrs.0.next.next.long_ptr\",exp=\"long_ptr\",numchild=\"1\",type=\"long int \\*\\*\\*\\*\"\},child=\{name=\"psnp->ptrs.0.next.next.ptrs\",exp=\"ptrs\",numchild=\"3\",type=\"struct _struct_n_pointer \\*\\\[3\\\]\"\},child=\{name=\"psnp->ptrs.0.next.next.next\",exp=\"next\",numchild=\"4\",type=\"struct _struct_n_pointer \\*\"\}\}" \
|
1203 |
|
|
"get children of psnp->ptrs.0.next.next"
|
1204 |
|
|
|
1205 |
|
|
# Test: c_variable-5.46
|
1206 |
|
|
# Desc: children of psnp->ptrs[0]->next->next->ptrs
|
1207 |
|
|
mi_gdb_test "-var-list-children psnp->ptrs.0.next.next.ptrs" \
|
1208 |
|
|
"\\^done,numchild=\"3\",children=\{child=\{name=\"psnp->ptrs.0.next.next.ptrs.0\",exp=\"0\",numchild=\"4\",type=\"struct _struct_n_pointer \\*\"\},child=\{name=\"psnp->ptrs.0.next.next.ptrs.1\",exp=\"1\",numchild=\"4\",type=\"struct _struct_n_pointer \\*\"\},child=\{name=\"psnp->ptrs.0.next.next.ptrs.2\",exp=\"2\",numchild=\"4\",type=\"struct _struct_n_pointer \\*\"\}\}" \
|
1209 |
|
|
"get children of psnp->ptrs.0.next.next.ptrs"
|
1210 |
|
|
|
1211 |
|
|
# Step over "snp0.char_ptr = &b3;"
|
1212 |
|
|
send_gdb "-exec-step\n"
|
1213 |
|
|
gdb_expect {
|
1214 |
|
|
-re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\{\},file=\".*var-cmd.c\",line=\"255\"\}\r\n$mi_gdb_prompt$" {
|
1215 |
|
|
pass "step at do_children_tests"
|
1216 |
|
|
}
|
1217 |
|
|
timeout {
|
1218 |
|
|
fail "step at do_children_tests (timeout)"
|
1219 |
|
|
}
|
1220 |
|
|
}
|
1221 |
|
|
|
1222 |
|
|
# Test: c_variable-5.47
|
1223 |
|
|
# Desc: check that psnp->char_ptr (and [0].char_ptr) changed
|
1224 |
|
|
mi_gdb_test "-var-update *" \
|
1225 |
|
|
"\\^done,changelist=\{name=\"psnp->ptrs.0.char_ptr\",in_scope=\"true\",type_changed=\"false\",name=\"psnp->char_ptr\",in_scope=\"true\",type_changed=\"false\",name=\"psnp->char_ptr.\\*psnp->char_ptr\",in_scope=\"true\",type_changed=\"false\",name=\"psnp->char_ptr.\\*psnp->char_ptr.\\*\\*psnp->char_ptr\",in_scope=\"true\",type_changed=\"false\",name=\"psnp->char_ptr.\\*psnp->char_ptr.\\*\\*psnp->char_ptr.\\*\\*\\*psnp->char_ptr\",in_scope=\"true\",type_changed=\"false\",name=\"psnp->char_ptr.\\*psnp->char_ptr.\\*\\*psnp->char_ptr.\\*\\*\\*psnp->char_ptr.\\*\\*\\*\\*psnp->char_ptr\",in_scope=\"true\",type_changed=\"false\"\}" \
|
1226 |
|
|
"update all vars psnp->char_ptr (and 0.char_ptr) changed"
|
1227 |
|
|
|
1228 |
|
|
# Step over "snp1.char_ptr = &c3;"
|
1229 |
|
|
send_gdb "-exec-step\n"
|
1230 |
|
|
gdb_expect {
|
1231 |
|
|
-re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\{\},file=\".*var-cmd.c\",line=\"256\"\}\r\n$mi_gdb_prompt$" {
|
1232 |
|
|
pass "step at do_children_tests"
|
1233 |
|
|
}
|
1234 |
|
|
timeout {
|
1235 |
|
|
fail "step at do_children_tests (timeout)"
|
1236 |
|
|
}
|
1237 |
|
|
}
|
1238 |
|
|
|
1239 |
|
|
|
1240 |
|
|
# Test: c_variable-5.48
|
1241 |
|
|
# Desc: check that psnp->next->char_ptr (and [1].char_ptr) changed
|
1242 |
|
|
mi_gdb_test "-var-update *" \
|
1243 |
|
|
"\\^done,changelist=\{name=\"psnp->ptrs.0.next.char_ptr\",in_scope=\"true\",type_changed=\"false\",name=\"psnp->ptrs.0.next.char_ptr.\\*char_ptr\",in_scope=\"true\",type_changed=\"false\",name=\"psnp->ptrs.0.next.char_ptr.\\*char_ptr.\\*\\*char_ptr\",in_scope=\"true\",type_changed=\"false\",name=\"psnp->ptrs.0.next.char_ptr.\\*char_ptr.\\*\\*char_ptr.\\*\\*\\*char_ptr\",in_scope=\"true\",type_changed=\"false\",name=\"psnp->ptrs.0.next.char_ptr.\\*char_ptr.\\*\\*char_ptr.\\*\\*\\*char_ptr.\\*\\*\\*\\*char_ptr\",in_scope=\"true\",type_changed=\"false\"\}" \
|
1244 |
|
|
"update all vars psnp->next->char_ptr (and 1.char_ptr) changed"
|
1245 |
|
|
|
1246 |
|
|
|
1247 |
|
|
# Step over "snp2.char_ptr = &a3;"
|
1248 |
|
|
send_gdb "-exec-step\n"
|
1249 |
|
|
gdb_expect {
|
1250 |
|
|
-re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\{\},file=\".*var-cmd.c\",line=\"257\"\}\r\n$mi_gdb_prompt$" {
|
1251 |
|
|
pass "step at do_children_tests"
|
1252 |
|
|
}
|
1253 |
|
|
timeout {
|
1254 |
|
|
fail "step at do_children_tests (timeout)"
|
1255 |
|
|
}
|
1256 |
|
|
}
|
1257 |
|
|
|
1258 |
|
|
|
1259 |
|
|
# Test: c_variable-5.49
|
1260 |
|
|
# Desc: check that psnp->next->next->char_ptr (and [2].char_ptr) changed
|
1261 |
|
|
mi_gdb_test "-var-update *" \
|
1262 |
|
|
"\\^done,changelist=\{name=\"psnp->ptrs.0.next.next.char_ptr\",in_scope=\"true\",type_changed=\"false\"\}" \
|
1263 |
|
|
"update all vars psnp->next->next->char_ptr (and 2.char_ptr) changed"
|
1264 |
|
|
|
1265 |
|
|
|
1266 |
|
|
# Step over "snp0.long_ptr = &y3;"
|
1267 |
|
|
send_gdb "-exec-step\n"
|
1268 |
|
|
gdb_expect {
|
1269 |
|
|
-re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\{\},file=\".*var-cmd.c\",line=\"258\"\}\r\n$mi_gdb_prompt$" {
|
1270 |
|
|
pass "step at do_children_tests"
|
1271 |
|
|
}
|
1272 |
|
|
timeout {
|
1273 |
|
|
fail "step at do_children_tests (timeout)"
|
1274 |
|
|
}
|
1275 |
|
|
}
|
1276 |
|
|
|
1277 |
|
|
# Test: c_variable-5.50
|
1278 |
|
|
# Desc: check that psnp->long_ptr (and [0].long_ptr) changed
|
1279 |
|
|
mi_gdb_test "-var-update *" \
|
1280 |
|
|
"\\^done,changelist=\{name=\"psnp->ptrs.0.long_ptr\",in_scope=\"true\",type_changed=\"false\",name=\"psnp->long_ptr\",in_scope=\"true\",type_changed=\"false\",name=\"psnp->long_ptr.\\*psnp->long_ptr\",in_scope=\"true\",type_changed=\"false\",name=\"psnp->long_ptr.\\*psnp->long_ptr.\\*\\*psnp->long_ptr\",in_scope=\"true\",type_changed=\"false\",name=\"psnp->long_ptr.\\*psnp->long_ptr.\\*\\*psnp->long_ptr.\\*\\*\\*psnp->long_ptr\",in_scope=\"true\",type_changed=\"false\",name=\"psnp->long_ptr.\\*psnp->long_ptr.\\*\\*psnp->long_ptr.\\*\\*\\*psnp->long_ptr.\\*\\*\\*\\*psnp->long_ptr\",in_scope=\"true\",type_changed=\"false\"\}" \
|
1281 |
|
|
"update all vars psnp->long_ptr (and 0.long_ptr) changed"
|
1282 |
|
|
|
1283 |
|
|
|
1284 |
|
|
# Step over "snp1.long_ptr = &x3;"
|
1285 |
|
|
send_gdb "-exec-step\n"
|
1286 |
|
|
gdb_expect {
|
1287 |
|
|
-re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\{\},file=\".*var-cmd.c\",line=\"259\"\}\r\n$mi_gdb_prompt$" {
|
1288 |
|
|
pass "step at do_children_tests"
|
1289 |
|
|
}
|
1290 |
|
|
timeout {
|
1291 |
|
|
fail "step at do_children_tests (timeout)"
|
1292 |
|
|
}
|
1293 |
|
|
}
|
1294 |
|
|
|
1295 |
|
|
|
1296 |
|
|
# Test: c_variable-5.51
|
1297 |
|
|
# Desc: check that psnp->next->long_ptr (and [1].long_ptr) changed
|
1298 |
|
|
# Why does this have a FIXME?
|
1299 |
|
|
setup_xfail *-*-*
|
1300 |
|
|
mi_gdb_test "-var-update *" \
|
1301 |
|
|
"FIXME\\^done,changelist=\{name=\"psnp->ptrs.0.next.long_ptr\",in_scope=\"true\",type_changed=\"false\"\}" \
|
1302 |
|
|
"update all vars psnp->next->long_ptr (and 1.long_ptr) changed"
|
1303 |
|
|
clear_xfail *-*-*
|
1304 |
|
|
|
1305 |
|
|
# This command produces this error message:
|
1306 |
|
|
# &"warning: varobj_list: assertion failed - mycount <> 0\n"
|
1307 |
|
|
#
|
1308 |
|
|
|
1309 |
|
|
# Step over "snp2.long_ptr = &z3;"
|
1310 |
|
|
send_gdb "-exec-step\n"
|
1311 |
|
|
gdb_expect {
|
1312 |
|
|
-re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\{\},file=\".*var-cmd.c\",line=\"260\"\}\r\n$mi_gdb_prompt$" {
|
1313 |
|
|
pass "step at do_children_tests"
|
1314 |
|
|
}
|
1315 |
|
|
timeout {
|
1316 |
|
|
fail "step at do_children_tests (timeout)"
|
1317 |
|
|
}
|
1318 |
|
|
}
|
1319 |
|
|
|
1320 |
|
|
|
1321 |
|
|
# Test: c_variable-5.52
|
1322 |
|
|
# Desc: check that psnp->next->next->long_ptr (and [2].long_ptr) changed
|
1323 |
|
|
mi_gdb_test "-var-update *" \
|
1324 |
|
|
"\\^done,changelist=\{name=\"psnp->ptrs.0.next.next.long_ptr\",in_scope=\"true\",type_changed=\"false\"\}" \
|
1325 |
|
|
"update all vars psnp->next->next->long_ptr (and 2.long_ptr) changed"
|
1326 |
|
|
|
1327 |
|
|
|
1328 |
|
|
|
1329 |
|
|
|
1330 |
|
|
mi_gdb_exit
|
1331 |
|
|
return 0
|