OSDN Git Service

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