OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gdb-6.8/] [gdb/] [testsuite/] [gdb.mi/] [mi2-var-child.exp] - Blame information for rev 840

Details | Compare with Previous | View Log

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

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.