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

Subversion Repositories or1k

[/] [or1k/] [trunk/] [insight/] [gdb/] [testsuite/] [gdb.gdbtk/] [c_variable.test] - Blame information for rev 1780

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 578 markom
# Varobj Tests (C language)
2
# Copyright 1998, 2001 Red Hat, Inc.
3
#
4
# This Program Is Free software; you can redistribute it and/or modify
5
# it under the terms of the GNU General Public License as published by
6
# the Free Software Foundation; either version 2 of the License, or
7
# (at your option) any later version.
8
#
9
# This program is distributed in the hope that it will be useful,
10
# but WITHOUT ANY WARRANTY; without even the implied warranty of
11
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
# GNU General Public License for more details.
13
#
14
# You should have received a copy of the GNU General Public License
15
# along with this program; if not, write to the Free Software
16
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17
 
18
# Please email any bugs, comments, and/or additions to this file to:
19
# bug-gdb@prep.ai.mit.edu
20
 
21
# This file was written by Keith Seitz (keiths@cygnus.com)
22
 
23
# Read in the standard defs file
24
if {![gdbtk_read_defs]} {
25
  break
26
}
27
 
28
global objdir test_ran
29
 
30
# Load in a file
31
set program [file join $objdir c_variable]
32
if {[catch {gdbtk_test_file $program} t]} {
33
  # This isn't a test case, since if this fails, we're hosed.
34
  gdbtk_test_error "loading \"$program\": $t"
35
}
36
 
37
# The variables that are created are stored in an array called "var".
38
 
39
# proc to tell us which of the variables are changed/out of scope
40
proc check_update {} {
41
  global var
42
 
43
  set changed {}
44
  set unchanged {}
45
  set out {}
46
  #FIXME: Should get a list of root variables instead of using the array
47
  foreach ind [array names var] {
48
    set changed [concat $changed [$var($ind) update]]
49
  }
50
 
51
  foreach ind [array names var] {
52
    set ix [lsearch -exact $changed $var($ind)]
53
    if {$ix < 0} {
54
      lappend unchanged $var($ind)
55
    }
56
  }
57
 
58
  return [list $changed $unchanged $out]
59
}
60
 
61
# proc to create a variable
62
proc create_variable {expr} {
63
  global var
64
 
65
  set err [catch {gdb_variable create "$expr" -expr $expr} v]
66
  if {!$err} {
67
    set var($expr) $v
68
  }
69
 
70
  return $err
71
}
72
 
73
# proc to get the children
74
# Children are stored in the global "var" as
75
# PARENT.child. So for struct _foo {int a; int b} bar;,
76
# the children returned are {a b} and var(bar.a) and var(bar.b)
77
# map the actual objects to their names.
78
proc get_children {parent} {
79
  global var
80
 
81
  set kiddies [$var($parent) children]
82
  set children {}
83
  foreach child $kiddies {
84
    set name [lindex [split $child .] end]
85
    lappend children $name
86
    set var($parent.$name) $child
87
  }
88
 
89
  return $children
90
}
91
 
92
proc delete_variable {varname} {
93
  global var
94
 
95
  if {[info exists var($varname)]} {
96
    # This has to be caught, since deleting a parent
97
    # will erase all children.
98
    $var($varname) delete
99
    set vars [array names var $varname*]
100
    foreach v $vars {
101
      if {[info exists var($v)]} {
102
        unset var($v)
103
      }
104
    }
105
  }
106
}
107
 
108
# Compare the values of variable V in format FMT
109
# with gdb's value.
110
proc value {v fmt} {
111
  global var
112
  global _test
113
 
114
  set value [$var($v) value]
115
  set gdb [gdb_cmd "output/$fmt $v"]
116
  if {$value == $gdb} {
117
    set result ok
118
  } else {
119
    set result $v
120
    puts $_test(logfile) "output/$fmt $v"
121
    puts $_test(logfile) "gdbtk: $value <> gdb: $gdb"
122
  }
123
 
124
  return $result
125
}
126
 
127
proc delete_all_variables {} {
128
  global var
129
 
130
  foreach variable [array names var] {
131
    delete_variable $variable
132
  }
133
}
134
 
135
proc editable_variables {} {
136
  global var
137
 
138
  set yes {}
139
  set no {}
140
  foreach name [array names var] {
141
    if {[$var($name) editable]} {
142
      lappend yes $name
143
    } else {
144
      lappend no $name
145
    }
146
  }
147
 
148
  return [list $yes $no]
149
}
150
 
151
 
152
#####                   #####
153
#                           #
154
#  Variable Creation tests  #
155
#                           #
156
#####                   #####
157
 
158
# Test:  c_variable-1.1
159
# Desc:  Create global variable
160
gdbtk_test c_variable-1.1 {create global variable} {
161
  create_variable global_simple
162
} {0}
163
 
164
# Test: c_variable-1.2
165
# Desc: Create non-existent variable
166
gdbtk_test c_variable-1.2 {create non-existent variable} {
167
  create_variable bogus_unknown_variable
168
} {1}
169
 
170
# Test: c_variable-1.3
171
# Desc: Create out of scope variable
172
gdbtk_test c_variable-1.3 {create out of scope variable} {
173
  create_variable argc
174
} {1}
175
 
176
# Break in main and run
177
gdb_cmd "break do_locals_tests"
178
gdbtk_test_run
179
 
180
# Test: c_variable-1.4
181
# Desc: create local variables
182
gdbtk_test c_variable-1.4 {create local variables} {
183
  set results {}
184
  foreach v {linteger lpinteger lcharacter lpcharacter llong lplong lfloat lpfloat ldouble lpdouble lsimple lpsimple func} {
185
    lappend results [create_variable $v]
186
  }
187
  set results
188
} {0 0 0 0 0 0 0 0 0 0 0 0 0}
189
 
190
# Test: c_variable-1.5
191
# Desc: create lsimple.character
192
gdbtk_test c_variable-1.5 {create lsimple.character} {
193
  create_variable lsimple.character
194
} {0}
195
 
196
# Test: c_variable-1.6
197
# Desc: create lpsimple->integer
198
gdbtk_test c_variable-1.6 {create lpsimple->integer} {
199
  create_variable lpsimple->integer
200
} {0}
201
 
202
# Test: c_variable-1.7
203
# Desc: ceate lsimple.integer
204
gdbtk_test c_variable-1.7 {create lsimple.integer} {
205
  create_variable lsimple.integer
206
} {0}
207
 
208
# Test: c_variable-1.8
209
# Desc: names of editable variables
210
gdbtk_test c_variable-1.8 {names of editable variables} {
211
  editable_variables
212
} {{lsimple.character lsimple.integer lpsimple lcharacter lpcharacter linteger lpinteger lfloat lpfloat func llong lplong lpsimple->integer ldouble lpdouble} {lsimple global_simple}}
213
 
214
# Test: c_variable-1.9
215
# Desc: create type name
216
#    Type names (like int, long, etc..) are all proper expressions to gdb.
217
#    make sure variable code does not allow users to create variables, though.
218
gdbtk_test c_variable-1.9 {create type name} {
219
  create_variable int
220
} {1}
221
 
222
#####             #####
223
#                     #
224
# Value changed tests #
225
#                     #
226
#####             #####
227
 
228
# Test: c_variable-2.1
229
# Desc: check whether values changed at do_block_tests
230
gdbtk_test c_variable-2.1 {check whether values changed at do_block_tests} {
231
  check_update
232
} {{} {lsimple.character lsimple.integer lpsimple lsimple lcharacter lpcharacter global_simple linteger lpinteger lfloat lpfloat func llong lplong lpsimple->integer ldouble lpdouble} {}}
233
 
234
# Step over "linteger = 1234;"
235
gdb_cmd "step"
236
 
237
# Test: c_variable-2.2
238
# Desc: check whether only linteger changed values
239
gdbtk_test c_variable-2.2 {check whether only linteger changed values} {
240
  check_update
241
} {linteger {lsimple.character lsimple.integer lpsimple lsimple lcharacter lpcharacter global_simple lpinteger lfloat lpfloat func llong lplong lpsimple->integer ldouble lpdouble} {}}
242
 
243
# Step over "lpinteger = &linteger;"
244
gdb_cmd "step"
245
 
246
# Test: c_variable-2.3
247
# Desc: check whether only lpinteger changed
248
gdbtk_test c_variable-2.3 {check whether only lpinteger changed} {
249
  check_update
250
} {lpinteger {lsimple.character lsimple.integer lpsimple lsimple lcharacter lpcharacter global_simple linteger lfloat lpfloat func llong lplong lpsimple->integer ldouble lpdouble} {}}
251
 
252
# Step over "lcharacter = 'a';"
253
gdb_cmd "step"
254
 
255
# Test: c_variable-2.4
256
# Desc: check whether only lcharacter changed
257
gdbtk_test c_variable-2.4 {check whether only lcharacter changed} {
258
  check_update
259
} {lcharacter {lsimple.character lsimple.integer lpsimple lsimple lpcharacter global_simple linteger lpinteger lfloat lpfloat func llong lplong lpsimple->integer ldouble lpdouble} {}}
260
 
261
# Step over "lpcharacter = &lcharacter;"
262
gdb_cmd "step"
263
 
264
# Test: c_variable-2.5
265
# Desc: check whether only lpcharacter changed
266
gdbtk_test c_variable-2.5 {check whether only lpcharacter changed} {
267
  check_update
268
} {lpcharacter {lsimple.character lsimple.integer lpsimple lsimple lcharacter global_simple linteger lpinteger lfloat lpfloat func llong lplong lpsimple->integer ldouble lpdouble} {}}
269
 
270
# Step over:
271
#  llong = 2121L;
272
#  lplong = &llong;
273
#  lfloat = 2.1;
274
#  lpfloat = &lfloat;
275
#  ldouble = 2.718281828459045;
276
#  lpdouble = &ldouble;
277
#  lsimple.integer = 1234;
278
#  lsimple.unsigned_integer = 255;
279
#  lsimple.character = 'a';
280
for {set i 0} {$i < 9} {incr i} {
281
  gdb_cmd "step"
282
}
283
 
284
# Test: c_variable-2.6
285
# Desc: check whether llong, lplong, lfloat, lpfloat, ldouble, lpdouble, lsimple.integer,
286
#       lsimple.unsigned_character lsimple.integer lsimple.character changed
287
gdbtk_test c_variable-2.6 {check whether llong -- lsimple.character changed} {
288
  check_update
289
} {{lsimple.character lsimple.integer lfloat lpfloat llong lplong ldouble lpdouble} {lpsimple lsimple lcharacter lpcharacter global_simple linteger lpinteger func lpsimple->integer} {}}
290
 
291
# Step over:
292
#  lsimple.signed_character = 21;
293
#  lsimple.char_ptr = &lcharacter;
294
#  lpsimple = &lsimple;
295
#  func = nothing;
296
for {set i 0} {$i < 4} {incr i} {
297
  gdb_cmd "step"
298
}
299
 
300
# Test: c_variable-2.7
301
# Desc: check whether lsimple.signed_character, lsimple.char_ptr, lpsimple, func changed
302
gdbtk_test c_variable-2.7 {check whether lsimple.signed_character, lsimple.char_ptr, lpsimple, func changed} {
303
  check_update
304
} {{lpsimple func lpsimple->integer} {lsimple.character lsimple.integer lsimple lcharacter lpcharacter global_simple linteger lpinteger lfloat lpfloat llong lplong ldouble lpdouble} {}}
305
 
306
# Step over
307
#  linteger = 4321;
308
#  lcharacter = 'b';
309
#  llong = 1212L;
310
#  lfloat = 1.2;
311
#  ldouble = 5.498548281828172;
312
#  lsimple.integer = 255;
313
#  lsimple.unsigned_integer = 4321;
314
#  lsimple.character = 'b';
315
for {set i 0} {$i < 8} {incr i} {
316
  gdb_cmd "step"
317
}
318
 
319
# Test: c_variable-2.8
320
# Desc: check whether linteger, lcharacter, llong, lfoat, ldouble, lsimple.integer,
321
#       lpsimple.integer lsimple.character changed
322
# Note: this test also checks that lpsimple->integer and lsimple.integer have
323
#       changed (they are the same)
324
gdbtk_test c_variable-2.8 {check whether linteger -- lsimple.integer changed} {
325
  check_update
326
} {{lsimple.character lsimple.integer lcharacter linteger lfloat llong lpsimple->integer ldouble} {lpsimple lsimple lpcharacter global_simple lpinteger lpfloat func lplong lpdouble} {}}
327
 
328
gdb_cmd "break subroutine1"
329
gdb_cmd "continue"
330
 
331
# Test: c_variable-2.9
332
# Desc: stop in subroutine1
333
gdbtk_test c_variable-2.9 {stop in subroutine1} {
334
  lindex [gdb_loc] 1
335
} {subroutine1}
336
 
337
# Test: c_variable-2.10
338
# Desc: create variable for locals i,l in subroutine1
339
gdbtk_test c_variable-2.10 {create variable for locals i,l in subroutine1} {
340
  set r [create_variable i]
341
  lappend r [create_variable l]
342
} {0 0}
343
 
344
# Test: c_variable-2.11
345
# Desc: create do_locals_tests local in subroutine1
346
gdbtk_test c_variable-2.11 {create do_locals_tests local in subroutine1} {
347
  create_variable linteger
348
} {1}
349
 
350
# Step over
351
#  global_simple.integer = i + 3;
352
gdb_cmd "step"
353
 
354
# Test: c_variable-2.12
355
# Desc: change global_simple.integer
356
# Note: This also tests whether we are reporting changes in structs properly.
357
#       gdb normally would say that global_simple has changed, but we
358
#       special case that, since it is not what a human expects to see.
359
gdbtk_test c_variable-2.12 {change global_simple.integer} {
360
  check_update
361
} {{} {lsimple.character lsimple.integer lpsimple lsimple i lcharacter lpcharacter global_simple linteger lpinteger lfloat lpfloat l func llong lplong lpsimple->integer ldouble lpdouble} {}}
362
 
363
# Step over
364
#  i = 212;
365
gdb_cmd "step"
366
 
367
# Test: c_variable-2.13
368
# Desc: change subroutine1 local i
369
gdbtk_test c_variable-2.13 {change subroutine1 local i} {
370
  check_update
371
} {i {lsimple.character lsimple.integer lpsimple lsimple lcharacter lpcharacter global_simple linteger lpinteger lfloat lpfloat l func llong lplong lpsimple->integer ldouble lpdouble} {}}
372
 
373
# Step over
374
#  *l = 12
375
gdb_cmd "step"
376
 
377
# Test: c_variable-2.14
378
# Desc: change do_locals_tests local llong
379
gdbtk_test c_variable-2.14 {change do_locals_tests local llong} {
380
  check_update
381
} {llong {lsimple.character lsimple.integer lpsimple lsimple i lcharacter lpcharacter global_simple linteger lpinteger lfloat lpfloat l func lplong lpsimple->integer ldouble lpdouble} {}}
382
 
383
# Leave subroutine1
384
gdb_cmd "next"
385
 
386
# Test: c_variable-2.15
387
# Desc: check for out of scope subroutine1 locals
388
gdbtk_test *c_variable-2.15 {check for out of scope subroutine1 locals (ops, we don't have a out-of-scope list yet)} {
389
  check_update
390
} {{} {lsimple.character lsimple.integer lpsimple lsimple lcharacter lpcharacter global_simple linteger lpinteger lfloat lpfloat func llong lplong lpsimple->integer ldouble lpdouble} {i l}}
391
 
392
# Test: c_variable-2.16
393
# Desc: names of all editable variables
394
gdbtk_test c_variable-2.16 {names of all editable variables} {
395
  editable_variables
396
} {{lsimple.character lsimple.integer lpsimple i lcharacter lpcharacter linteger lpinteger lfloat lpfloat l func llong lplong lpsimple->integer ldouble lpdouble} {lsimple global_simple}}
397
 
398
# Done with locals/globals tests. Erase all variables
399
delete_all_variables
400
 
401
#####     #####
402
#             #
403
# Block tests #
404
#             #
405
#####     #####
406
gdb_cmd "break do_block_tests"
407
gdb_cmd "continue"
408
 
409
# Test: c_variable-3.1
410
# Desc: stop in do_block_tests
411
gdbtk_test c_variable-3.1 {stop in do_block_tests} {
412
  lindex [gdb_loc] 1
413
} {do_block_tests}
414
 
415
# Test: c_variable-3.2
416
# Desc: create cb and foo
417
gdbtk_test c_variable-3.2 {create cb and foo} {
418
  set r [create_variable cb]
419
  lappend r [create_variable foo]
420
} {0 1}
421
 
422
# step to "foo = 123;"
423
gdb_cmd "step"
424
 
425
# Be paranoid and assume 3.2 created foo
426
delete_variable foo
427
 
428
# Test: c_variable-3.3
429
# Desc: create foo
430
gdbtk_test c_variable-3.3 {create foo} {
431
  create_variable foo
432
} {0}
433
 
434
# step to "foo2 = 123;"
435
gdb_cmd "step"
436
 
437
# Test: c_variable-3.4
438
# Desc: check foo, cb changed
439
gdbtk_test c_variable-3.4 {check foo,cb changed} {
440
  check_update
441
} {{foo cb} {} {}}
442
 
443
# step to "foo = 321;"
444
gdb_cmd "step"
445
 
446
# Test: c_variable-3.5
447
# Desc: create inner block foo
448
gdbtk_test c_variable-3.5 {create inner block foo} {
449
  global var
450
  set err [catch {gdb_variable create inner_foo -expr foo} v]
451
  if {!$err} {
452
    set var(inner_foo) $v
453
  }
454
 
455
  set err
456
} {0}
457
 
458
# step to "foo2 = 0;"
459
gdb_cmd "step"
460
 
461
# Test: c_variable-3.6
462
# Desc: create foo2
463
gdbtk_test c_variable-3.6 {create foo2} {
464
  create_variable foo2
465
} {0}
466
 
467
# Test: c_variable-3.7
468
# Desc: check that outer foo in scope and inner foo out of scope
469
# Note: also a known gdb problem
470
gdbtk_test *c_variable-3.7 {check that outer foo in scope and inner foo out of scope (known gdb problem)} {
471
  check_update
472
} {{} {foo2 foo cb} inner_foo}
473
 
474
delete_variable inner_foo
475
 
476
# step to "foo = 0;"
477
gdb_cmd "step"
478
 
479
# Test: c_variable-3.8
480
# Desc: check that foo2 out of scope
481
gdbtk_test *c_variable-3.8 {check that foo2 out of scope (known gdb problem} {
482
  check_update
483
} {{} {foo cb} foo2}
484
 
485
# step to "cb = 21;"
486
gdb_cmd "step"
487
 
488
# Test: c_variable-3.9
489
# Desc: check that only cb is in scope
490
gdbtk_test *c_variable-3.9 {check that only cb is in scope (known gdb problem)} {
491
  check_update
492
} {{} cb {foo2 foo}}
493
 
494
# Test: c_variable-3.10
495
# Desc: names of editable variables
496
gdbtk_test c_variable-3.10 {names of editable variables} {
497
  editable_variables
498
} {{foo cb foo2} {}}
499
 
500
# Done with block tests
501
delete_all_variables
502
 
503
#####        #####
504
#                #
505
# children tests #
506
#                #
507
#####        #####
508
 
509
gdb_cmd "break do_children_tests"
510
gdb_cmd "continue"
511
 
512
# Test: c_variable-4.1
513
# Desc: stopped in do_children_tests
514
gdbtk_test c_variable-4.1 {stopped in do_children_tests} {
515
  lindex [gdb_loc] 1
516
} {do_children_tests}
517
 
518
# Test: c_variable-4.2
519
# Desc: create variable "struct_declarations"
520
gdbtk_test c_variable-4.2 {create variable "struct_declarations"} {
521
  create_variable struct_declarations
522
} {0}
523
 
524
# Test: c_variable-4.3
525
# Desc: children of struct_declarations
526
gdbtk_test c_variable-4.3 {children of struct_declarations} {
527
  get_children  struct_declarations
528
} {integer character char_ptr long_int int_ptr_ptr long_array func_ptr func_ptr_struct func_ptr_ptr u1 s2}
529
 
530
# Test: c_variable-4.4
531
# Desc: number of children of struct_declarations
532
gdbtk_test c_variable-4.4 {number of children of struct_declarations} {
533
  $var(struct_declarations) numChildren
534
} {11}
535
 
536
# Test: c_variable-4.5
537
# Desc: children of struct_declarations.integer
538
gdbtk_test c_variable-4.5 {children of struct_declarations.integer} {
539
  get_children struct_declarations.integer
540
} {}
541
 
542
# Test: c_variable-4.6
543
# Desc: number of children of struct_declarations.integer
544
gdbtk_test c_variable-4.6 {number of children of struct_declarations.integer} {
545
  $var(struct_declarations.integer) numChildren
546
} {0}
547
 
548
# Test: c_variable-4.7
549
# Desc: children of struct_declarations.character
550
gdbtk_test c_variable-4.7 {children of struct_declarations.character} {
551
  get_children struct_declarations.character
552
} {}
553
 
554
# Test: c_variable-4.8
555
# Desc: number of children of struct_declarations.character
556
gdbtk_test c_variable-4.8 {number of children of struct_declarations.character} {
557
  $var(struct_declarations.character) numChildren
558
} {0}
559
 
560
# Test: c_variable-4.9
561
# Desc: children of struct_declarations.char_ptr
562
gdbtk_test c_variable-4.9 {children of struct_declarations.char_ptr} {
563
  get_children struct_declarations.char_ptr
564
} {}
565
 
566
# Test: c_variable-4.10
567
# Desc: number of children of struct_declarations.char_ptr
568
gdbtk_test c_variable-4.10 {number of children of struct_declarations.char_ptr} {
569
  $var(struct_declarations.char_ptr) numChildren
570
} {0}
571
 
572
# Test: c_variable-4.11
573
# Desc: children of struct_declarations.long_int
574
gdbtk_test c_variable-4.11 {children of struct_declarations.long_int} {
575
 
576
  get_children struct_declarations.long_int
577
} {}
578
 
579
# Test: c_variable-4.12
580
# Desc: number of children of struct_declarations.long_int
581
gdbtk_test c_variable-4.12 {number of children of struct_declarations.long_int} {
582
  $var(struct_declarations.long_int) numChildren
583
} {0}
584
 
585
# Test: c_variable-4.13
586
# Desc: children of int_ptr_ptr
587
gdbtk_test c_variable-4.13 {children of int_ptr_ptr} {
588
  get_children struct_declarations.int_ptr_ptr
589
} {*int_ptr_ptr}
590
 
591
# Test: c_variable-4.14
592
# Desc: number of children of int_ptr_ptr
593
gdbtk_test c_variable-4.14 {number of children of int_ptr_ptr} {
594
  $var(struct_declarations.int_ptr_ptr) numChildren
595
} {1}
596
 
597
# Test: c_variable-4.15
598
# Desc: children of struct_declarations.long_array
599
gdbtk_test c_variable-4.15 {children of struct_declarations.long_array} {
600
  get_children struct_declarations.long_array
601
} {0 1 2 3 4 5 6 7 8 9}
602
 
603
# Test: c_variable-4.16
604
# Desc: number of children of struct_declarations.long_array
605
gdbtk_test c_variable-4.16 {number of children of struct_declarations.long_array} {
606
  $var(struct_declarations.long_array) numChildren
607
} {10}
608
 
609
# Test: c_variable-4.17
610
# Desc: children of struct_declarations.func_ptr
611
gdbtk_test c_variable-4.17 {children of struct_declarations.func_ptr} {
612
  get_children struct_declarations.func_ptr
613
} {}
614
 
615
# Test: c_variable-4.18
616
# Desc: number of children of struct_declarations.func_ptr
617
gdbtk_test c_variable-4.18 {number of children of struct_declarations.func_ptr} {
618
  $var(struct_declarations.func_ptr) numChildren
619
} {0}
620
 
621
# Test: c_variable-4.19
622
# Desc: children of struct_declarations.func_ptr_struct
623
gdbtk_test c_variable-4.19 {children of struct_declarations.func_ptr_struct} {
624
  get_children struct_declarations.func_ptr_struct
625
} {}
626
 
627
# Test: c_variable-4.20
628
# Desc: number of children of struct_declarations.func_ptr_struct
629
gdbtk_test c_variable-4.20 {number of children of struct_declarations.func_ptr_struct} {
630
  $var(struct_declarations.func_ptr_struct) numChildren
631
} {0}
632
 
633
# Test: c_variable-4.21
634
# Desc: children of struct_declarations.func_ptr_ptr
635
gdbtk_test c_variable-4.21 {children of struct_declarations.func_ptr_ptr} {
636
  get_children struct_declarations.func_ptr_ptr
637
} {}
638
 
639
# Test: c_variable-4.22
640
# Desc: number of children of struct_declarations.func_ptr_ptr
641
gdbtk_test c_variable-4.22 {number of children of struct_declarations.func_ptr_ptr} {
642
  $var(struct_declarations.func_ptr_ptr) numChildren
643
} {0}
644
 
645
# Test: c_variable-4.23
646
# Desc: children of struct_declarations.u1
647
gdbtk_test c_variable-4.23 {children of struct_declarations.u1} {
648
  get_children struct_declarations.u1
649
} {a b c d}
650
 
651
# Test: c_variable-4.24
652
# Desc: number of children of struct_declarations.u1
653
gdbtk_test c_variable-4.24 {number of children of struct_declarations.u1} {
654
  $var(struct_declarations.u1) numChildren
655
} {4}
656
 
657
# Test: c_variable-4.25
658
# Desc: children of struct_declarations.s2
659
gdbtk_test c_variable-4.25 {children of struct_declarations.s2} {
660
  get_children struct_declarations.s2
661
} {u2 g h i}
662
 
663
# Test: c_variable-4.26
664
# Desc: number of children of struct_declarations.s2
665
gdbtk_test c_variable-4.26 {number of children of struct_declarations.s2} {
666
  $var(struct_declarations.s2) numChildren
667
} {4}
668
 
669
# Test: c_variable-4.27
670
# Desc: children of struct_declarations.long_array.1
671
gdbtk_test c_variable-4.27 {children of struct_declarations.long_array.1} {
672
  get_children struct_declarations.long_array.1
673
} {}
674
 
675
# Test: c_variable-4.28
676
# Desc: number of children of struct_declarations.long_array.1
677
gdbtk_test c_variable-4.28 {number of children of struct_declarations.long_array.1} {
678
  $var(struct_declarations.long_array.1) numChildren
679
} {0}
680
 
681
# Test: c_variable-4.29
682
# Desc: children of struct_declarations.long_array.2
683
gdbtk_test c_variable-4.29 {children of struct_declarations.long_array.2} {
684
  get_children struct_declarations.long_array.2
685
} {}
686
 
687
# Test: c_variable-4.30
688
# Desc: number of children of struct_declarations.long_array.2
689
gdbtk_test c_variable-4.30 {number of children of struct_declarations.long_array.2} {
690
  $var(struct_declarations.long_array.2) numChildren
691
} {0}
692
 
693
# Test: c_variable-4.31
694
# Desc: children of struct_declarations.long_array.3
695
gdbtk_test c_variable-4.31 {children of struct_declarations.long_array.3} {
696
  get_children struct_declarations.long_array.3
697
} {}
698
 
699
# Test: c_variable-4.32
700
# Desc: number of children of struct_declarations.long_array.3
701
gdbtk_test c_variable-4.32 {number of children of struct_declarations.long_array.3} {
702
  $var(struct_declarations.long_array.3) numChildren
703
} {0}
704
 
705
# Test: c_variable-4.33
706
# Desc: children of struct_declarations.long_array.4
707
gdbtk_test c_variable-4.33 {children of struct_declarations.long_array.4} {
708
  get_children struct_declarations.long_array.4
709
} {}
710
 
711
# Test: c_variable-4.34
712
# Desc: number of children of struct_declarations.long_array.4
713
gdbtk_test c_variable-4.34 {number of children of struct_declarations.long_array.4} {
714
  $var(struct_declarations.long_array.4) numChildren
715
} {0}
716
 
717
# Test: c_variable-4.35
718
# Desc: children of struct_declarations.long_array.5
719
gdbtk_test c_variable-4.35 {children of struct_declarations.long_array.5} {
720
  get_children struct_declarations.long_array.5
721
} {}
722
 
723
# Test: c_variable-4.36
724
# Desc: number of children of struct_declarations.long_array.5
725
gdbtk_test c_variable-4.36 {number of children of struct_declarations.long_array.5} {
726
  $var(struct_declarations.long_array.5) numChildren
727
} {0}
728
 
729
# Test: c_variable-4.37
730
# Desc: children of struct_declarations.long_array.6
731
gdbtk_test c_variable-4.37 {children of struct_declarations.long_array.6} {
732
  get_children struct_declarations.long_array.6
733
} {}
734
 
735
# Test: c_variable-4.38
736
# Desc: number of children of struct_declarations.long_array.6
737
gdbtk_test c_variable-4.38 {number of children of struct_declarations.long_array.6} {
738
  $var(struct_declarations.long_array.6) numChildren
739
} {0}
740
 
741
# Test: c_variable-4.39
742
# Desc: children of struct_declarations.long_array.7
743
gdbtk_test c_variable-4.39 {children of struct_declarations.long_array.7} {
744
  get_children struct_declarations.long_array.7
745
} {}
746
 
747
# Test: c_variable-4.40
748
# Desc: number of children of struct_declarations.long_array.7
749
gdbtk_test c_variable-4.40 {number of children of struct_declarations.long_array.7} {
750
  $var(struct_declarations.long_array.7) numChildren
751
} {0}
752
 
753
# Test: c_variable-4.41
754
# Desc: children of struct_declarations.long_array.8
755
gdbtk_test c_variable-4.41 {children of struct_declarations.long_array.8} {
756
  get_children struct_declarations.long_array.8
757
} {}
758
 
759
# Test: c_variable-4.42
760
# Desc: number of children of struct_declarations.long_array.8
761
gdbtk_test c_variable-4.42 {number of children of struct_declarations.long_array.8} {
762
  $var(struct_declarations.long_array.8) numChildren
763
} {0}
764
 
765
# Test: c_variable-4.43
766
# Desc: children of struct_declarations.long_array.9
767
gdbtk_test c_variable-4.43 {children of struct_declarations.long_array.9} {
768
  get_children struct_declarations.long_array.9
769
} {}
770
 
771
# Test: c_variable-4.44
772
# Desc: number of children of struct_declarations.long_array.9
773
gdbtk_test c_variable-4.44 {number of children of struct_declarations.long_array.9} {
774
  $var(struct_declarations.long_array.9) numChildren
775
} {0}
776
 
777
# Test: c_variable-4.45
778
# Desc: children of struct_declarations.u1.a
779
gdbtk_test c_variable-4.45 {children of struct_declarations.u1.a} {
780
  get_children struct_declarations.u1.a
781
} {}
782
 
783
# Test: c_variable-4.46
784
# Desc: number of children of struct_declarations.u1.a
785
gdbtk_test c_variable-4.46 {number of children of struct_declarations.u1.a} {
786
  $var(struct_declarations.u1.a) numChildren
787
} {0}
788
 
789
# Test: c_variable-4.47
790
# Desc: children of struct_declarations.u1.b
791
gdbtk_test c_variable-4.47 {children of struct_declarations.u1.b} {
792
  get_children struct_declarations.u1.b
793
} {}
794
 
795
# Test: c_variable-4.48
796
# Desc: number of children of struct_declarations.u1.b
797
gdbtk_test c_variable-4.48 {number of children of struct_declarations.u1.b} {
798
  $var(struct_declarations.u1.b) numChildren
799
} {0}
800
 
801
# Test: c_variable-4.49
802
# Desc: children of struct_declarations.u1.c
803
gdbtk_test c_variable-4.49 {children of struct_declarations.u1.c} {
804
  get_children struct_declarations.u1.c
805
} {}
806
 
807
# Test: c_variable-4.50
808
# Desc: number of children of struct_declarations.u1.c
809
gdbtk_test c_variable-4.50 {number of children of struct_declarations.u1.c} {
810
  $var(struct_declarations.u1.c) numChildren
811
} {0}
812
 
813
# Test: c_variable-4.51
814
# Desc: children of struct_declarations.u1.d
815
gdbtk_test c_variable-4.51 {children of struct_declarations.u1.d} {
816
  get_children struct_declarations.u1.d
817
} {}
818
 
819
# Test: c_variable-4.52
820
# Desc: number of children of struct_declarations.u1.d
821
gdbtk_test c_variable-4.52 {number of children of struct_declarations.u1.d} {
822
  $var(struct_declarations.u1.d) numChildren
823
} {0}
824
 
825
# Test: c_variable-4.53
826
# Desc: children of struct_declarations.s2.u2
827
gdbtk_test c_variable-4.53 {children of struct_declarations.s2.u2} {
828
  get_children struct_declarations.s2.u2
829
} {u1s1 f u1s2}
830
 
831
# Test: c_variable-4.54
832
# Desc: number of children of struct_declarations.s2.u2
833
gdbtk_test c_variable-4.54 {number of children of struct_declarations.s2.u2} {
834
  $var(struct_declarations.s2.u2) numChildren
835
} {3}
836
 
837
# Test: c_variable-4.55
838
# Desc: children of struct_declarations.s2.g
839
gdbtk_test c_variable-4.55 {children of struct_declarations.s2.g} {
840
  get_children struct_declarations.s2.g
841
} {}
842
 
843
# Test: c_variable-4.56
844
# Desc: number of children of struct_declarations.s2.g
845
gdbtk_test c_variable-4.56 {number of children of struct_declarations.s2.g} {
846
  $var(struct_declarations.s2.g) numChildren
847
} {0}
848
 
849
# Test: c_variable-4.57
850
# Desc: children of struct_declarations.s2.h
851
gdbtk_test c_variable-4.57 {children of struct_declarations.s2.h} {
852
  get_children struct_declarations.s2.h
853
} {}
854
 
855
# Test: c_variable-4.58
856
# Desc: number of children of struct_declarations.s2.h
857
gdbtk_test c_variable-4.58 {number of children of struct_declarations.s2.h} {
858
  $var(struct_declarations.s2.h) numChildren
859
} {0}
860
 
861
# Test: c_variable-4.59
862
# Desc: children of struct_declarations.s2.i
863
gdbtk_test c_variable-4.59 {children of struct_declarations.s2.i} {
864
  get_children struct_declarations.s2.i
865
} {0 1 2 3 4 5 6 7 8 9}
866
 
867
# Test: c_variable-4.60
868
# Desc: number of children of struct_declarations.s2.i
869
gdbtk_test c_variable-4.60 {number of children of struct_declarations.s2.i} {
870
  $var(struct_declarations.s2.i) numChildren
871
} {10}
872
 
873
# Test: c_variable-4.61
874
# Desc: children of struct_declarations.s2.u2.u1s1
875
gdbtk_test c_variable-4.61 {children of struct_declarations.s2.u2.u1s1} {
876
  get_children struct_declarations.s2.u2.u1s1
877
} {d e func foo}
878
 
879
# Test: c_variable-4.62
880
# Desc: number of children of struct_declarations.s2.u2.u1s1
881
gdbtk_test c_variable-4.62 {number of children of struct_declarations.s2.u2.u1s1} {
882
  $var(struct_declarations.s2.u2.u1s1) numChildren
883
} {4}
884
 
885
# Test: c_variable-4.63
886
# Desc: children of struct_declarations.s2.u2.f
887
gdbtk_test c_variable-4.63 {children of struct_declarations.s2.u2.f} {
888
  get_children struct_declarations.s2.u2.f
889
} {}
890
 
891
# Test: c_variable-4.64
892
# Desc: number of children of struct_declarations.s2.u2.f
893
gdbtk_test c_variable-4.64 {number of children of struct_declarations.s2.u2.f} {
894
  $var(struct_declarations.s2.u2.f) numChildren
895
} {0}
896
 
897
# Test: c_variable-4.65
898
# Desc: children of struct_declarations.s2.u2.u1s2
899
gdbtk_test c_variable-4.65 {children of struct_declarations.s2.u2.u1s2} {
900
  get_children struct_declarations.s2.u2.u1s2
901
} {array_ptr func}
902
 
903
# Test: c_variable-4.66
904
# Desc: number of children of struct_declarations.s2.u2.u1s2
905
gdbtk_test c_variable-4.66 {number of children of struct_declarations.s2.u2.u1s2} {
906
  $var(struct_declarations.s2.u2.u1s2) numChildren
907
} {2}
908
 
909
# Test: c_variable-4.67
910
# Desc: children of struct_declarations.s2.u2.u1s1.d
911
gdbtk_test c_variable-4.67 {children of struct_declarations.s2.u2.u1s1.d} {
912
  get_children struct_declarations.s2.u2.u1s1.d
913
} {}
914
 
915
# Test: c_variable-4.68
916
# Desc: number of children of struct_declarations.s2.u2.u1s1.d
917
gdbtk_test c_variable-4.68 {number of children of struct_declarations.s2.u2.u1s1.d} {
918
  $var(struct_declarations.s2.u2.u1s1.d) numChildren
919
} {0}
920
 
921
# Test: c_variable-4.69
922
# Desc: children of struct_declarations.s2.u2.u1s1.e
923
gdbtk_test c_variable-4.69 {children of struct_declarations.s2.u2.u1s1.e} {
924
  get_children struct_declarations.s2.u2.u1s1.e
925
} {0 1 2 3 4 5 6 7 8 9}
926
 
927
# Test: c_variable-4.70
928
# Desc: number of children of struct_declarations.s2.u2.u1s1.e
929
gdbtk_test c_variable-4.70 {number of children of struct_declarations.s2.u2.u1s1.e} {
930
  $var(struct_declarations.s2.u2.u1s1.e) numChildren
931
} {10}
932
 
933
# Test: c_variable-4.71
934
# Desc: children of struct_declarations.s2.u2.u1s1.func
935
gdbtk_test c_variable-4.71 {children of struct_declarations.s2.u2.u1s1.func} {
936
  get_children struct_declarations.s2.u2.u1s1.func
937
} {}
938
 
939
# Test: c_variable-4.72
940
# Desc: number of children of struct_declarations.s2.u2.u1s1.func
941
gdbtk_test c_variable-4.72 {number of children of struct_declarations.s2.u2.u1s1.func} {
942
  $var(struct_declarations.s2.u2.u1s1.func) numChildren
943
} {0}
944
 
945
# Test: c_variable-4.73
946
# Desc: children of struct_declarations.s2.u2.u1s1.foo
947
gdbtk_test c_variable-4.73 {children of struct_declarations.s2.u2.u1s1.foo} {
948
  get_children struct_declarations.s2.u2.u1s1.foo
949
} {}
950
 
951
# Test: c_variable-4.74
952
# Desc: number of children of struct_declarations.s2.u2.u1s1.foo
953
gdbtk_test c_variable-4.74 {number of children of struct_declarations.s2.u2.u1s1.foo} {
954
  $var(struct_declarations.s2.u2.u1s1.foo) numChildren
955
} {0}
956
 
957
# Test: c_variable-4.75
958
# Desc: children of struct_declarations.s2.u2.u1s2.array_ptr
959
gdbtk_test c_variable-4.75 {children of struct_declarations.s2.u2.u1s2.array_ptr} {
960
  get_children struct_declarations.s2.u2.u1s2.array_ptr
961
} {0 1}
962
 
963
# Test: c_variable-4.76
964
# Desc: number of children of struct_declarations.s2.u2.u1s2.array_ptr
965
gdbtk_test c_variable-4.76 {number of children of struct_declarations.s2.u2.u1s2.array_ptr} {
966
  $var(struct_declarations.s2.u2.u1s2.array_ptr) numChildren
967
} {2}
968
 
969
# Test: c_variable-4.77
970
# Desc: children of struct_declarations.s2.u2.u1s2.func
971
gdbtk_test c_variable-4.77 {children of struct_declarations.s2.u2.u1s2.func} {
972
  get_children struct_declarations.s2.u2.u1s2.func
973
} {}
974
 
975
# Test: c_variable-4.78
976
# Desc: number of children of struct_declarations.s2.u2.u1s2.func
977
gdbtk_test c_variable-4.78 {number of children of struct_declarations.s2.u2.u1s2.func} {
978
  $var(struct_declarations.s2.u2.u1s2.func) numChildren
979
} {0}
980
 
981
# Test: c_variable-4.79
982
# Desc: children of struct_declarations.*int_ptr_ptr
983
gdbtk_test c_variable-4.79 {children of struct_declarations.*int_ptr_ptr} {
984
  get_children struct_declarations.int_ptr_ptr.*int_ptr_ptr
985
} {**int_ptr_ptr}
986
 
987
# Test: c_variable-4.80
988
# Desc: Number of children of struct_declarations.*int_ptr_ptr
989
gdbtk_test c_variable-4.80 {Number of children of struct_declarations.*int_ptr_ptr} {
990
  $var(struct_declarations.int_ptr_ptr.*int_ptr_ptr) numChildren
991
} {1}
992
 
993
# Step to "struct_declarations.integer = 123;"
994
gdb_cmd "step"
995
 
996
# Test: c_variable-4.81
997
# Desc: create local variable "weird"
998
gdbtk_test c_variable-4.81 {create local variable "weird"} {
999
  create_variable weird
1000
} {0}
1001
 
1002
# Test: c_variable-4.82
1003
# Desc: children of weird
1004
gdbtk_test c_variable-4.82 {children of weird} {
1005
  get_children weird
1006
} {integer character char_ptr long_int int_ptr_ptr long_array func_ptr func_ptr_struct func_ptr_ptr u1 s2}
1007
 
1008
# Test: c_variable-4.83
1009
# Desc: number of children of weird
1010
gdbtk_test c_variable-4.83 {number of children of weird} {
1011
  $var(weird) numChildren
1012
} {11}
1013
 
1014
# Test: c_variable-4.84
1015
# Desc: children of weird->long_array
1016
gdbtk_test c_variable-4.84 {children of weird->long_array} {
1017
  get_children weird.long_array
1018
} {0 1 2 3 4 5 6 7 8 9}
1019
 
1020
# Test: c_variable-4.85
1021
# Desc: number of children of weird->long_array
1022
gdbtk_test c_variable-4.85 {number of children of weird->long_array} {
1023
  $var(weird.long_array) numChildren
1024
} {10}
1025
 
1026
# Test: c_variable-4.86
1027
# Desc: children of weird->int_ptr_ptr
1028
gdbtk_test c_variable-4.86 {children of weird->int_ptr_ptr} {
1029
  get_children weird.int_ptr_ptr
1030
} {*int_ptr_ptr}
1031
 
1032
# Test: c_variable-4.87
1033
# Desc: number of children of weird->int_ptr_ptr
1034
gdbtk_test c_variable-4.87 {number of children of weird->int_ptr_ptr} {
1035
  $var(weird.int_ptr_ptr) numChildren
1036
} {1}
1037
 
1038
# Test: c_variable-4.88
1039
# Desc: children of *weird->int_ptr_ptr
1040
gdbtk_test c_variable-4.88 {children of *weird->int_ptr_ptr} {
1041
  get_children weird.int_ptr_ptr.*int_ptr_ptr
1042
} {**int_ptr_ptr}
1043
 
1044
# Test: c_variable-4.89
1045
# Desc: number of children *weird->int_ptr_ptr
1046
gdbtk_test c_variable-4.89 {number of children *weird->int_ptr_ptr} {
1047
  $var(weird.int_ptr_ptr.*int_ptr_ptr) numChildren
1048
} {1}
1049
 
1050
# Test: c_variable-4.90
1051
# Desc: create weird->int_ptr_ptr
1052
gdbtk_test c_variable-4.90 {create weird->int_ptr_ptr} {
1053
  create_variable weird->int_ptr_ptr
1054
} {0}
1055
 
1056
# Test: c_variable-4.91
1057
# Desc: children of weird->int_ptr_ptr
1058
gdbtk_test c_variable-4.91 {children of weird->int_ptr_ptr} {
1059
  get_children weird->int_ptr_ptr
1060
} {*weird->int_ptr_ptr}
1061
 
1062
# Test: c_variable-4.92
1063
# Desc: number of children of (weird->int_ptr_ptr)
1064
gdbtk_test c_variable-4.92 {number of children of (weird->int_ptr_ptr)} {
1065
  $var(weird->int_ptr_ptr) numChildren
1066
} {1}
1067
 
1068
# Test: c_variable-4.93
1069
# Desc: children of *(weird->int_ptr_ptr)
1070
gdbtk_test c_variable-4.93 {children of *(weird->int_ptr_ptr)} {
1071
  get_children weird->int_ptr_ptr.*weird->int_ptr_ptr
1072
} {**weird->int_ptr_ptr}
1073
 
1074
# Test: c_variable-4.94
1075
# Desc: number of children of *(weird->int_ptr_ptr)
1076
gdbtk_test c_variable-4.94 {number of children of *(weird->int_ptr_ptr)} {
1077
  $var(weird->int_ptr_ptr.*weird->int_ptr_ptr) numChildren
1078
} {1}
1079
 
1080
# Test: c_variable-4.95
1081
# Desc: children of *(*(weird->int_ptr_ptr))
1082
gdbtk_test c_variable-4.95 {children of *(*(weird->int_ptr_ptr))} {
1083
  get_children weird->int_ptr_ptr.*weird->int_ptr_ptr.**weird->int_ptr_ptr
1084
} {}
1085
 
1086
# Test: c_variable-4.96
1087
# Desc: number of children of *(*(weird->int_ptr_ptr))
1088
gdbtk_test c_variable-4.96 {number of children of **weird->int_ptr_ptr} {
1089
  $var(weird->int_ptr_ptr.*weird->int_ptr_ptr.**weird->int_ptr_ptr) numChildren
1090
} {0}
1091
 
1092
# Test: c_variable-4.97
1093
# Desc: is weird editable
1094
gdbtk_test c_variable-4.97 {is weird editable} {
1095
  $var(weird) editable
1096
} {1}
1097
 
1098
# Test: c_variable-4.98
1099
# Desc: is weird->int_ptr_ptr editable
1100
gdbtk_test c_variable-4.98 {is weird->int_ptr_ptr editable} {
1101
  $var(weird.int_ptr_ptr) editable
1102
} {1}
1103
 
1104
# Test: c_variable-4.99
1105
# Desc: is *(weird->int_ptr_ptr) editable
1106
gdbtk_test c_variable-4.99 {is *(weird->int_ptr_ptr) editable} {
1107
  $var(weird.int_ptr_ptr.*int_ptr_ptr) editable
1108
} {1}
1109
 
1110
# Test: c_variable-4.100
1111
# Desc: is *(*(weird->int_ptr_ptr)) editable
1112
gdbtk_test c_variable-4.100 {is *(*(weird->int_ptr_ptr)) editable} {
1113
  $var(weird.int_ptr_ptr.*int_ptr_ptr.**int_ptr_ptr) editable
1114
} {1}
1115
 
1116
# Test: c_variable-4.101
1117
# Desc: is weird->u1 editable
1118
gdbtk_test c_variable-4.101 {is weird->u1 editable} {
1119
  $var(weird.u1) editable
1120
} {0}
1121
 
1122
# Test: c_variable-4.102
1123
# Desc: is weird->s2 editable
1124
gdbtk_test c_variable-4.102 {is weird->s2 editable} {
1125
  $var(weird.s2) editable
1126
} {0}
1127
 
1128
# Test: c_variable-4.103
1129
# Desc: is struct_declarations.u1.a editable
1130
gdbtk_test c_variable-4.103 {is struct_declarations.u1.a editable} {
1131
  $var(struct_declarations.u1.a) editable
1132
} {1}
1133
 
1134
# Test: c_variable-4.104
1135
# Desc: is struct_declarations.u1.b editable
1136
gdbtk_test c_variable-4.104 {is struct_declarations.u1.b editable} {
1137
  $var(struct_declarations.u1.b) editable
1138
} {1}
1139
 
1140
# Test: c_variable-4.105
1141
# Desc: is struct_declarations.u1.c editable
1142
gdbtk_test c_variable-4.105 {is struct_declarations.u1.c editable} {
1143
  $var(struct_declarations.u1.c) editable
1144
} {1}
1145
 
1146
# Test: c_variable-4.106
1147
# Desc: is struct_declarations.long_array editable
1148
gdbtk_test c_variable-4.106 {is struct_declarations.long_array editable} {
1149
  $var(struct_declarations.long_array) editable
1150
} {0}
1151
 
1152
# Test: c_variable-4.107
1153
# Desc: is struct_declarations.long_array[0] editable
1154
gdbtk_test c_variable-4.107 {is struct_declarations.long_array[0] editable} {
1155
  $var(struct_declarations.long_array.0) editable
1156
} {1}
1157
 
1158
# Test: c_variable-4.108
1159
# Desc: is struct_declarations editable
1160
gdbtk_test c_variable-4.108 {is struct_declarations editable} {
1161
  $var(struct_declarations) editable
1162
} {0}
1163
 
1164
delete_variable weird
1165
 
1166
#####                         #####
1167
#                                 #
1168
# children and update tests #
1169
#                                 #
1170
#####                         #####
1171
 
1172
# Test: c_variable-5.1
1173
# Desc: check that nothing changed
1174
gdbtk_test c_variable-5.1 {check that nothing changed} {
1175
  check_update
1176
} {{} {struct_declarations.s2.i.3 struct_declarations.func_ptr_ptr struct_declarations.s2.i.4 struct_declarations.s2.i.5 struct_declarations.s2.i.6 struct_declarations.func_ptr struct_declarations.s2.i.7 struct_declarations.s2.i.8 struct_declarations.s2.i.9 struct_declarations.s2.u2.u1s1.d struct_declarations.func_ptr_struct struct_declarations.s2.u2.u1s1.e struct_declarations.u1 struct_declarations.long_int struct_declarations.s2.u2.u1s2.func struct_declarations.integer struct_declarations.s2.u2 struct_declarations.s2.u2.u1s1.e.0 struct_declarations.s2.u2.u1s1.e.1 struct_declarations.long_array.0 struct_declarations.s2.u2.u1s1.e.2 struct_declarations.long_array.1 struct_declarations.u1.a struct_declarations.s2.u2.u1s1.e.3 struct_declarations.long_array.2 struct_declarations.u1.b struct_declarations.s2.u2.u1s1.e.4 struct_declarations.long_array.3 struct_declarations.u1.c struct_declarations.s2.u2.u1s1.e.5 struct_declarations.long_array.4 struct_declarations.u1.d struct_declarations.int_ptr_ptr.*int_ptr_ptr.**int_ptr_ptr struct_declarations.s2.u2.u1s1.e.6 struct_declarations.long_array.5 struct_declarations.s2.u2.u1s1.e.7 struct_declarations.long_array.6 struct_declarations.s2.u2.u1s1.e.8 struct_declarations.long_array.7 struct_declarations.s2.u2.u1s1.e.9 struct_declarations.long_array.8 struct_declarations.character struct_declarations.long_array.9 struct_declarations.int_ptr_ptr.*int_ptr_ptr struct_declarations.s2.u2.u1s1.func struct_declarations.s2.u2.u1s2.array_ptr struct_declarations.s2.u2.f struct_declarations.s2.u2.u1s1.foo struct_declarations struct_declarations.s2.u2.u1s1 struct_declarations.s2.u2.u1s2.array_ptr.0 struct_declarations.char_ptr struct_declarations.s2.u2.u1s2 struct_declarations.s2.u2.u1s2.array_ptr.1 struct_declarations.int_ptr_ptr struct_declarations.s2 struct_declarations.long_array struct_declarations.s2.g struct_declarations.s2.i.0 struct_declarations.s2.h struct_declarations.s2.i.1 struct_declarations.s2.i struct_declarations.s2.i.2} {}}
1177
 
1178
# Step over "struct_declarations.integer = 123;"
1179
gdb_cmd "step"
1180
 
1181
# Test: c_variable-5.2
1182
# Desc: check that integer changed
1183
gdbtk_test c_variable-5.2 {check that integer changed} {
1184
  check_update
1185
} {struct_declarations.integer {struct_declarations.s2.i.3 struct_declarations.func_ptr_ptr struct_declarations.s2.i.4 struct_declarations.s2.i.5 struct_declarations.s2.i.6 struct_declarations.func_ptr struct_declarations.s2.i.7 struct_declarations.s2.i.8 struct_declarations.s2.i.9 struct_declarations.s2.u2.u1s1.d struct_declarations.func_ptr_struct struct_declarations.s2.u2.u1s1.e struct_declarations.u1 struct_declarations.long_int struct_declarations.s2.u2.u1s2.func struct_declarations.s2.u2 struct_declarations.s2.u2.u1s1.e.0 struct_declarations.s2.u2.u1s1.e.1 struct_declarations.long_array.0 struct_declarations.s2.u2.u1s1.e.2 struct_declarations.long_array.1 struct_declarations.u1.a struct_declarations.s2.u2.u1s1.e.3 struct_declarations.long_array.2 struct_declarations.u1.b struct_declarations.s2.u2.u1s1.e.4 struct_declarations.long_array.3 struct_declarations.u1.c struct_declarations.s2.u2.u1s1.e.5 struct_declarations.long_array.4 struct_declarations.u1.d struct_declarations.int_ptr_ptr.*int_ptr_ptr.**int_ptr_ptr struct_declarations.s2.u2.u1s1.e.6 struct_declarations.long_array.5 struct_declarations.s2.u2.u1s1.e.7 struct_declarations.long_array.6 struct_declarations.s2.u2.u1s1.e.8 struct_declarations.long_array.7 struct_declarations.s2.u2.u1s1.e.9 struct_declarations.long_array.8 struct_declarations.character struct_declarations.long_array.9 struct_declarations.int_ptr_ptr.*int_ptr_ptr struct_declarations.s2.u2.u1s1.func struct_declarations.s2.u2.u1s2.array_ptr struct_declarations.s2.u2.f struct_declarations.s2.u2.u1s1.foo struct_declarations struct_declarations.s2.u2.u1s1 struct_declarations.s2.u2.u1s2.array_ptr.0 struct_declarations.char_ptr struct_declarations.s2.u2.u1s2 struct_declarations.s2.u2.u1s2.array_ptr.1 struct_declarations.int_ptr_ptr struct_declarations.s2 struct_declarations.long_array struct_declarations.s2.g struct_declarations.s2.i.0 struct_declarations.s2.h struct_declarations.s2.i.1 struct_declarations.s2.i struct_declarations.s2.i.2} {}}
1186
 
1187
# Step over:
1188
#    weird->char_ptr = "hello";
1189
#    bar = 2121;
1190
#    foo = &bar;
1191
for {set i 0} {$i < 3} {incr i} {
1192
  gdb_cmd "step"
1193
}
1194
 
1195
# Test: c_variable-5.3
1196
# Desc: check that char_ptr changed
1197
gdbtk_test c_variable-5.3 {check that char_ptr changed} {
1198
  check_update
1199
} {struct_declarations.char_ptr {struct_declarations.s2.i.3 struct_declarations.func_ptr_ptr struct_declarations.s2.i.4 struct_declarations.s2.i.5 struct_declarations.s2.i.6 struct_declarations.func_ptr struct_declarations.s2.i.7 struct_declarations.s2.i.8 struct_declarations.s2.i.9 struct_declarations.s2.u2.u1s1.d struct_declarations.func_ptr_struct struct_declarations.s2.u2.u1s1.e struct_declarations.u1 struct_declarations.long_int struct_declarations.s2.u2.u1s2.func struct_declarations.integer struct_declarations.s2.u2 struct_declarations.s2.u2.u1s1.e.0 struct_declarations.s2.u2.u1s1.e.1 struct_declarations.long_array.0 struct_declarations.s2.u2.u1s1.e.2 struct_declarations.long_array.1 struct_declarations.u1.a struct_declarations.s2.u2.u1s1.e.3 struct_declarations.long_array.2 struct_declarations.u1.b struct_declarations.s2.u2.u1s1.e.4 struct_declarations.long_array.3 struct_declarations.u1.c struct_declarations.s2.u2.u1s1.e.5 struct_declarations.long_array.4 struct_declarations.u1.d struct_declarations.int_ptr_ptr.*int_ptr_ptr.**int_ptr_ptr struct_declarations.s2.u2.u1s1.e.6 struct_declarations.long_array.5 struct_declarations.s2.u2.u1s1.e.7 struct_declarations.long_array.6 struct_declarations.s2.u2.u1s1.e.8 struct_declarations.long_array.7 struct_declarations.s2.u2.u1s1.e.9 struct_declarations.long_array.8 struct_declarations.character struct_declarations.long_array.9 struct_declarations.int_ptr_ptr.*int_ptr_ptr struct_declarations.s2.u2.u1s1.func struct_declarations.s2.u2.u1s2.array_ptr struct_declarations.s2.u2.f struct_declarations.s2.u2.u1s1.foo struct_declarations struct_declarations.s2.u2.u1s1 struct_declarations.s2.u2.u1s2.array_ptr.0 struct_declarations.s2.u2.u1s2 struct_declarations.s2.u2.u1s2.array_ptr.1 struct_declarations.int_ptr_ptr struct_declarations.s2 struct_declarations.long_array struct_declarations.s2.g struct_declarations.s2.i.0 struct_declarations.s2.h struct_declarations.s2.i.1 struct_declarations.s2.i struct_declarations.s2.i.2} {}}
1200
 
1201
# Step over "struct_declarations.int_ptr_ptr = &foo;"
1202
gdb_cmd "step"
1203
 
1204
# Test: c_variable-5.4
1205
# Desc: check that int_ptr_ptr and children changed
1206
gdbtk_test c_variable-5.4 {check that int_ptr_ptr and children changed} {
1207
  check_update
1208
} {{struct_declarations.int_ptr_ptr struct_declarations.int_ptr_ptr.*int_ptr_ptr struct_declarations.int_ptr_ptr.*int_ptr_ptr.**int_ptr_ptr} {struct_declarations.s2.i.3 struct_declarations.func_ptr_ptr struct_declarations.s2.i.4 struct_declarations.s2.i.5 struct_declarations.s2.i.6 struct_declarations.func_ptr struct_declarations.s2.i.7 struct_declarations.s2.i.8 struct_declarations.s2.i.9 struct_declarations.s2.u2.u1s1.d struct_declarations.func_ptr_struct struct_declarations.s2.u2.u1s1.e struct_declarations.u1 struct_declarations.long_int struct_declarations.s2.u2.u1s2.func struct_declarations.integer struct_declarations.s2.u2 struct_declarations.s2.u2.u1s1.e.0 struct_declarations.s2.u2.u1s1.e.1 struct_declarations.long_array.0 struct_declarations.s2.u2.u1s1.e.2 struct_declarations.long_array.1 struct_declarations.u1.a struct_declarations.s2.u2.u1s1.e.3 struct_declarations.long_array.2 struct_declarations.u1.b struct_declarations.s2.u2.u1s1.e.4 struct_declarations.long_array.3 struct_declarations.u1.c struct_declarations.s2.u2.u1s1.e.5 struct_declarations.long_array.4 struct_declarations.u1.d struct_declarations.s2.u2.u1s1.e.6 struct_declarations.long_array.5 struct_declarations.s2.u2.u1s1.e.7 struct_declarations.long_array.6 struct_declarations.s2.u2.u1s1.e.8 struct_declarations.long_array.7 struct_declarations.s2.u2.u1s1.e.9 struct_declarations.long_array.8 struct_declarations.character struct_declarations.long_array.9 struct_declarations.s2.u2.u1s1.func struct_declarations.s2.u2.u1s2.array_ptr struct_declarations.s2.u2.f struct_declarations.s2.u2.u1s1.foo struct_declarations struct_declarations.s2.u2.u1s1 struct_declarations.s2.u2.u1s2.array_ptr.0 struct_declarations.char_ptr struct_declarations.s2.u2.u1s2 struct_declarations.s2.u2.u1s2.array_ptr.1 struct_declarations.s2 struct_declarations.long_array struct_declarations.s2.g struct_declarations.s2.i.0 struct_declarations.s2.h struct_declarations.s2.i.1 struct_declarations.s2.i struct_declarations.s2.i.2} {}}
1209
 
1210
# Step over "weird->long_array[0] = 1234;"
1211
gdb_cmd "step"
1212
 
1213
# Test: c_variable-5.5
1214
# Desc: check that long_array[0] changed
1215
gdbtk_test c_variable-5.5 {check that long_array[0] changed} {
1216
  check_update
1217
} {struct_declarations.long_array.0 {struct_declarations.s2.i.3 struct_declarations.func_ptr_ptr struct_declarations.s2.i.4 struct_declarations.s2.i.5 struct_declarations.s2.i.6 struct_declarations.func_ptr struct_declarations.s2.i.7 struct_declarations.s2.i.8 struct_declarations.s2.i.9 struct_declarations.s2.u2.u1s1.d struct_declarations.func_ptr_struct struct_declarations.s2.u2.u1s1.e struct_declarations.u1 struct_declarations.long_int struct_declarations.s2.u2.u1s2.func struct_declarations.integer struct_declarations.s2.u2 struct_declarations.s2.u2.u1s1.e.0 struct_declarations.s2.u2.u1s1.e.1 struct_declarations.s2.u2.u1s1.e.2 struct_declarations.long_array.1 struct_declarations.u1.a struct_declarations.s2.u2.u1s1.e.3 struct_declarations.long_array.2 struct_declarations.u1.b struct_declarations.s2.u2.u1s1.e.4 struct_declarations.long_array.3 struct_declarations.u1.c struct_declarations.s2.u2.u1s1.e.5 struct_declarations.long_array.4 struct_declarations.u1.d struct_declarations.int_ptr_ptr.*int_ptr_ptr.**int_ptr_ptr struct_declarations.s2.u2.u1s1.e.6 struct_declarations.long_array.5 struct_declarations.s2.u2.u1s1.e.7 struct_declarations.long_array.6 struct_declarations.s2.u2.u1s1.e.8 struct_declarations.long_array.7 struct_declarations.s2.u2.u1s1.e.9 struct_declarations.long_array.8 struct_declarations.character struct_declarations.long_array.9 struct_declarations.int_ptr_ptr.*int_ptr_ptr struct_declarations.s2.u2.u1s1.func struct_declarations.s2.u2.u1s2.array_ptr struct_declarations.s2.u2.f struct_declarations.s2.u2.u1s1.foo struct_declarations struct_declarations.s2.u2.u1s1 struct_declarations.s2.u2.u1s2.array_ptr.0 struct_declarations.char_ptr struct_declarations.s2.u2.u1s2 struct_declarations.s2.u2.u1s2.array_ptr.1 struct_declarations.int_ptr_ptr struct_declarations.s2 struct_declarations.long_array struct_declarations.s2.g struct_declarations.s2.i.0 struct_declarations.s2.h struct_declarations.s2.i.1 struct_declarations.s2.i struct_declarations.s2.i.2} {}}
1218
 
1219
# Step over "struct_declarations.long_array[1] = 2345;"
1220
gdb_cmd "step"
1221
 
1222
# Test: c_variable-5.6
1223
# Desc: check that long_array[1] changed
1224
gdbtk_test c_variable-5.6 {check that long_array[1] changed} {
1225
  check_update
1226
} {struct_declarations.long_array.1 {struct_declarations.s2.i.3 struct_declarations.func_ptr_ptr struct_declarations.s2.i.4 struct_declarations.s2.i.5 struct_declarations.s2.i.6 struct_declarations.func_ptr struct_declarations.s2.i.7 struct_declarations.s2.i.8 struct_declarations.s2.i.9 struct_declarations.s2.u2.u1s1.d struct_declarations.func_ptr_struct struct_declarations.s2.u2.u1s1.e struct_declarations.u1 struct_declarations.long_int struct_declarations.s2.u2.u1s2.func struct_declarations.integer struct_declarations.s2.u2 struct_declarations.s2.u2.u1s1.e.0 struct_declarations.s2.u2.u1s1.e.1 struct_declarations.long_array.0 struct_declarations.s2.u2.u1s1.e.2 struct_declarations.u1.a struct_declarations.s2.u2.u1s1.e.3 struct_declarations.long_array.2 struct_declarations.u1.b struct_declarations.s2.u2.u1s1.e.4 struct_declarations.long_array.3 struct_declarations.u1.c struct_declarations.s2.u2.u1s1.e.5 struct_declarations.long_array.4 struct_declarations.u1.d struct_declarations.int_ptr_ptr.*int_ptr_ptr.**int_ptr_ptr struct_declarations.s2.u2.u1s1.e.6 struct_declarations.long_array.5 struct_declarations.s2.u2.u1s1.e.7 struct_declarations.long_array.6 struct_declarations.s2.u2.u1s1.e.8 struct_declarations.long_array.7 struct_declarations.s2.u2.u1s1.e.9 struct_declarations.long_array.8 struct_declarations.character struct_declarations.long_array.9 struct_declarations.int_ptr_ptr.*int_ptr_ptr struct_declarations.s2.u2.u1s1.func struct_declarations.s2.u2.u1s2.array_ptr struct_declarations.s2.u2.f struct_declarations.s2.u2.u1s1.foo struct_declarations struct_declarations.s2.u2.u1s1 struct_declarations.s2.u2.u1s2.array_ptr.0 struct_declarations.char_ptr struct_declarations.s2.u2.u1s2 struct_declarations.s2.u2.u1s2.array_ptr.1 struct_declarations.int_ptr_ptr struct_declarations.s2 struct_declarations.long_array struct_declarations.s2.g struct_declarations.s2.i.0 struct_declarations.s2.h struct_declarations.s2.i.1 struct_declarations.s2.i struct_declarations.s2.i.2} {}}
1227
 
1228
# Step over "weird->long_array[2] = 3456;"
1229
gdb_cmd "step"
1230
 
1231
# Test: c_variable-5.7
1232
# Desc: check that long_array[2] changed
1233
gdbtk_test c_variable-5.7 {check that long_array[2] changed} {
1234
  check_update
1235
} {struct_declarations.long_array.2 {struct_declarations.s2.i.3 struct_declarations.func_ptr_ptr struct_declarations.s2.i.4 struct_declarations.s2.i.5 struct_declarations.s2.i.6 struct_declarations.func_ptr struct_declarations.s2.i.7 struct_declarations.s2.i.8 struct_declarations.s2.i.9 struct_declarations.s2.u2.u1s1.d struct_declarations.func_ptr_struct struct_declarations.s2.u2.u1s1.e struct_declarations.u1 struct_declarations.long_int struct_declarations.s2.u2.u1s2.func struct_declarations.integer struct_declarations.s2.u2 struct_declarations.s2.u2.u1s1.e.0 struct_declarations.s2.u2.u1s1.e.1 struct_declarations.long_array.0 struct_declarations.s2.u2.u1s1.e.2 struct_declarations.long_array.1 struct_declarations.u1.a struct_declarations.s2.u2.u1s1.e.3 struct_declarations.u1.b struct_declarations.s2.u2.u1s1.e.4 struct_declarations.long_array.3 struct_declarations.u1.c struct_declarations.s2.u2.u1s1.e.5 struct_declarations.long_array.4 struct_declarations.u1.d struct_declarations.int_ptr_ptr.*int_ptr_ptr.**int_ptr_ptr struct_declarations.s2.u2.u1s1.e.6 struct_declarations.long_array.5 struct_declarations.s2.u2.u1s1.e.7 struct_declarations.long_array.6 struct_declarations.s2.u2.u1s1.e.8 struct_declarations.long_array.7 struct_declarations.s2.u2.u1s1.e.9 struct_declarations.long_array.8 struct_declarations.character struct_declarations.long_array.9 struct_declarations.int_ptr_ptr.*int_ptr_ptr struct_declarations.s2.u2.u1s1.func struct_declarations.s2.u2.u1s2.array_ptr struct_declarations.s2.u2.f struct_declarations.s2.u2.u1s1.foo struct_declarations struct_declarations.s2.u2.u1s1 struct_declarations.s2.u2.u1s2.array_ptr.0 struct_declarations.char_ptr struct_declarations.s2.u2.u1s2 struct_declarations.s2.u2.u1s2.array_ptr.1 struct_declarations.int_ptr_ptr struct_declarations.s2 struct_declarations.long_array struct_declarations.s2.g struct_declarations.s2.i.0 struct_declarations.s2.h struct_declarations.s2.i.1 struct_declarations.s2.i struct_declarations.s2.i.2} {}}
1236
 
1237
# Step over:
1238
#    struct_declarations.long_array[3] = 4567;
1239
#    weird->long_array[4] = 5678;
1240
#    struct_declarations.long_array[5] = 6789;
1241
#    weird->long_array[6] = 7890;
1242
#    struct_declarations.long_array[7] = 8901;
1243
#    weird->long_array[8] = 9012;
1244
#    struct_declarations.long_array[9] = 1234;
1245
for {set i 0} {$i < 7} {incr i} {
1246
  gdb_cmd "step"
1247
}
1248
 
1249
# Test: c_variable-5.8
1250
# Desc: check that long_array[3-9] changed
1251
gdbtk_test c_variable-5.8 {check that long_array[3-9] changed} {
1252
  check_update
1253
} {{struct_declarations.long_array.3 struct_declarations.long_array.4 struct_declarations.long_array.5 struct_declarations.long_array.6 struct_declarations.long_array.7 struct_declarations.long_array.8 struct_declarations.long_array.9} {struct_declarations.s2.i.3 struct_declarations.func_ptr_ptr struct_declarations.s2.i.4 struct_declarations.s2.i.5 struct_declarations.s2.i.6 struct_declarations.func_ptr struct_declarations.s2.i.7 struct_declarations.s2.i.8 struct_declarations.s2.i.9 struct_declarations.s2.u2.u1s1.d struct_declarations.func_ptr_struct struct_declarations.s2.u2.u1s1.e struct_declarations.u1 struct_declarations.long_int struct_declarations.s2.u2.u1s2.func struct_declarations.integer struct_declarations.s2.u2 struct_declarations.s2.u2.u1s1.e.0 struct_declarations.s2.u2.u1s1.e.1 struct_declarations.long_array.0 struct_declarations.s2.u2.u1s1.e.2 struct_declarations.long_array.1 struct_declarations.u1.a struct_declarations.s2.u2.u1s1.e.3 struct_declarations.long_array.2 struct_declarations.u1.b struct_declarations.s2.u2.u1s1.e.4 struct_declarations.u1.c struct_declarations.s2.u2.u1s1.e.5 struct_declarations.u1.d struct_declarations.int_ptr_ptr.*int_ptr_ptr.**int_ptr_ptr struct_declarations.s2.u2.u1s1.e.6 struct_declarations.s2.u2.u1s1.e.7 struct_declarations.s2.u2.u1s1.e.8 struct_declarations.s2.u2.u1s1.e.9 struct_declarations.character struct_declarations.int_ptr_ptr.*int_ptr_ptr struct_declarations.s2.u2.u1s1.func struct_declarations.s2.u2.u1s2.array_ptr struct_declarations.s2.u2.f struct_declarations.s2.u2.u1s1.foo struct_declarations struct_declarations.s2.u2.u1s1 struct_declarations.s2.u2.u1s2.array_ptr.0 struct_declarations.char_ptr struct_declarations.s2.u2.u1s2 struct_declarations.s2.u2.u1s2.array_ptr.1 struct_declarations.int_ptr_ptr struct_declarations.s2 struct_declarations.long_array struct_declarations.s2.g struct_declarations.s2.i.0 struct_declarations.s2.h struct_declarations.s2.i.1 struct_declarations.s2.i struct_declarations.s2.i.2} {}}
1254
 
1255
# Step over "weird->func_ptr = nothing;"
1256
gdb_cmd "step"
1257
 
1258
# Test: c_variable-5.9
1259
# Desc: check that func_ptr changed
1260
gdbtk_test c_variable-5.9 {check that func_ptr changed} {
1261
  check_update
1262
} {struct_declarations.func_ptr {struct_declarations.s2.i.3 struct_declarations.func_ptr_ptr struct_declarations.s2.i.4 struct_declarations.s2.i.5 struct_declarations.s2.i.6 struct_declarations.s2.i.7 struct_declarations.s2.i.8 struct_declarations.s2.i.9 struct_declarations.s2.u2.u1s1.d struct_declarations.func_ptr_struct struct_declarations.s2.u2.u1s1.e struct_declarations.u1 struct_declarations.long_int struct_declarations.s2.u2.u1s2.func struct_declarations.integer struct_declarations.s2.u2 struct_declarations.s2.u2.u1s1.e.0 struct_declarations.s2.u2.u1s1.e.1 struct_declarations.long_array.0 struct_declarations.s2.u2.u1s1.e.2 struct_declarations.long_array.1 struct_declarations.u1.a struct_declarations.s2.u2.u1s1.e.3 struct_declarations.long_array.2 struct_declarations.u1.b struct_declarations.s2.u2.u1s1.e.4 struct_declarations.long_array.3 struct_declarations.u1.c struct_declarations.s2.u2.u1s1.e.5 struct_declarations.long_array.4 struct_declarations.u1.d struct_declarations.int_ptr_ptr.*int_ptr_ptr.**int_ptr_ptr struct_declarations.s2.u2.u1s1.e.6 struct_declarations.long_array.5 struct_declarations.s2.u2.u1s1.e.7 struct_declarations.long_array.6 struct_declarations.s2.u2.u1s1.e.8 struct_declarations.long_array.7 struct_declarations.s2.u2.u1s1.e.9 struct_declarations.long_array.8 struct_declarations.character struct_declarations.long_array.9 struct_declarations.int_ptr_ptr.*int_ptr_ptr struct_declarations.s2.u2.u1s1.func struct_declarations.s2.u2.u1s2.array_ptr struct_declarations.s2.u2.f struct_declarations.s2.u2.u1s1.foo struct_declarations struct_declarations.s2.u2.u1s1 struct_declarations.s2.u2.u1s2.array_ptr.0 struct_declarations.char_ptr struct_declarations.s2.u2.u1s2 struct_declarations.s2.u2.u1s2.array_ptr.1 struct_declarations.int_ptr_ptr struct_declarations.s2 struct_declarations.long_array struct_declarations.s2.g struct_declarations.s2.i.0 struct_declarations.s2.h struct_declarations.s2.i.1 struct_declarations.s2.i struct_declarations.s2.i.2} {}}
1263
 
1264
# Delete all variables
1265
delete_all_variables
1266
 
1267
# Step over all lines:
1268
# ...
1269
#   psnp = &snp0;
1270
for {set i 0} {$i < 43} {incr i} {
1271
  gdb_cmd "step"
1272
}
1273
 
1274
# Test: c_variable-5.10
1275
# Desc: create psnp->char_ptr
1276
gdbtk_test c_variable-5.10 {create psnp->char_ptr} {
1277
  create_variable psnp->char_ptr
1278
} {0}
1279
 
1280
# Test: c_variable-5.11
1281
# Desc: children of psnp->char_ptr
1282
gdbtk_test c_variable-5.11 {children of psnp->char_ptr} {
1283
  get_children psnp->char_ptr
1284
} {*psnp->char_ptr}
1285
 
1286
# Test: c_variable-5.12
1287
# Desc: number of children of psnp->char_ptr
1288
gdbtk_test c_variable-5.12 {number of children of psnp->char_ptr} {
1289
  $var(psnp->char_ptr) numChildren
1290
} {1}
1291
 
1292
# Test: c_variable-5.13
1293
# Desc: children of *(psnp->char_ptr)
1294
gdbtk_test c_variable-5.13 {children of *(psnp->char_ptr)} {
1295
  get_children psnp->char_ptr.*psnp->char_ptr
1296
} {**psnp->char_ptr}
1297
 
1298
# Test: c_variable-5.14
1299
# Desc: number of children of *(psnp->char_ptr)
1300
gdbtk_test c_variable-5.14 {number of children of *(psnp->char_ptr)} {
1301
  $var(psnp->char_ptr.*psnp->char_ptr) numChildren
1302
} {1}
1303
 
1304
# Test: c_variable-5.15
1305
# Desc: children of *(*(psnp->char_ptr))
1306
gdbtk_test c_variable-5.15 {children of *(*(psnp->char_ptr))} {
1307
  get_children psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr
1308
} {***psnp->char_ptr}
1309
 
1310
# Test: c_variable-5.16
1311
# Desc: number of children of *(*(psnp->char_ptr))
1312
gdbtk_test c_variable-5.16 {number of children of *(*(psnp->char_ptr))} {
1313
  $var(psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr) numChildren
1314
} {1}
1315
 
1316
# Test: c_variable-5.17
1317
# Desc: children of *(*(*(psnp->char_ptr)))
1318
gdbtk_test c_variable-5.17 {children of *(*(*(psnp->char_ptr)))} {
1319
  get_children psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr.***psnp->char_ptr
1320
} {}
1321
 
1322
# Test: c_variable-5.18
1323
# Desc: number of children of *(*(*(psnp->char_ptr)))
1324
gdbtk_test c_variable-5.18 {number of children of *(*(*(psnp->char_ptr)))} {
1325
  $var(psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr.***psnp->char_ptr) numChildren
1326
} {0}
1327
 
1328
# Test: c_variable-5.19
1329
# Desc: create psnp->long_ptr
1330
gdbtk_test c_variable-5.19 {create psnp->long_ptr} {
1331
  create_variable psnp->long_ptr
1332
} {0}
1333
 
1334
# Test: c_variable-5.20
1335
# Desc: children of psnp->long_ptr
1336
gdbtk_test c_variable-5.20 {children of psnp->long_ptr} {
1337
  get_children psnp->long_ptr
1338
} {*psnp->long_ptr}
1339
 
1340
# Test: c_variable-5.21
1341
# Desc: number of children of psnp->long_ptr
1342
gdbtk_test c_variable-5.21 {number of children of psnp->long_ptr} {
1343
  $var(psnp->long_ptr) numChildren
1344
} {1}
1345
 
1346
# Test: c_variable-5.22
1347
# Desc: children of *(psnp->long_ptr)
1348
gdbtk_test c_variable-5.22 {children of *(psnp->long_ptr)} {
1349
  get_children psnp->long_ptr.*psnp->long_ptr
1350
} {**psnp->long_ptr}
1351
 
1352
# Test: c_variable-5.23
1353
# Desc: number of children of *(psnp->long_ptr)
1354
gdbtk_test c_variable-5.23 {number of children of *(psnp->long_ptr)} {
1355
  $var(psnp->long_ptr.*psnp->long_ptr) numChildren
1356
} {1}
1357
 
1358
# Test: c_variable-5.24
1359
# Desc: children of *(*(psnp->long_ptr))
1360
gdbtk_test c_variable-5.24 {children of *(*(psnp->long_ptr))} {
1361
  get_children psnp->long_ptr.*psnp->long_ptr.**psnp->long_ptr
1362
} {***psnp->long_ptr}
1363
 
1364
# Test: c_variable-5.25
1365
# Desc: number of children of *(*(psnp->long_ptr))
1366
gdbtk_test c_variable-5.25 {number of children of *(*(psnp->long_ptr))} {
1367
  $var(psnp->long_ptr.*psnp->long_ptr.**psnp->long_ptr) numChildren
1368
} {1}
1369
 
1370
# Test: c_variable-5.26
1371
# Desc: children of *(*(*(psnp->long_ptr)))
1372
gdbtk_test c_variable-5.26 {children of *(*(*(psnp->long_ptr)))} {
1373
  get_children psnp->long_ptr.*psnp->long_ptr.**psnp->long_ptr.***psnp->long_ptr
1374
} {****psnp->long_ptr}
1375
 
1376
# Test: c_variable-5.27
1377
# Desc: number of children of *(*(*(psnp->long_ptr)))
1378
gdbtk_test c_variable-5.27 {number of children of *(*(*(psnp->long_ptr)))} {
1379
  $var(psnp->long_ptr.*psnp->long_ptr.**psnp->long_ptr.***psnp->long_ptr) numChildren
1380
} {1}
1381
 
1382
# Test: c_variable-5.28
1383
# Desc: children of *(*(*(*(psnp->long_ptr))))
1384
gdbtk_test c_variable-5.29 {children of *(*(*(*(psnp->long_ptr))))} {
1385
  get_children psnp->long_ptr.*psnp->long_ptr.**psnp->long_ptr.***psnp->long_ptr.****psnp->long_ptr
1386
} {}
1387
 
1388
# Test: c_variable-5.29
1389
# Desc: number of children of *(*(*(*(psnp->long_ptr))))
1390
gdbtk_test c_variable-5.29 {number of children of *(*(*(*(psnp->long_ptr))))} {
1391
  $var(psnp->long_ptr.*psnp->long_ptr.**psnp->long_ptr.***psnp->long_ptr.****psnp->long_ptr) numChildren
1392
} {0}
1393
 
1394
# Test: c_variable-5.30
1395
# Desc: create psnp->ptrs
1396
gdbtk_test c_variable-5.30 {create psnp->ptrs} {
1397
  create_variable psnp->ptrs
1398
} {0}
1399
 
1400
# Test: c_variable-5.31
1401
# Desc: children of psnp->ptrs
1402
gdbtk_test c_variable-5.31 {children of psnp->ptrs} {
1403
  get_children psnp->ptrs
1404
} {0 1 2}
1405
 
1406
# Test: c_variable-5.32
1407
# Desc: number of children of psnp->ptrs
1408
gdbtk_test c_variable-5.32 {number of children of psnp->ptrs} {
1409
  $var(psnp->ptrs) numChildren
1410
} {3}
1411
 
1412
# Test: c_variable-5.33
1413
# Desc: children of psnp->ptrs[0]
1414
gdbtk_test c_variable-5.33 {children of psnp->ptrs[0]} {
1415
  get_children psnp->ptrs.0
1416
} {char_ptr long_ptr ptrs next}
1417
 
1418
# Test: c_variable-5.34
1419
# Desc: number of children of psnp->ptrs[0]
1420
gdbtk_test c_variable-5.34 {number of children of psnp->ptrs[0]} {
1421
  $var(psnp->ptrs.0) numChildren
1422
} {4}
1423
 
1424
# Test: c_variable-5.35
1425
# Desc: children of psnp->ptrs[0]->next
1426
gdbtk_test c_variable-5.35 {children of psnp->ptrs.0.next} {
1427
  get_children psnp->ptrs.0.next
1428
} {char_ptr long_ptr ptrs next}
1429
 
1430
# Test: c_variable-5.36
1431
# Desc: number of children of psnp->ptrs[0]->next
1432
gdbtk_test c_variable-5.36 {number of children of psnp->ptrs[0]->next} {
1433
  $var(psnp->ptrs.0.next) numChildren
1434
} {4}
1435
 
1436
# Test: c_variable-5.37
1437
# Desc: children of psnp->ptrs[0]->next->char_ptr
1438
gdbtk_test c_variable-5.37 {children of psnp->ptrs[0]->next->char_ptr} {
1439
  get_children psnp->ptrs.0.next.char_ptr
1440
} {*char_ptr}
1441
 
1442
# Test: c_variable-5.38
1443
# Desc: number of children of psnp->ptrs[0]->next->char_ptr
1444
gdbtk_test c_variable-5.38 {number of children of psnp->ptrs[0]->next->char_ptr} {
1445
  $var(psnp->ptrs.0.next.char_ptr) numChildren
1446
} {1}
1447
 
1448
# Test: c_variable-5.39
1449
# Desc: children of *psnp->ptrs[0]->next->char_ptr
1450
gdbtk_test c_variable-5.39 {children of *psnp->ptrs[0]->next->char_ptr} {
1451
  get_children psnp->ptrs.0.next.char_ptr.*char_ptr
1452
} {**char_ptr}
1453
 
1454
# Test: c_variable-5.40
1455
# Desc: number of children of *psnp->ptrs[0]->next->char_ptr
1456
gdbtk_test c_variable-5.40 {number of children of *psnp->ptrs[0]->next->char_ptr} {
1457
  $var(psnp->ptrs.0.next.char_ptr.*char_ptr) numChildren
1458
} {1}
1459
 
1460
# Test: c_variable-5.41
1461
# Desc: children of **psnp->ptrs[0]->next->char_ptr
1462
gdbtk_test c_variable-5.41 {children of **psnp->ptrs[0]->next->char_ptr} {
1463
  get_children psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr
1464
} {***char_ptr}
1465
 
1466
# Test: c_variable-5.42
1467
# Desc: number of children of **psnp->ptrs[0]->next->char_ptr
1468
gdbtk_test c_variable-5.42 {number of children of **psnp->ptrs[0]->next->char_ptr} {
1469
  $var(psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr) numChildren
1470
} {1}
1471
 
1472
# Test: c_variable-5.43
1473
# Desc: children of ***psnp->ptrs[0]->next->char_ptr
1474
gdbtk_test c_variable-5.43 {children of ***psnp->ptrs[0]->next->char_ptr} {
1475
  get_children psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr.***char_ptr
1476
} {}
1477
 
1478
# Test: c_variable-5.44
1479
# Desc: number of children of ***psnp->ptrs[0]->next->char_ptr
1480
gdbtk_test c_variable-5.44 {number of children of ***psnp->ptrs[0]->next->char_ptr} {
1481
  $var(psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr.***char_ptr) numChildren
1482
} {0}
1483
 
1484
# Test: c_variable-5.45
1485
# Desc: children of psnp->ptrs[0]->next->next
1486
gdbtk_test c_variable-5.45 {children of psnp->ptrs[0]->next->next} {
1487
  get_children psnp->ptrs.0.next.next
1488
} {char_ptr long_ptr ptrs next}
1489
 
1490
# Test: c_variable-5.46
1491
# Desc: children of psnp->ptrs[0]->next->next->ptrs
1492
gdbtk_test c_variable-5.46 {children of psnp->ptrs[0]->next->next->ptrs} {
1493
  get_children psnp->ptrs.0.next.next.ptrs
1494
} {0 1 2}
1495
 
1496
#  Step over "snp0.char_ptr = &b3;"
1497
gdb_cmd "step"
1498
 
1499
# Test: c_variable-5.47
1500
# Desc: check that psnp->char_ptr (and [0].char_ptr) changed
1501
gdbtk_test c_variable-5.47 {check that psnp->char_ptr (and [0].char_ptr) changed} {
1502
  check_update
1503
} {{psnp->ptrs.0.char_ptr psnp->char_ptr psnp->char_ptr.*psnp->char_ptr psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr.***psnp->char_ptr} {psnp->ptrs.0.next psnp->ptrs.0.next.ptrs psnp->ptrs.0.next.next psnp->ptrs.0.next.next.char_ptr psnp->ptrs.0.next.next.long_ptr psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr.***char_ptr psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr psnp->ptrs.0.next.char_ptr psnp->ptrs.0.next.long_ptr psnp->ptrs.0.next.next.ptrs psnp->ptrs.0.next.char_ptr.*char_ptr psnp->ptrs psnp->long_ptr.*psnp->long_ptr.**psnp->long_ptr.***psnp->long_ptr.****psnp->long_ptr psnp->ptrs.0.next.next.next psnp->ptrs.0.next.next.ptrs.0 psnp->long_ptr.*psnp->long_ptr.**psnp->long_ptr.***psnp->long_ptr psnp->long_ptr.*psnp->long_ptr psnp->ptrs.0.next.next.ptrs.1 psnp->ptrs.0.next.next.ptrs.2 psnp->ptrs.0.long_ptr psnp->long_ptr psnp->ptrs.0.ptrs psnp->ptrs.0 psnp->ptrs.1 psnp->ptrs.2 psnp->long_ptr.*psnp->long_ptr.**psnp->long_ptr} {}}
1504
 
1505
#  Step over "snp1.char_ptr = &c3;"
1506
gdb_cmd "step"
1507
 
1508
# Test: c_variable-5.48
1509
# Desc: check that psnp->next->char_ptr (and [1].char_ptr) changed
1510
gdbtk_test c_variable-5.48 {check that psnp->next->char_ptr (and [1].char_ptr) changed} {
1511
  check_update
1512
} {{psnp->ptrs.0.next.char_ptr psnp->ptrs.0.next.char_ptr.*char_ptr psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr.***char_ptr} {psnp->ptrs.0.next psnp->ptrs.0.next.ptrs psnp->ptrs.0.next.next psnp->ptrs.0.next.next.char_ptr psnp->ptrs.0.next.next.long_ptr psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr psnp->ptrs.0.next.long_ptr psnp->ptrs.0.next.next.ptrs psnp->ptrs psnp->long_ptr.*psnp->long_ptr.**psnp->long_ptr.***psnp->long_ptr.****psnp->long_ptr psnp->ptrs.0.next.next.next psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr.***psnp->char_ptr psnp->char_ptr.*psnp->char_ptr psnp->ptrs.0.next.next.ptrs.0 psnp->long_ptr.*psnp->long_ptr.**psnp->long_ptr.***psnp->long_ptr psnp->long_ptr.*psnp->long_ptr psnp->ptrs.0.next.next.ptrs.1 psnp->ptrs.0.next.next.ptrs.2 psnp->ptrs.0.char_ptr psnp->ptrs.0.long_ptr psnp->char_ptr psnp->long_ptr psnp->ptrs.0.ptrs psnp->ptrs.0 psnp->ptrs.1 psnp->ptrs.2 psnp->long_ptr.*psnp->long_ptr.**psnp->long_ptr} {}}
1513
 
1514
#  Step over "snp2.char_ptr = &a3;"
1515
gdb_cmd "step"
1516
 
1517
# Test: c_variable-5.49
1518
# Desc: check that psnp->next->next->char_ptr (and [2].char_ptr) changed
1519
gdbtk_test c_variable-5.49 {heck that psnp->next->next->char_ptr (and [2].char_ptr) changed} {
1520
  check_update
1521
} {psnp->ptrs.0.next.next.char_ptr {psnp->ptrs.0.next psnp->ptrs.0.next.ptrs psnp->ptrs.0.next.next psnp->ptrs.0.next.next.long_ptr psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr.***char_ptr psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr psnp->ptrs.0.next.char_ptr psnp->ptrs.0.next.long_ptr psnp->ptrs.0.next.next.ptrs psnp->ptrs.0.next.char_ptr.*char_ptr psnp->ptrs psnp->long_ptr.*psnp->long_ptr.**psnp->long_ptr.***psnp->long_ptr.****psnp->long_ptr psnp->ptrs.0.next.next.next psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr.***psnp->char_ptr psnp->char_ptr.*psnp->char_ptr psnp->ptrs.0.next.next.ptrs.0 psnp->long_ptr.*psnp->long_ptr.**psnp->long_ptr.***psnp->long_ptr psnp->long_ptr.*psnp->long_ptr psnp->ptrs.0.next.next.ptrs.1 psnp->ptrs.0.next.next.ptrs.2 psnp->ptrs.0.char_ptr psnp->ptrs.0.long_ptr psnp->char_ptr psnp->long_ptr psnp->ptrs.0.ptrs psnp->ptrs.0 psnp->ptrs.1 psnp->ptrs.2 psnp->long_ptr.*psnp->long_ptr.**psnp->long_ptr} {}}
1522
 
1523
#  Step over "snp0.long_ptr = &y3;"
1524
gdb_cmd "step"
1525
 
1526
# Test: c_variable-5.50
1527
# Desc: check that psnp->long_ptr (and [0].long_ptr) changed
1528
gdbtk_test c_variable-5.50 {check that psnp->long_ptr (and [0].long_ptr) changed} {
1529
  check_update
1530
} {{psnp->ptrs.0.long_ptr psnp->long_ptr psnp->long_ptr.*psnp->long_ptr psnp->long_ptr.*psnp->long_ptr.**psnp->long_ptr psnp->long_ptr.*psnp->long_ptr.**psnp->long_ptr.***psnp->long_ptr psnp->long_ptr.*psnp->long_ptr.**psnp->long_ptr.***psnp->long_ptr.****psnp->long_ptr} {psnp->ptrs.0.next psnp->ptrs.0.next.ptrs psnp->ptrs.0.next.next psnp->ptrs.0.next.next.char_ptr psnp->ptrs.0.next.next.long_ptr psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr.***char_ptr psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr psnp->ptrs.0.next.char_ptr psnp->ptrs.0.next.long_ptr psnp->ptrs.0.next.next.ptrs psnp->ptrs.0.next.char_ptr.*char_ptr psnp->ptrs psnp->ptrs.0.next.next.next psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr.***psnp->char_ptr psnp->char_ptr.*psnp->char_ptr psnp->ptrs.0.next.next.ptrs.0 psnp->ptrs.0.next.next.ptrs.1 psnp->ptrs.0.next.next.ptrs.2 psnp->ptrs.0.char_ptr psnp->char_ptr psnp->ptrs.0.ptrs psnp->ptrs.0 psnp->ptrs.1 psnp->ptrs.2} {}}
1531
 
1532
#  Step over "snp1.long_ptr = &x3;"
1533
gdb_cmd "step"
1534
 
1535
# Test: c_variable-5.51
1536
# Desc: check that psnp->next->long_ptr (and [1].long_ptr) changed
1537
gdbtk_test c_variable-5.51 {check that psnp->next->long_ptr (and [1].long_ptr) changed} {
1538
  check_update
1539
} {psnp->ptrs.0.next.long_ptr {psnp->ptrs.0.next psnp->ptrs.0.next.ptrs psnp->ptrs.0.next.next psnp->ptrs.0.next.next.char_ptr psnp->ptrs.0.next.next.long_ptr psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr.***char_ptr psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr psnp->ptrs.0.next.char_ptr psnp->ptrs.0.next.next.ptrs psnp->ptrs.0.next.char_ptr.*char_ptr psnp->ptrs psnp->long_ptr.*psnp->long_ptr.**psnp->long_ptr.***psnp->long_ptr.****psnp->long_ptr psnp->ptrs.0.next.next.next psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr.***psnp->char_ptr psnp->char_ptr.*psnp->char_ptr psnp->ptrs.0.next.next.ptrs.0 psnp->long_ptr.*psnp->long_ptr.**psnp->long_ptr.***psnp->long_ptr psnp->long_ptr.*psnp->long_ptr psnp->ptrs.0.next.next.ptrs.1 psnp->ptrs.0.next.next.ptrs.2 psnp->ptrs.0.char_ptr psnp->ptrs.0.long_ptr psnp->char_ptr psnp->long_ptr psnp->ptrs.0.ptrs psnp->ptrs.0 psnp->ptrs.1 psnp->ptrs.2 psnp->long_ptr.*psnp->long_ptr.**psnp->long_ptr} {}}
1540
 
1541
#  Step over "snp2.long_ptr = &z3;"
1542
gdb_cmd "step"
1543
 
1544
# Test: c_variable-5.52
1545
# Desc: check that psnp->next->next->long_ptr (and [2].long_ptr) changed
1546
gdbtk_test c_variable-5.52 {check that psnp->next->next->long_ptr (and [2].long_ptr) changed} {
1547
  check_update
1548
} {psnp->ptrs.0.next.next.long_ptr {psnp->ptrs.0.next psnp->ptrs.0.next.ptrs psnp->ptrs.0.next.next psnp->ptrs.0.next.next.char_ptr psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr.***char_ptr psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr psnp->ptrs.0.next.char_ptr psnp->ptrs.0.next.long_ptr psnp->ptrs.0.next.next.ptrs psnp->ptrs.0.next.char_ptr.*char_ptr psnp->ptrs psnp->long_ptr.*psnp->long_ptr.**psnp->long_ptr.***psnp->long_ptr.****psnp->long_ptr psnp->ptrs.0.next.next.next psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr.***psnp->char_ptr psnp->char_ptr.*psnp->char_ptr psnp->ptrs.0.next.next.ptrs.0 psnp->long_ptr.*psnp->long_ptr.**psnp->long_ptr.***psnp->long_ptr psnp->long_ptr.*psnp->long_ptr psnp->ptrs.0.next.next.ptrs.1 psnp->ptrs.0.next.next.ptrs.2 psnp->ptrs.0.char_ptr psnp->ptrs.0.long_ptr psnp->char_ptr psnp->long_ptr psnp->ptrs.0.ptrs psnp->ptrs.0 psnp->ptrs.1 psnp->ptrs.2 psnp->long_ptr.*psnp->long_ptr.**psnp->long_ptr} {}}
1549
 
1550
# Test: c_variable-5.53
1551
# Desc: names of editable variables
1552
gdbtk_test c_variable-5.53 {names of editable variables} {
1553
  editable_variables
1554
} {{psnp->ptrs.0.next psnp->ptrs.0.next.next psnp->ptrs.0.next.next.char_ptr psnp->ptrs.0.next.next.long_ptr psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr.***char_ptr psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr psnp->ptrs.0.next.char_ptr psnp->ptrs.0.next.long_ptr psnp->ptrs.0.next.char_ptr.*char_ptr psnp->long_ptr.*psnp->long_ptr.**psnp->long_ptr.***psnp->long_ptr.****psnp->long_ptr psnp->ptrs.0.next.next.next psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr.***psnp->char_ptr psnp->char_ptr.*psnp->char_ptr psnp->ptrs.0.next.next.ptrs.0 psnp->long_ptr.*psnp->long_ptr.**psnp->long_ptr.***psnp->long_ptr psnp->long_ptr.*psnp->long_ptr psnp->ptrs.0.next.next.ptrs.1 psnp->ptrs.0.next.next.ptrs.2 psnp->ptrs.0.char_ptr psnp->ptrs.0.long_ptr psnp->char_ptr psnp->long_ptr psnp->ptrs.0 psnp->ptrs.1 psnp->ptrs.2 psnp->long_ptr.*psnp->long_ptr.**psnp->long_ptr} {psnp->ptrs.0.next.ptrs psnp->ptrs.0.next.next.ptrs psnp->ptrs psnp->ptrs.0.ptrs}}
1555
 
1556
#####       #####
1557
#               #
1558
# Display tests #
1559
#               #
1560
#####       #####
1561
 
1562
delete_all_variables
1563
 
1564
# Test: c_variable-6.1
1565
# Desc: create variable bar
1566
gdbtk_test c_variable-6.1 {create variable bar} {
1567
  create_variable bar
1568
} {0}
1569
 
1570
# Test: c_variable-6.2
1571
# Desc: type of variable bar
1572
gdbtk_test c_variable-6.2 {type of variable bar} {
1573
  $var(bar) type
1574
} {int}
1575
 
1576
# Test: c_variable-6.3
1577
# Desc: format of variable bar
1578
gdbtk_test c_variable-6.3 {format of variable bar} {
1579
  $var(bar) format
1580
} {natural}
1581
 
1582
# Test: c_variable-6.4
1583
# Desc: value of variable bar
1584
gdbtk_test c_variable-6.4 {value of variable bar} {
1585
  value bar d
1586
} {ok}
1587
 
1588
# Test: c_variable-6.5
1589
# Desc: change format of bar to hex
1590
gdbtk_test c_variable-6.5 {change format of bar to hex} {
1591
  $var(bar) format hex
1592
  $var(bar) format
1593
} {hexadecimal}
1594
 
1595
# Test: c_variable-6.6
1596
# Desc: value of bar with new format
1597
gdbtk_test c_variable-6.6 {value of bar with new format} {
1598
  value bar x
1599
} {ok}
1600
 
1601
# Test: c_variable-6.7
1602
# Desc: change value of bar
1603
gdbtk_test c_variable-6.7 {change value of bar} {
1604
  $var(bar) value 3
1605
  value bar x
1606
} {ok}
1607
 
1608
# Test: c_variable-6.8
1609
# Desc: check new value of bar
1610
gdbtk_test c_variable-6.8 {change value of bar} {
1611
  $var(bar) format decimal
1612
  $var(bar) value
1613
} {3}
1614
 
1615
delete_variable bar
1616
 
1617
# Test: c_variable-6.11
1618
# Desc: create variable foo
1619
gdbtk_test c_variable-6.11 {create variable foo} {
1620
  create_variable foo
1621
} {0}
1622
 
1623
# Test: c_variable-6.12
1624
# Desc: type of variable foo
1625
gdbtk_test c_variable-6.12 {type of variable foo} {
1626
  $var(foo) type
1627
} {int *}
1628
 
1629
# Test: c_variable-6.13
1630
# Desc: format of variable foo
1631
gdbtk_test c_variable-6.13 {format of variable foo} {
1632
  $var(foo) format
1633
} {natural}
1634
 
1635
# Test: c_variable-6.14
1636
# Desc: value of variable foo
1637
gdbtk_test c_variable-6.14 {value of variable foo} {
1638
  value foo x
1639
} {ok}
1640
 
1641
# Test: c_variable-6.15
1642
# Desc: change format of var to octal
1643
gdbtk_test c_variable-6.15 {change format of foo to octal} {
1644
  $var(foo) format octal
1645
  $var(foo) format
1646
} {octal}
1647
 
1648
# Test: c_variable-6.16
1649
# Desc: value of foo with new format
1650
gdbtk_test c_variable-6.16 {value of foo with new format} {
1651
  value foo o
1652
} {ok}
1653
 
1654
# Test: c_variable-6.17
1655
# Desc: change value of foo
1656
gdbtk_test c_variable-6.17 {change value of foo} {
1657
  $var(foo) value 3
1658
  value foo o
1659
} {ok}
1660
 
1661
# Test: c_variable-6.18
1662
# Desc: check new value of foo
1663
gdbtk_test c_variable-6.18 {check new value of foo} {
1664
  $var(foo) format decimal
1665
  $var(foo) value
1666
} {3}
1667
 
1668
delete_variable foo
1669
 
1670
# Test: c_variable-6.21
1671
# Desc: create variable weird and children
1672
gdbtk_test c_variable-6.21 {create variable foo} {
1673
  if {![create_variable weird]} {
1674
    lsort [get_children weird]
1675
  }
1676
} {char_ptr character func_ptr func_ptr_ptr func_ptr_struct int_ptr_ptr integer long_array long_int s2 u1}
1677
 
1678
# Test: c_variable-6.22
1679
# Desc: type of weird and children
1680
gdbtk_test c_variable-6.22 {type of weird and children} {
1681
  set types {}
1682
  foreach v [lsort [array names var]] {
1683
    lappend types [$var($v) type]
1684
  }
1685
 
1686
  set types
1687
} {{weird_struct *} {char *} char {void (*)()} {struct _struct_decl *(*)()} {struct _struct_decl (*)()} {int **} int {long int [10]} {long int} struct union}
1688
 
1689
# Test: c_variable-6.23
1690
# Desc: change format of weird.func_ptr and weird.func_ptr_ptr
1691
gdbtk_test c_variable-6.23 {change format of weird.func_ptr and weird.func_ptr_ptr} {
1692
  $var(weird.func_ptr) format hexadecimal
1693
  $var(weird.func_ptr_ptr) format hexadecimal
1694
  set result {}
1695
  lappend result [$var(weird.func_ptr) format]
1696
  lappend result [$var(weird.func_ptr_ptr) format]
1697
  set result
1698
} {hexadecimal hexadecimal}
1699
 
1700
# Test: c_variable-6.24
1701
# Desc: format of weird and children
1702
gdbtk_test c_variable-6.24 {format of weird and children} {
1703
  set formats {}
1704
  foreach v [lsort [array names var]] {
1705
    lappend formats [$var($v) format]
1706
  }
1707
 
1708
  set formats
1709
} {natural natural natural hexadecimal hexadecimal natural natural natural natural natural natural natural}
1710
 
1711
# Test: c_variable-6.25
1712
# Desc: value of weird and children
1713
gdbtk_test c_variable-6.25 {value of weird and children} {
1714
  set values {}
1715
  foreach v [lsort [array names var]] f [list x "" "" x x x x d d d d d] {
1716
    lappend values [value $v $f]
1717
  }
1718
 
1719
  set values
1720
} {ok ok ok ok ok ok ok ok weird.long_array ok weird.s2 weird.u1}
1721
 
1722
# Test: c_variable-6.26
1723
# Desc: change format of weird and children to octal
1724
gdbtk_test c_variable-6.26 {change format of weird and children to octal} {
1725
  set formats {}
1726
  foreach v [lsort [array names var]] {
1727
    $var($v) format octal
1728
    lappend formats [$var($v) format]
1729
  }
1730
 
1731
  set formats
1732
} {octal octal octal octal octal octal octal octal octal octal octal octal}
1733
 
1734
# Test: c_variable-6.27
1735
# Desc: value of weird and children with new format
1736
gdbtk_test c_variable-6.27 {value of foo with new format} {
1737
  set values {}
1738
  foreach v [lsort [array names var]] {
1739
    lappend values [value $v o]
1740
  }
1741
 
1742
  set values
1743
} {ok ok ok ok ok ok ok ok weird.long_array ok weird.s2 weird.u1}
1744
 
1745
# Test: c_variable-6.30
1746
# Desc: create more children of weird
1747
gdbtk_test c_variable-6.30 {create more children of weird} {
1748
  foreach v [array names var] {
1749
    get_children $v
1750
  }
1751
 
1752
  # Do it twice to get more children
1753
  foreach v [array names var] {
1754
    get_children $v
1755
  }
1756
 
1757
  lsort [array names var]
1758
} {weird weird.char_ptr weird.character weird.func_ptr weird.func_ptr_ptr weird.func_ptr_struct weird.int_ptr_ptr weird.int_ptr_ptr.*int_ptr_ptr weird.int_ptr_ptr.*int_ptr_ptr.**int_ptr_ptr weird.integer weird.long_array weird.long_array.0 weird.long_array.1 weird.long_array.2 weird.long_array.3 weird.long_array.4 weird.long_array.5 weird.long_array.6 weird.long_array.7 weird.long_array.8 weird.long_array.9 weird.long_int weird.s2 weird.s2.g weird.s2.h weird.s2.i weird.s2.i.0 weird.s2.i.1 weird.s2.i.2 weird.s2.i.3 weird.s2.i.4 weird.s2.i.5 weird.s2.i.6 weird.s2.i.7 weird.s2.i.8 weird.s2.i.9 weird.s2.u2 weird.s2.u2.f weird.s2.u2.u1s1 weird.s2.u2.u1s2 weird.u1 weird.u1.a weird.u1.b weird.u1.c weird.u1.d}
1759
 
1760
# Test: c_variable-6.31
1761
# Desc: check that all children of weird change
1762
#       Ok, obviously things like weird.s2 and weird.u1 will not change!
1763
gdbtk_test *c_variable-6.31 {check that all children of weird change (ops, we are now reporting array names as changed in this case - seems harmless though)} {
1764
  $var(weird) value 0x2121
1765
  check_update
1766
} {{weird.integer weird.character weird.char_ptr weird.long_int weird.int_ptr_ptr weird.int_ptr_ptr.*int_ptr_ptr weird.int_ptr_ptr.*int_ptr_ptr.**int_ptr_ptr weird.long_array.0 weird.long_array.1 weird.long_array.2 weird.long_array.3 weird.long_array.4 weird.long_array.5 weird.long_array.6 weird.long_array.7 weird.long_array.8 weird.long_array.9 weird.func_ptr weird.func_ptr_struct weird.func_ptr_ptr weird.u1.a weird.u1.b weird.u1.c weird.u1.d weird.s2.u2.f weird.s2.g weird.s2.h weird.s2.i.0 weird.s2.i.1 weird.s2.i.2 weird.s2.i.3 weird.s2.i.4 weird.s2.i.5 weird.s2.i.6 weird.s2.i.7 weird.s2.i.8 weird.s2.i.9} {weird.s2.i weird.s2.u2 weird weird.s2.u2.u1s1 weird.s2.u2.u1s2 weird.s2 weird.long_array weird.u1} {}}
1767
 
1768
delete_variable weird
1769
 
1770
#####               #####
1771
#                       #
1772
# Special Display Tests #
1773
#                       #
1774
#####               #####
1775
 
1776
# Stop in "do_special_tests"
1777
gdb_cmd "break do_special_tests"
1778
gdb_cmd "continue"
1779
 
1780
# Test: c_variable-7.1
1781
# Desc: stop in do_special_tests
1782
gdbtk_test c_variable-7.1 {stop in do_special_tests} {
1783
  lindex [gdb_loc] 1
1784
} {do_special_tests}
1785
 
1786
# Test: c_variable-7.10
1787
# Desc: create union u
1788
gdbtk_test c_variable-7.10 {create union u} {
1789
  create_variable u
1790
} {0}
1791
 
1792
# Test: c_variable-7.11
1793
# Desc: value of u
1794
gdbtk_test c_variable-7.11 {value of u} {
1795
  $var(u) value
1796
} {{...}}
1797
 
1798
# Test: c_variable-7.12
1799
# Desc: type of u
1800
gdbtk_test c_variable-7.12 {type of u} {
1801
  $var(u) type
1802
} {union named_union}
1803
 
1804
# Test: c_variable-7.13
1805
# Desc: is u editable
1806
gdbtk_test c_variable-7.13 {is u editable} {
1807
  $var(u) editable
1808
} {0}
1809
 
1810
# Test: c_variable-7.14
1811
# Desc: number of children of u
1812
gdbtk_test c_variable-7.14 {number of children of u} {
1813
  $var(u) numChildren
1814
} {2}
1815
 
1816
# Test: c_variable-7.15
1817
# Desc: children of u
1818
gdbtk_test c_variable-7.15 {children of u} {
1819
  get_children u
1820
} {integer char_ptr}
1821
 
1822
# Test: c_variable-7.20
1823
# Desc: create anonu
1824
gdbtk_test c_variable-7.20 {create anonu} {
1825
  create_variable anonu
1826
} {0}
1827
 
1828
# Test: c_variable-7.21
1829
# Desc: value of anonu
1830
gdbtk_test c_variable-7.21 {value of anonu} {
1831
  $var(anonu) value
1832
} {{...}}
1833
 
1834
# Test: c_variable-7.22
1835
# Desc: type of anonu
1836
gdbtk_test c_variable-7.22 {type of anonu} {
1837
  $var(anonu) type
1838
} {union}
1839
 
1840
# Test: c_variable-7.23
1841
# Desc: is anonu editable
1842
gdbtk_test c_variable-7.23 {is anonu editable} {
1843
  $var(anonu) editable
1844
} {0}
1845
 
1846
# Test: c_variable-7.24
1847
# Desc: number of children of anonu
1848
gdbtk_test c_variable-7.24 {number of children of anonu} {
1849
  $var(anonu) numChildren
1850
} {3}
1851
 
1852
# Test: c_variable-7.25
1853
# Desc: children of anonu
1854
gdbtk_test c_variable-7.25 {children of anonu} {
1855
  get_children anonu
1856
} {a b c}
1857
 
1858
# Test: c_variable-7.30
1859
# Desc: create struct s
1860
gdbtk_test c_variable-7.30 {create struct s} {
1861
  create_variable s
1862
} {0}
1863
 
1864
# Test: c_variable-7.31
1865
# Desc: value of s
1866
gdbtk_test c_variable-7.31 {value of s} {
1867
  $var(s) value
1868
} {{...}}
1869
 
1870
# Test: c_variable-7.32
1871
# Desc: type of s
1872
gdbtk_test c_variable-7.32 {type of s} {
1873
  $var(s) type
1874
} {struct _simple_struct}
1875
 
1876
# Test: c_variable-7.33
1877
# Desc: is s editable
1878
gdbtk_test c_variable-7.33 {is s editable} {
1879
  $var(s) editable
1880
} {0}
1881
 
1882
# Test: c_variable-7.34
1883
# Desc: number of children of s
1884
gdbtk_test c_variable-7.34 {number of children of s} {
1885
  $var(s) numChildren
1886
} {6}
1887
 
1888
# Test: c_variable-7.35
1889
# Desc: children of s
1890
gdbtk_test c_variable-7.35 {children of s} {
1891
  get_children s
1892
} {integer unsigned_integer character signed_character char_ptr array_of_10}
1893
 
1894
# Test: c_variable-7.40
1895
# Desc: create anons
1896
gdbtk_test c_variable-7.40 {create anons} {
1897
  create_variable anons
1898
} {0}
1899
 
1900
# Test: c_variable-7.41
1901
# Desc: value of anons
1902
gdbtk_test c_variable-7.41 {value of anons} {
1903
  $var(anons) value
1904
} {{...}}
1905
 
1906
# Test: c_variable-7.42
1907
# Desc: type of anons
1908
gdbtk_test c_variable-7.42 {type of anons} {
1909
  $var(anons) type
1910
} {struct}
1911
 
1912
# Test: c_variable-7.43
1913
# Desc: is anons editable
1914
gdbtk_test c_variable-7.43 {is anons editable} {
1915
  $var(anons) editable
1916
} {0}
1917
 
1918
# Test: c_variable-7.44
1919
# Desc: number of children of anons
1920
gdbtk_test c_variable-7.44 {number of children of anons} {
1921
  $var(anons) numChildren
1922
} {3}
1923
 
1924
# Test: c_variable-7.45
1925
# Desc: children of anons
1926
gdbtk_test c_variable-7.45 {children of anons} {
1927
  get_children anons
1928
} {a b c}
1929
 
1930
# Test: c_variable-7.50
1931
# Desc: create enum e
1932
gdbtk_test c_variable-7.50 {create enum e} {
1933
  create_variable e
1934
} {0}
1935
 
1936
# Test: c_variable-7.51
1937
# Desc: value of e
1938
gdbtk_test c_variable-7.51 {value of e} {
1939
  $var(e) value bar
1940
  $var(e) value
1941
} {bar}
1942
 
1943
# Test: c_variable-7.52
1944
# Desc: type of e
1945
gdbtk_test c_variable-7.52 {type of e} {
1946
  $var(e) type
1947
} {enum foo}
1948
 
1949
# Test: c_variable-7.53
1950
# Desc: is e editable
1951
gdbtk_test c_variable-7.53 {is e editable} {
1952
  $var(e) editable
1953
} {1}
1954
 
1955
# Test: c_variable-7.54
1956
# Desc: number of children of e
1957
gdbtk_test c_variable-7.54 {number of children of e} {
1958
  $var(e) numChildren
1959
} {0}
1960
 
1961
# Test: c_variable-7.55
1962
# Desc: children of e
1963
gdbtk_test c_variable-7.55 {children of e} {
1964
  get_children e
1965
} {}
1966
 
1967
# Test: c_variable-7.60
1968
# Desc: create anone
1969
gdbtk_test c_variable-7.60 {create anone} {
1970
  create_variable anone
1971
} {0}
1972
 
1973
# Test: c_variable-7.61
1974
# Desc: value of anone
1975
gdbtk_test c_variable-7.61 {value of e} {
1976
  $var(e) value bar
1977
  $var(e) value
1978
} {bar}
1979
 
1980
# Test: c_variable-7.62
1981
# Desc: type of e
1982
gdbtk_test c_variable-7.62 {type of e} {
1983
  $var(e) type
1984
} {enum foo}
1985
 
1986
# Test: c_variable-7.63
1987
# Desc: is e editable
1988
gdbtk_test c_variable-7.63 {is e editable} {
1989
  $var(e) editable
1990
} {1}
1991
 
1992
# Test: c_variable-7.64
1993
# Desc: number of children of e
1994
gdbtk_test c_variable-7.64 {number of children of e} {
1995
  $var(e) numChildren
1996
} {0}
1997
 
1998
# Test: c_variable-7.65
1999
# Desc: children of e
2000
gdbtk_test c_variable-7.65 {children of e} {
2001
  get_children e
2002
} {}
2003
 
2004
# Test: c_variable-7.70
2005
# Desc: create anone
2006
gdbtk_test c_variable-7.70 {try to create anone again (duplicate obj name} {
2007
  create_variable anone
2008
} {1}
2009
 
2010
# Test: c_variable-7.71
2011
# Desc: value of anone
2012
gdbtk_test c_variable-7.71 {value of anone} {
2013
  $var(anone) value A
2014
  $var(anone) value
2015
} {A}
2016
 
2017
# Test: c_variable-7.72
2018
# Desc: type of anone
2019
gdbtk_test c_variable-7.72 {type of anone} {
2020
  $var(anone) type
2021
} {enum}
2022
 
2023
# Test: c_variable-7.73
2024
# Desc: is anone editable
2025
gdbtk_test c_variable-7.73 {is anone editable} {
2026
  $var(anone) editable
2027
} {1}
2028
 
2029
# Test: c_variable-7.74
2030
# Desc: number of children of anone
2031
gdbtk_test c_variable-7.74 {number of children of anone} {
2032
  $var(anone) numChildren
2033
} {0}
2034
 
2035
# Test: c_variable-7.75
2036
# Desc: children of anone
2037
gdbtk_test c_variable-7.75 {children of anone} {
2038
  get_children anone
2039
} {}
2040
 
2041
# Record fp
2042
set fp [gdb_cmd "output/x \$fp"]
2043
gdb_cmd {break incr_a}
2044
gdb_cmd {continue}
2045
 
2046
# Test: c_variable-7.80
2047
# Desc: stop in incr_a
2048
gdbtk_test c_variable-7.80 {stop in incr_a} {
2049
  lindex [gdb_loc] 1
2050
} {incr_a}
2051
 
2052
# Test: c_variable-7.81
2053
# Desc: Create variables in different scopes
2054
gdbtk_test c_variable-7.81 {create variables in different scopes} {
2055
  set a1 [gdb_variable create -expr a]
2056
  set a2 [gdb_variable create -expr a -frame $fp]
2057
 
2058
  set vals {}
2059
  lappend vals [$a1 value]
2060
  lappend vals [$a2 value]
2061
  set vals
2062
} {2 1}
2063
 
2064
#  Exit
2065
#
2066
gdbtk_test_done

powered by: WebSVN 2.1.0

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