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