1 # Copyright (C) 1999, 2001 Red Hat, Inc.
3 # This program is free software; you can redistribute it and/or modify
4 # it under the terms of the GNU General Public License as published by
5 # the Free Software Foundation; either version 2 of the License, or
6 # (at your option) any later version.
8 # This program is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # GNU General Public License for more details.
13 # You should have received a copy of the GNU General Public License
14 # along with this program; if not, write to the Free Software
15 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 # This file was written by Martin Hunt (hunt@cygnus.com)
19 # Read in the standard defs file
21 if {![gdbtk_read_defs]} {
28 # move the pointer to the center of the bbox relative to $win
29 proc move_mouse_to {win bbox} {
30 if {[llength $bbox] != 4} {
33 set x [expr [lindex $bbox 0] + [lindex $bbox 2] / 2]
34 set y [expr [lindex $bbox 1] + [lindex $bbox 3] / 2]
35 warp_pointer . [winfo rootx $win] [winfo rooty $win]
40 while {$nx != $x || $ny != $y} {
41 if {$nx < $x} {incr nx}
42 if {$ny < $y} {incr ny}
43 warp_pointer $win $nx $ny
48 proc click {win bbox bnum} {
49 if {![move_mouse_to $win $bbox]} {
54 set x [expr [lindex $bbox 0] + [lindex $bbox 2] / 2]
55 set y [expr [lindex $bbox 1] + [lindex $bbox 3] / 2]
57 if {[catch {event generate $win <Button-$bnum> -x $x -y $y} result]} {
60 if {[catch {event generate $win <ButtonRelease-$bnum> -x $x -y $y} result]} {
69 # SECTION 1: Mode Tests #
73 # Load the test executable
74 set program [file join $objdir list]
75 if {[catch {gdbtk_test_file $program} t]} {
76 # This isn't a test case, since if this fails, we're hosed.
77 gdbtk_test_error "loading \"$program\": $t"
80 set srcwin [ManagedWin::open SrcWin]
81 set stw [$srcwin test_get twin]
82 set twin [$stw test_get twin]
89 # Desc: Check for something in source window
90 gdbtk_test srcwin-1.1 "source window has contents" {
91 set file1(source) [$twin get 1.0 end]
92 expr {![string compare $file1(source) ""]}
97 # Desc: source->assembly mode change
98 gdbtk_test srcwin-1.2 "source->assembly mode change" {
99 $srcwin mode "" ASSEMBLY
100 set twin [$stw test_get twin]
101 set file1(assembly) [$twin get 1.0 end]
102 expr {![string compare $file1(source) $file1(assembly)]}
106 # Desc: assembly->mixed mode change
107 gdbtk_test srcwin-1.3 "assembly->mixed mode change" {
108 $srcwin mode "" MIXED
109 set twin [$stw test_get twin]
110 set file1(mixed) [$twin get 1.0 end]
111 expr {![string compare $file1(mixed) $file1(assembly)]}
115 # Desc: mixed->src+asm mode change
116 gdbtk_test srcwin-1.4 "mixed->src+asm mode change" {
117 $srcwin mode "" SRC+ASM
118 set twin [$stw test_get twin]
119 set bwin [$stw test_get bwin]
120 set s [$twin get 1.0 end]
121 set a [$bwin get 1.0 end]
122 list [string compare $a $file1(assembly)] [string compare $s $file1(source)] [winfo ismapped $bwin]
126 # Desc: src+asm->source mode change
127 gdbtk_test srcwin-1.5 "src+asm->source mode change" {
128 $srcwin mode "" SOURCE
129 set twin [$stw test_get twin]
130 set a [$twin get 1.0 end]
131 set bwin [$stw test_get bwin]
132 list [string compare $file1(source) $a] [winfo ismapped $bwin]
136 # Desc: source->mixed mode change
137 gdbtk_test srcwin-1.6 "source->mixed mode change" {
138 $srcwin mode "" MIXED
139 set twin [$stw test_get twin]
140 set a [$twin get 1.0 end]
141 string compare $file1(mixed) $a
145 # Desc: mixed->source mode change
146 gdbtk_test srcwin-1.7 "mixed->source mode change" {
147 $srcwin mode "" SOURCE
148 set twin [$stw test_get twin]
149 set a [$twin get 1.0 end]
150 string compare $file1(source) $a
154 # Desc: source->src+asm mode change
155 gdbtk_test srcwin-1.8 "source->src+asm mode change" {
156 $srcwin mode "" SRC+ASM
157 set twin [$stw test_get twin]
158 set bwin [$stw test_get bwin]
159 set s [$twin get 1.0 end]
160 set a [$bwin get 1.0 end]
161 list [string compare $a $file1(assembly)] [string compare $s $file1(source)] [winfo ismapped $bwin]
165 # Desc: src+asm->assembly mode change
166 gdbtk_test srcwin-1.9 "src+asm->assembly mode change" {
167 $srcwin mode "" ASSEMBLY
168 set twin [$stw test_get twin]
169 set a [$twin get 1.0 end]
170 string compare $file1(assembly) $a
174 # Desc: assembly->src+asm mode change
175 gdbtk_test srcwin-1.10 "assembly->src+asm mode change" {
176 $srcwin mode "" SRC+ASM
177 set twin [$stw test_get twin]
178 set bwin [$stw test_get bwin]
179 set s [$twin get 1.0 end]
180 set a [$bwin get 1.0 end]
181 list [string compare $a $file1(assembly)] [string compare $s $file1(source)] [winfo ismapped $bwin]
185 # Desc: src+asm->mixed mode change
186 gdbtk_test srcwin-1.11 "src+asm->mixed mode change" {
187 $srcwin mode "" MIXED
188 set twin [$stw test_get twin]
189 set a [$twin get 1.0 end]
190 set bwin [$stw test_get bwin]
191 expr {[string compare $file1(mixed) $a] ||
192 [winfo ismapped $bwin]}
196 # Desc: mixed->assembly mode change
197 gdbtk_test srcwin-1.12 "mixed->assembly mode change" {
198 $srcwin mode "" ASSEMBLY
199 set twin [$stw test_get twin]
200 set a [$twin get 1.0 end]
201 string compare $file1(assembly) $a
205 # Desc: assembly->source mode change
206 gdbtk_test srcwin-1.13 "assembly->source mode change" {
207 $srcwin mode "" SOURCE
208 set twin [$stw test_get twin]
209 set a [$twin get 1.0 end]
210 string compare $file1(source) $a
216 # SECTION 2: Basic Operations #
221 # Desc: check contents of filename combobox
222 gdbtk_test srcwin-2.1 "check contents of filename combobox" {
223 set statbar [$srcwin test_get _statbar]
224 set names [$statbar.name list get 0 end]
226 foreach f {list0.c list1.c} {
227 if {[lsearch $names $f] != -1} {
235 # Desc: check contents of function combobox
236 gdbtk_test srcwin-2.2 "check contents of function combobox" {
237 set names [$statbar.func list get 0 end]
239 foreach f {main foo unused} {
240 if {[lsearch $names $f] != -1} {
248 # Desc: goto filename
249 gdbtk_test srcwin-2.3 "goto filename" {
250 set func [$srcwin test_get _name 1]
252 set twin [$stw test_get twin]
253 set file2(source) [$twin get 1.0 end]
254 expr {![string compare $file1(source) $file2(source)]}
258 # Desc: check contents of function combobox
259 gdbtk_test srcwin-2.4 "check contents of function combobox" {
260 set names [$statbar.func list get 0 end]
262 foreach f {bar long_line oof unused} {
263 if {[lsearch $names $f] != -1} {
271 # Desc: function combobox entry field should be empty after switching to a new file
272 gdbtk_test srcwin-2.5 "function combobox entry field should be empty" {
273 set names [$statbar.func get]
278 # Desc: goto function
279 gdbtk_test srcwin-2.6 "goto function bar" {
280 $srcwin goto_func "" bar
283 # now get a dump of all tags and check that only one line is
284 # marked BROWSE_TAG and no lines are STACK_TAG or PC_TAG.
286 # We know that list1.c should have BROWSE_TAG set at index 5.2
287 # for function "bar". If list1.c is changed or the layout of the source
288 # window is changed, this must be updated.
289 if {![catch {set z [$twin dump -tag 1.0 end]}]} {
292 if {$v == "BROWSE_TAG"} {
299 if {$v == "STACK_TAG"} { incr r 10}
300 if {$v == "PC_TAG"} { incr r 100}
308 # things are OK so far, so just verify the function name is displayed
309 # in the combobox entry field.
310 set names [$statbar.func get]
311 if {[string compare $names "bar"]} {set r -2}
317 # Desc: goto function "oof". This tests that the correct line is highlighted
318 # with BROWSE_TAG and no other lines are highlighted. It also checks that
319 # the combobox has the correct function name in it. Finally, list1.c
320 # has an extremely long line, line 32, that breaks some functions. We verify
321 # that the GDBtk has the correct line number.
323 gdbtk_test srcwin-2.7 "goto function oof" {
324 $srcwin goto_func "" oof
327 # now get a dump of all tags and check that only one line is
328 # marked BROWSE_TAG and no lines are STACK_TAG or PC_TAG.
330 # We know that list1.c should have BROWSE_TAG set at index 32.2
331 # for function "oof". If list1.c is changed or the layout of the source
332 # window is changed, this must be updated.
333 if {![catch {set z [$twin dump -tag 1.0 end]}]} {
336 if {$v == "BROWSE_TAG"} {
338 set line_number [$twin get "$i wordstart" "$i wordend"]
339 if {$line_number == "38"} {
348 if {$v == "STACK_TAG"} {incr r 10}
349 if {$v == "PC_TAG"} {incr r 100}
357 # things are OK so far, so just verify the function name is displayed
358 # in the combobox entry field.
359 set names [$statbar.func get]
360 if {[string compare $names "oof"]} {set r -2}
366 # Desc: This test issues a next command while browsing list1.c.
367 # It should display list0.c and highlight the correct line.
368 gdbtk_test srcwin-2.8 "step while browsing" {
369 gdb_immediate "next" 1
371 set name [$statbar.name get]
372 set func [$statbar.func get]
374 # check contents of name and function comboboxes
375 if {$name != "list0.c"} {set r -1}
376 if {$func != "main"} {set r -2}
378 # check that correct file is displayed
379 set twin [$stw test_get twin]
380 set a [$twin get 1.0 end]
381 if {[string compare $file1(source) $a]} {set r -3}
383 # check for PC_TAG on correct line
385 if {![catch {set z [$twin dump -tag 1.0 end]}]} {
388 if {$v == "PC_TAG"} {
395 if {$v == "STACK_TAG"} {incr r 10}
396 if {$v == "BROWSE_TAG"} {incr r 100}
407 # Desc: This test issues a next command while the current
408 # PC is ready to call a function. It should not go into the function and
409 # should update the PC highlight correctly.
410 gdbtk_test srcwin-2.9 "next" {
411 gdb_immediate "next" 1
413 set name [$statbar.name get]
414 set func [$statbar.func get]
416 # check contents of name and function comboboxes
417 if {$name != "list0.c"} {set r -1}
418 if {$func != "main"} {set r -2}
420 # check that correct file is displayed
421 set twin [$stw test_get twin]
422 set a [$twin get 1.0 end]
423 if {[string compare $file1(source) $a]} {set r -3}
425 # check for PC_TAG on correct line
427 if {![catch {set z [$twin dump -tag 1.0 end]}]} {
430 if {$v == "PC_TAG"} {
437 if {$v == "STACK_TAG"} {incr r 10}
438 if {$v == "BROWSE_TAG"} {incr r 100}
449 # Desc: This test issues a step command while the current
450 # PC is ready to call a function. It should step into the function.
451 gdbtk_test srcwin-2.10 "step" {
452 gdb_immediate "step" 1
454 set name [$statbar.name get]
455 set func [$statbar.func get]
457 # check contents of name and function comboboxes
458 if {$name != "list0.h"} {set r -1}
459 if {$func != "foo"} {set r -2}
461 # check that a new file is displayed
462 set twin [$stw test_get twin]
463 set file3(source) [$twin get 1.0 end]
464 if {![string compare $file1(source) $file3(source)]} {set r -3}
466 # check for PC_TAG on correct line
468 if {![catch {set z [$twin dump -tag 1.0 end]}]} {
471 if {$v == "PC_TAG"} {
478 if {$v == "STACK_TAG"} {incr r 10}
479 if {$v == "BROWSE_TAG"} {incr r 100}
490 # Desc: This test issues a break and a continue
491 gdbtk_test srcwin-2.11 "set BP and continue" {
492 gdb_immediate "break oof" 1
493 gdb_immediate "continue" 1
495 set name [$statbar.name get]
496 set func [$statbar.func get]
498 # check contents of name and function comboboxes
499 if {$name != "list1.c"} {set r -1}
500 if {$func != "oof"} {set r -2}
502 # check that the correct file is displayed
503 # we must clear the breakpoint first so it doesn't mess up the
505 gdb_immediate "clear oof" 1
506 set twin [$stw test_get twin]
507 set a [$twin get 1.0 end]
508 if {[string compare $file2(source) $a]} {set r -3}
510 # check for PC_TAG on correct line
512 if {![catch {set z [$twin dump -tag 1.0 end]}]} {
515 if {$v == "PC_TAG"} {
522 if {$v == "STACK_TAG"} {incr r 10}
523 if {$v == "BROWSE_TAG"} {incr r 100}
535 # SECTION 3: Stack Operations #
540 # Desc: This tests "stack up"
541 gdbtk_test srcwin-3.1 "stack up (1)" {
544 set name [$statbar.name get]
545 set func [$statbar.func get]
547 # check contents of name and function comboboxes
548 if {$name != "list1.c"} {set r -1}
549 if {$func != "long_line"} {set r -2}
551 # check that the correct file is displayed
552 set twin [$stw test_get twin]
553 set a [$twin get 1.0 end]
554 if {[string compare $file2(source) $a]} {set r -3}
556 # check for PC_TAG and STACK_TAG on correct lines
558 if {![catch {set z [$twin dump -tag 1.0 end]}]} {
561 if {$v == "PC_TAG"} {
569 if {$v == "STACK_TAG"} {
577 if {$v == "BROWSE_TAG"} {incr r 100}
588 # Desc: Another "stack up" test
589 gdbtk_test srcwin-3.2 "stack up (2)" {
592 set name [$statbar.name get]
593 set func [$statbar.func get]
595 # check contents of name and function comboboxes
596 if {$name != "list1.c"} {set r -1}
597 if {$func != "bar"} {set r -2}
599 # check that the correct file is displayed
600 set twin [$stw test_get twin]
601 set a [$twin get 1.0 end]
602 if {[string compare $file2(source) $a]} {set r -3}
604 # check for PC_TAG and STACK_TAG on correct lines
606 if {![catch {set z [$twin dump -tag 1.0 end]}]} {
609 if {$v == "PC_TAG"} {
617 if {$v == "STACK_TAG"} {
625 if {$v == "BROWSE_TAG"} {incr r 100}
636 # Desc: Another "stack up" test
637 gdbtk_test srcwin-3.3 "stack up (3)" {
640 set name [$statbar.name get]
641 set func [$statbar.func get]
643 # check contents of name and function comboboxes
644 if {$name != "list0.h"} {set r -1}
645 if {$func != "foo"} {set r -2}
647 # check that the correct file is displayed
648 set twin [$stw test_get twin]
649 set a [$twin get 1.0 end]
650 if {![string compare $file2(source) $a]} {set r -3}
652 # check for PC_TAG and STACK_TAG on correct lines
654 if {![catch {set z [$twin dump -tag 1.0 end]}]} {
657 if {$v == "STACK_TAG"} {
664 if {$v == "PC_TAG"} {incr r 10}
665 if {$v == "BROWSE_TAG"} {incr r 100}
676 # Desc: Another "stack up" test
677 gdbtk_test srcwin-3.4 "stack up (4)" {
680 set name [$statbar.name get]
681 set func [$statbar.func get]
683 # check contents of name and function comboboxes
684 if {$name != "list0.c"} {set r -1}
685 if {$func != "main"} {set r -2}
687 # check that the correct file is displayed
688 set twin [$stw test_get twin]
689 set a [$twin get 1.0 end]
690 if {[string compare $file1(source) $a]} {set r -3}
692 # check for PC_TAG and STACK_TAG on correct lines
694 if {![catch {set z [$twin dump -tag 1.0 end]}]} {
697 if {$v == "STACK_TAG"} {
704 if {$v == "PC_TAG"} {incr r 10}
705 if {$v == "BROWSE_TAG"} {incr r 100}
715 # Disabled for now because there are different correct results.
716 # Test should be rewritten to include those.
718 # Desc: "stack up" when we are at the top
719 #gdbtk_test srcwin-3.5 "stack up when at the top" {
722 # set name [$statbar.name get]
723 # set func [$statbar.func get]
725 # check contents of name and function comboboxes
726 # if {$name != "list0.c"} {set r -1}
727 # if {$func != "main"} {set r -2}
729 # check that the correct file is displayed
730 # set twin [$stw test_get twin]
731 # set a [$twin get 1.0 end]
732 # if {[string compare $file1(source) $a]} {set r -3}
734 # check for PC_TAG and STACK_TAG on correct lines
736 # if {![catch {set z [$twin dump -tag 1.0 end]}]} {
737 # foreach {k v i} $z {
738 # if {$k == "tagon"} {
739 # if {$v == "STACK_TAG"} {
740 # if {$i == "12.2"} {
746 # if {$v == "PC_TAG"} {incr r 10}
747 # if {$v == "BROWSE_TAG"} {incr r 100}
758 # Desc: "stack down" test
759 gdbtk_test srcwin-3.6 "stack down" {
762 set name [$statbar.name get]
763 set func [$statbar.func get]
765 # check contents of name and function comboboxes
766 if {$name != "list0.h"} {set r -1}
767 if {$func != "foo"} {set r -2}
769 # check that the correct file is displayed
770 set twin [$stw test_get twin]
771 set a [$twin get 1.0 end]
772 if {![string compare $file2(source) $a]} {set r -3}
774 # check for PC_TAG and STACK_TAG on correct lines
776 if {![catch {set z [$twin dump -tag 1.0 end]}]} {
779 if {$v == "STACK_TAG"} {
786 if {$v == "PC_TAG"} {incr r 10}
787 if {$v == "BROWSE_TAG"} {incr r 100}
798 # Desc: "stack bottom" test
799 gdbtk_test srcwin-3.7 "stack bottom" {
802 set name [$statbar.name get]
803 set func [$statbar.func get]
805 # check contents of name and function comboboxes
806 if {$name != "list1.c"} {set r -1}
807 if {$func != "oof"} {set r -2}
809 # check that the correct file is displayed
810 set twin [$stw test_get twin]
811 set a [$twin get 1.0 end]
812 if {[string compare $file2(source) $a]} {set r -3}
814 # check for PC_TAG on correct line
816 if {![catch {set z [$twin dump -tag 1.0 end]}]} {
819 if {$v == "PC_TAG"} {
826 if {$v == "STACK_TAG"} {incr r 10}
827 if {$v == "BROWSE_TAG"} {incr r 100}
838 # Desc: "stack down" when at bottom
839 gdbtk_test srcwin-3.8 "stack down when at bottom" {
842 set name [$statbar.name get]
843 set func [$statbar.func get]
845 # check contents of name and function comboboxes
846 if {$name != "list1.c"} {set r -1}
847 if {$func != "oof"} {set r -2}
849 # check that the correct file is displayed
850 set twin [$stw test_get twin]
851 set a [$twin get 1.0 end]
852 if {[string compare $file2(source) $a]} {set r -3}
854 # check for PC_TAG on correct line
856 if {![catch {set z [$twin dump -tag 1.0 end]}]} {
859 if {$v == "PC_TAG"} {
866 if {$v == "STACK_TAG"} {incr r 10}
867 if {$v == "BROWSE_TAG"} {incr r 100}
880 # Desc: Set BP in another file. Tests bp and cache functions
881 gdbtk_test srcwin-4.1 "set BP in another file" {
882 gdb_immediate "break foo" 1
883 $srcwin goto_func "" foo
885 set name [$statbar.name get]
886 set func [$statbar.func get]
888 # check contents of name and function comboboxes
889 if {$name != "list0.h"} {set r -1}
890 if {$func != "foo"} {set r -2}
892 set twin [$stw test_get twin]
894 # check for BROWSE_TAG and BP image on correct line
896 if {![catch {set z [$twin dump 1.0 end]}]} {
899 if {$v == "BROWSE_TAG"} {
906 if {$v == "STACK_TAG"} {incr r 10}
907 if {$v == "PC_TAG"} {incr r 100}
908 } elseif {$k == "image"} {
922 # clear BP and compare with previous contents. This should succeed,
923 gdb_immediate "clear foo" 1
924 set a [$twin get 1.0 end]
925 if {[string compare $file3(source) $a]} {set r -3}
932 # Desc: Test temporary BP
933 gdbtk_test srcwin-4.2 "temporary BP" {
935 if {[catch {gdb_immediate "tbreak foo" 1} msg]} {
938 set name [$statbar.name get]
939 set func [$statbar.func get]
941 # check contents of name and function comboboxes
942 if {$name != "list0.h"} {set r -1}
943 if {$func != "foo"} {set r -2}
945 set twin [$stw test_get twin]
947 # check for BROWSE_TAG and BP image on correct line
949 if {![catch {set z [$twin dump 1.0 end]}]} {
952 if {$v == "BROWSE_TAG"} {
959 if {$v == "STACK_TAG"} {incr r 10}
960 if {$v == "PC_TAG"} {incr r 100}
961 } elseif {$k == "image"} {
974 gdb_immediate "continue" 1
976 # now check for PC_TAG and no image
978 if {![catch {set z [$twin dump 1.0 end]}]} {
981 if {$v == "PC_TAG"} {
988 if {$v == "STACK_TAG"} {incr r 10}
989 if {$v == "BROWSE_TAG"} {incr r 100}
990 } elseif {$k == "image"} {
1003 # Desc: Test BP balloons
1004 gdbtk_test srcwin-4.3 "BP Balloons" {
1005 # move pointer out of the way
1008 gdb_immediate "break 10" 1
1009 gdb_immediate "tbreak 10" 1
1011 set twin [$stw test_get twin]
1013 # check for BROWSE_TAG and BP image on correct line
1015 if {![catch {set z [$twin dump 1.0 end]}]} {
1016 foreach {k v i} $z {
1017 if {$k == "tagon"} {
1018 if {$v == "PC_TAG"} {
1025 if {$v == "STACK_TAG"} {incr r 10}
1026 if {$v == "BROWSE_TAG"} {incr r 100}
1027 } elseif {$k == "image"} {
1030 # we found the bp image, now we will test the bp balloon messages
1031 set balloon [winfo toplevel [namespace tail $srcwin]].__balloon
1032 # shouldn't be mapped yet
1033 if {[winfo ismapped $balloon]} {
1037 move_mouse_to $twin [$twin bbox $i]
1038 #wait a second for the balloon message to appear
1040 if {![winfo ismapped $balloon]} {
1044 # read the contents of the balloon and parse it into lines
1045 set a [split [$balloon.label cget -text] \n]
1047 # foreach line parse it and check the type and make sure it is enabled
1049 if {[lindex $line 0] == "breakpoint"} {continue}
1051 set enabled [lindex $line 0]
1052 set bptype [lindex $line 2]
1055 if {$bptype != "donttouch"} {set r -1000}
1058 if {$bptype != "delete"} {set r -2000}
1074 #ManagedWin::open DebugWin
1077 # Desc: Click on line to set BP
1078 gdbtk_test srcwin-4.4 "Click on line to set BP" {
1081 # click mouse button 1 at index 20.1
1082 if {![click $twin [$twin bbox 20.1] 1]} {
1083 set r "Click failed on line 20.1"
1086 # now look for BP at line 20
1087 foreach bpnum [gdb_get_breakpoint_list] {
1088 set bpinfo [gdb_get_breakpoint_info $bpnum]
1089 lassign $bpinfo file func line pc type enabled disposition \
1090 ignore_count commands cond thread hit_count
1091 set file [lindex [file split $file] end]
1092 if {$file == "list0.h"} {
1093 if {$line == "20"} {
1094 if {$enabled == "1"} {incr r}
1095 if {$func == "foo"} {incr r}
1096 if {$type == "breakpoint"} {incr r}
1097 if {$disposition == "donttouch"} {incr r}
1107 # Desc: Continue till here popup
1108 gdbtk_test srcwin-4.5 "Continue till here popup" {
1109 set twin [$stw test_get twin]
1111 # Get coordinates of line 16
1112 set b [$twin bbox 16.1]
1113 set y [expr {[lindex $b 1] + ([lindex $b 3] / 2)}]
1116 $stw continue_to_here $twin $y
1118 # Where is the PC_TAG?
1120 set tags [$twin tag ranges PC_TAG]
1121 foreach {start end} $tags {
1122 lappend pcs [expr {int($start)}]
1125 # Where are breakpoints?
1127 set imgs [$twin dump -image 1.0 end]
1128 foreach {foo bar line} $imgs {
1135 # 5.1 balloon variables
1137 # Desc: variable balloon test
1138 # continues to BP at line 20 and checks to see that value was updated
1139 gdbtk_test srcwin-5.1 "variable balloon test" {
1140 # move pointer out of the way
1143 set twin [$stw test_get twin]
1145 # move pointer to variable "x" and check balloon
1146 set index [string first "x++" [$twin get 20.0 20.end]]
1147 move_mouse_to $twin [$twin bbox 20.$index]
1149 if {[winfo ismapped $balloon]} {
1150 if {![string compare "x=9" [$balloon.label cget -text]]} {incr r}
1151 gdb_immediate "continue" 1
1153 if {![string compare "x=13" [$balloon.label cget -text]]} {incr r}
1161 # 6.1 mixed mode disassembly of include file
1163 # Desc: Some versions of GDBtk can't do mixed-mode disassembly of a function
1164 # that is in an include file. PR# mi/1101
1166 gdbtk_test srcwin-6.1 "mixed mode disassembly of include file (mi/1101)" {
1168 $srcwin mode "" MIXED
1170 # check contents of name and function comboboxes
1171 set name [$statbar.name get]
1172 set func [$statbar.func get]
1173 if {$name != "list0.h"} {set r -1}
1174 if {$func != "foo"} {set r -2}
1176 # check contents of source window
1177 set twin [$stw test_get twin]
1178 set text [$twin get 1.0 end]
1179 # Is it correct? I don't know. Guess we look for some pieces of source...
1180 if {[string first "static void" $text] != -1 &&
1181 [string first "foo (x)" $text] != -1 &&
1182 [string first "bar (x++);" $text] != -1} {