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