OSDN Git Service

c3edd1302b17fc374039e4a746c37f4c28e39423
[pf3gnuchains/pf3gnuchains4x.git] / gdb / testsuite / gdb.gdbtk / srcwin3.test
1 #   Copyright (C) 1999, 2001 Red Hat, Inc.
2 #
3 # This program is free software; you can redistribute it and/or modify
4 # it under the terms of the GNU General Public License as published by
5 # the Free Software Foundation; either version 2 of the License, or
6 # (at your option) any later version.
7 #
8 # This program is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11 # GNU General Public License for more details.
12 #
13 # You should have received a copy of the GNU General Public License
14 # along with this program; if not, write to the Free Software
15 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
16
17 # Please email any bugs, comments, and/or additions to this file to:
18 # bug-gdb@prep.ai.mit.edu
19
20 # This file was written by Martin Hunt (hunt@cygnus.com)
21
22 ###########################################################
23 # same as srcwin.test, except test debugging executables  #
24 # build without "-g"                                      #
25 ###########################################################
26
27 # Read in the standard defs file
28
29 if {![gdbtk_read_defs]} {
30   break
31 }
32
33 global objdir srcdir
34
35 #####                 #####
36 #                         #
37 #  SECTION 1: Mode Tests  #
38 #                         #
39 #####                 #####
40
41 # Load the test executable
42 if {$tcl_platform(platform) == "windows"} {
43   set file [file join $objdir list.exe]
44 } else {
45   set file [file join $objdir list]
46 }
47
48 # This isn't a test case, since if this fails, we're hosed.
49 if {[catch {gdb_cmd "file $file" 1} t]} {
50   # an error occured loading the file
51   gdbtk_test_error "loading \"$file\": $t"
52 }
53
54 set srcwin [ManagedWin::open SrcWin]
55 set stw [$srcwin test_get twin]
56 set twin [$stw test_get twin]
57 set statbar [$srcwin test_get _statbar]
58
59 # get things started
60 gdb_cmd "break main"
61 run_executable
62
63 # Test: srcwin3-1.1
64 # Desc: Check for something in source window
65 gdbtk_test srcwin3-1.1 "source window has contents" {
66   set r 0
67   set source(main) [$twin get 1.0 end]
68   if {$source(main) == ""} {set r -1}
69   if {[$statbar.mode get] != "ASSEMBLY"} {set r -2}
70   set r
71 } {0}
72
73 # Test: srcwin3-1.2
74 # Desc: source->assembly mode change
75 gdbtk_test srcwin3-1.2 "source->assembly mode change" {
76   set r 0
77   $srcwin mode "" ASSEMBLY
78   set twin [$stw test_get twin]
79   if {$source(main) != [$twin get 1.0 end]} {set r -1}
80   if {[$statbar.mode get] != "ASSEMBLY"} {set r -2}
81   set r
82 } {0}
83
84 # Test: srcwin3-1.3
85 # Desc: assembly->mixed mode change
86 gdbtk_test srcwin3-1.3 "assembly->mixed mode change" {
87   set r 0
88   $srcwin mode "" MIXED
89   set twin [$stw test_get twin]
90   if {$source(main) != [$twin get 1.0 end]} {set r -1}
91   if {[$statbar.mode get] != "MIXED"} {set r -2}
92   set r
93 } {0}
94
95 # Test: srcwin3-1.4
96 # Desc: mixed->src+asm mode change
97 gdbtk_test srcwin3-1.4 "mixed->src+asm mode change" {
98   set r 0
99   # mode change may fail if fallover to ASSEMBLY fails
100   if {[catch {$srcwin mode "" SRC+ASM}]} { set r -5 }
101   set twin [$stw test_get twin]
102   if {[$twin get 1.0 end] != $source(main)} {set r -1}
103   if {[$statbar.mode get] != "ASSEMBLY"} {set r -2}
104   set r
105 } {0}
106
107 # Test: srcwin3-1.5
108 # Desc: src+asm->source mode change
109 gdbtk_test srcwin3-1.5 "src+asm->source mode change" {
110   set r 0
111   $srcwin mode "" SOURCE
112   set twin [$stw test_get twin]
113   if {[$stw test_get bwin] != ""} {set r -2}
114   if {[$twin get 1.0 end] != $source(main)} {set r -1}
115   if {[$statbar.mode get] != "ASSEMBLY"} {set r -3}
116   set r
117 } {0}
118
119 # Test: srcwin3-1.6
120 # Desc: source->mixed mode change
121 gdbtk_test srcwin3-1.6 "source->mixed mode change" {
122   set r 0
123   $srcwin mode "" MIXED
124   set twin [$stw test_get twin]
125   if {[$twin get 1.0 end] != $source(main)} {set r -1}
126   if {[$statbar.mode get] != "MIXED"} {set r -2}
127   set r
128 } {0}
129
130 # Test: srcwin3-1.7
131 # Desc: mixed->source mode change
132 gdbtk_test srcwin3-1.7 "mixed->source mode change" {
133   set r 0
134   $srcwin mode "" SOURCE
135   set twin [$stw test_get twin]
136   if {[$twin get 1.0 end] != $source(main)} {set r -1}
137   if {[$statbar.mode get] != "ASSEMBLY"} {set r -2}
138   set r
139 } {0}
140
141 # Test: srcwin3-1.8
142 # Desc: source->src+asm mode change
143 gdbtk_test srcwin3-1.8 "source->src+asm mode change" {
144   set r 0
145   # mode change may fail if fallover to ASSEMBLY fails
146   if {[catch {$srcwin mode "" SRC+ASM}]} { set r -5 }
147   set twin [$stw test_get twin]
148   set bwin [$stw test_get bwin]
149   if {[$twin get 1.0 end] != $source(main)} {set r -1}
150   if {$bwin != ""} {set r -2}
151   if {[$statbar.mode get] != "ASSEMBLY"} {set r -3}
152   set r
153 } {0}
154
155 # Test: srcwin3-1.9
156 # Desc: src+asm->assembly mode change
157 gdbtk_test srcwin3-1.9 "src+asm->assembly mode change" {
158   set r 0
159   $srcwin mode "" ASSEMBLY
160   set twin [$stw test_get twin]
161   if {[$twin get 1.0 end] != $source(main)} {set r -1}
162   if {[$statbar.mode get] != "ASSEMBLY"} {set r -2}
163   set r
164 } {0}
165
166 # Test: srcwin3-1.10
167 # Desc: assembly->src+asm mode change
168 gdbtk_test srcwin3-1.10 "assembly->src+asm mode change" {
169   set r 0
170   # mode change may fail if fallover to ASSEMBLY fails
171   if {[catch {$srcwin mode "" SRC+ASM}]} { set r -5 }
172   set twin [$stw test_get twin]
173   set bwin [$stw test_get bwin]
174   if {[$twin get 1.0 end] != $source(main)} {set r -1}
175   if {$bwin != ""} {set r -2}
176   if {[$statbar.mode get] != "ASSEMBLY"} {set r -3}
177   set r
178 } {0}
179
180 # Test: srcwin3-1.11
181 # Desc: src+asm->mixed mode change
182 gdbtk_test srcwin3-1.11 "src+asm->mixed mode change" {
183   set r 0
184   $srcwin mode "" MIXED
185   set twin [$stw test_get twin]
186   if {[$twin get 1.0 end] != $source(main)} {set r -1}
187   if {[$statbar.mode get] != "MIXED"} {set r -2}
188   set r
189 } {0}
190
191 # Test: srcwin3-1.12
192 # Desc: mixed->assembly mode change
193 gdbtk_test srcwin3-1.12 "mixed->assembly mode change" {
194   set r 0
195   $srcwin mode "" ASSEMBLY
196   set twin [$stw test_get twin]
197   if {[$twin get 1.0 end] != $source(main)} {set r -1}
198   if {[$statbar.mode get] != "ASSEMBLY"} {set r -2}
199   set r
200 } {0}
201
202 # Test: srcwin3-1.13
203 # Desc: assembly->source mode change
204 gdbtk_test srcwin3-1.13 "assembly->source mode change" {
205   set r 0
206   $srcwin mode "" SOURCE
207   set twin [$stw test_get twin]
208   if {[$twin get 1.0 end] != $source(main)} {set r -1}
209   if {[$statbar.mode get] != "ASSEMBLY"} {set r -2}
210   set r
211 } {0}
212
213
214 #####                       #####
215 #                               #
216 #  SECTION 2: Basic Operations  #
217 #                               #
218 #####                       #####
219
220 # Test: srcwin3-2.2
221 # Desc: check contents of function combobox
222 # There won't be any because we have no debug info
223 gdbtk_test srcwin3-2.2 "check contents of function combobox" {
224   set names [$statbar.func listget 0 end]
225   llength $names
226 } {0}
227
228 # Test: srcwin3-2.3
229 # Desc: goto filename - this won't work, but should leave things as they were
230 gdbtk_test srcwin3-2.3 "goto filename" {
231   set func [$srcwin test_get _name 1]
232   $func "" list1.c
233   set twin [$stw test_get twin]
234   string compare $source(main) [$twin get 1.0 end]
235 } {0}
236
237 # Test: srcwin3-2.6
238 # Desc: goto function
239 gdbtk_test srcwin3-2.6 "goto function bar" {
240   $srcwin goto_func "" bar
241   set r 0
242   set twin [$stw test_get twin]
243   set source(bar) [$twin get 1.0 end]
244   
245   if {$source(bar) == $source(main)} {set r -1000}
246
247   # now get a dump of all tags and check that only one line is
248   # marked BROWSE_TAG and no lines are STACK_TAG or PC_TAG.
249
250   # We know that list1.c should have BROWSE_TAG set at index 5.2
251   # for function "bar".  If list1.c is changed or the layout of the source
252   # window is changed, this must be updated.
253   if {![catch {set z [$twin dump -tag 1.0 end]}]} {
254     foreach {k v i} $z {
255       if {$k == "tagon"} {
256         if {$v == "BROWSE_TAG"} {
257           incr r
258         }
259         if {$v == "STACK_TAG"} { incr r 10}
260         if {$v == "PC_TAG"} { incr r 100}
261       }
262     }
263   } else {
264     set r -1
265   }
266
267   if {$r == 1} {
268     # things are OK so far, so just verify the function name is displayed
269     # in the combobox entry field.
270     set names [$statbar.func get]
271     if {[string compare $names "bar"]} {set r -2}
272   }
273   set r
274 } {1}
275
276 # Test: srcwin3-2.7
277 # Desc: goto function "oof". This tests that the correct line is highlighted
278 # with BROWSE_TAG and no other lines are highlighted. It also checks that
279 # the combobox has the correct function name in it.  
280
281 gdbtk_test srcwin3-2.7 "goto function oof" {
282   $srcwin goto_func "" oof
283   set r 0
284
285   set twin [$stw test_get twin]
286   set source(oof) [$twin get 1.0 end]
287   
288   if {$source(bar) == $source(oof)} {set r -1000}
289   if {$source(oof) == $source(main)} {set r -2000}
290
291   # now get a dump of all tags and check that only one line is
292   # marked BROWSE_TAG and no lines are STACK_TAG or PC_TAG.
293
294   if {![catch {set z [$twin dump -tag 1.0 end]}]} {
295     foreach {k v i} $z {
296       if {$k == "tagon"} {
297         if {$v == "BROWSE_TAG"} {
298           incr r
299         }
300         if {$v == "STACK_TAG"} {incr r 10}
301         if {$v == "PC_TAG"} {incr r 100}
302       }
303     }
304   } else {
305     set r -1
306   }
307
308   if {$r == 1} {
309     # things are OK so far, so just verify the function name is displayed
310     # in the combobox entry field.
311     set names [$statbar.func get]
312     if {[string compare $names "oof"]} {set r -2}
313   }
314   set r
315 } {1}
316
317 # Test: srcwin3-2.8
318 # Desc: This test issues a nexti command while browsing oof.
319 # It should jump back to main
320 gdbtk_test srcwin3-2.8 "nexti while browsing" {
321   gdb_immediate "nexti" 1
322   set r 0
323   set name [$statbar.name get]
324   set func [$statbar.func get]
325
326   # check contents of function combobox
327   if {$func != "main"} {set r -2}
328   if {$name != ""} {set r -1}
329
330   # check that correct file is displayed
331   set twin [$stw test_get twin]
332   set a [$twin get 1.0 end]
333   if {[string compare $source(main) $a]} {set r -3}
334
335   # check for PC_TAG
336   if {$r == 0} {
337     if {![catch {set z [$twin dump -tag 1.0 end]}]} {
338       foreach {k v i} $z {
339         if {$k == "tagon"} {
340           if {$v == "PC_TAG"} {
341             incr r
342           }
343           if {$v == "STACK_TAG"} {incr r 10}
344           if {$v == "BROWSE_TAG"} {incr r 100}
345         }
346       }
347     } else {
348       set r -4
349     }
350   }
351   set r
352 } {1}
353
354 # Test: srcwin3-2.11
355 # Desc: This test issues a break and a continue
356 gdbtk_test srcwin3-2.11 "set BP and continue" {
357   gdb_immediate "break oof" 1
358   gdb_immediate "continue" 1
359   set r 0
360   set name [$statbar.name get]
361   set func [$statbar.func get]
362
363   # check contents of name and function comboboxes
364   if {$name != ""} {set r -1}
365   if {$func != "oof"} {set r -2}
366   
367   # check that the correct file is displayed
368   # we must clear the breakpoint first so it doesn't mess up the
369   # comparison...
370   gdb_immediate "clear oof" 1  
371   set twin [$stw test_get twin]
372   set a [$twin get 1.0 end]
373   if {[string compare $source(oof) $a]} {set r -3}
374   
375   # check for PC_TAG
376   if {$r == 0} {
377     if {![catch {set z [$twin dump -tag 1.0 end]}]} {
378       foreach {k v i} $z {
379         if {$k == "tagon"} {
380           if {$v == "PC_TAG"} {
381             incr r
382           }
383           if {$v == "STACK_TAG"} {incr r 10}
384           if {$v == "BROWSE_TAG"} {incr r 100}
385         }
386       }
387     } else {
388       set r -4
389     }
390   }
391   set r
392 } {1}
393
394 #####                       #####
395 #                               #
396 #  SECTION 3: Stack Operations  #
397 #                               #
398 #####                       #####
399
400 # Test: srcwin3-3.1
401 # Desc: This tests "stack up" 
402 gdbtk_test srcwin3-3.1 "stack up (1)" {
403   $srcwin stack up
404   set r 0
405   set name [$statbar.name get]
406   set func [$statbar.func get]
407
408   # check contents of name and function comboboxes
409   if {$name != ""} {set r -1}
410   if {$func != "long_line"} {set r -2}
411
412   # check that the correct file is displayed
413   set twin [$stw test_get twin]
414   set source(long_line) [$twin get 1.0 end]
415   if {![string compare $source(long_line) $source(oof)]} {set r -3}
416   
417   # check for PC_TAG and STACK_TAG on correct lines
418   if {$r == 0} {
419     if {![catch {set z [$twin dump -tag 1.0 end]}]} {
420       foreach {k v i} $z {
421         if {$k == "tagon"} {
422           if {$v == "PC_TAG"} {incr r 5}
423           if {$v == "STACK_TAG"} {incr r}
424           if {$v == "BROWSE_TAG"} {incr r 100}
425         }
426       }
427     } else {
428       set r -4
429     }
430   }
431   set r
432 } {1}
433
434 # Test: srcwin3-3.2
435 # Desc: Another "stack up"  test
436 gdbtk_test srcwin3-3.2 "stack up (2)" {
437   $srcwin stack up
438   set r 0
439   set name [$statbar.name get]
440   set func [$statbar.func get]
441
442   # check contents of name and function comboboxes
443   if {$name != ""} {set r -1}
444   if {$func != "bar"} {set r -2}
445
446   # check that the correct file is displayed
447   set twin [$stw test_get twin]
448   set a [$twin get 1.0 end]
449   if {[string compare $source(bar) $a]} {set r -3}
450   
451   # check for PC_TAG and STACK_TAG on correct lines
452   if {$r == 0} {
453     if {![catch {set z [$twin dump -tag 1.0 end]}]} {
454       foreach {k v i} $z {
455         if {$k == "tagon"} {
456           if {$v == "PC_TAG"} {
457             set r -100
458           }
459           if {$v == "STACK_TAG"} {
460             incr r
461           }
462           if {$v == "BROWSE_TAG"} {incr r 100}
463         }
464       }
465     } else {
466       set r -4
467     }
468   }
469   set r
470 } {1}
471
472 # Test: srcwin3-3.3
473 # Desc: Another "stack up"  test
474 gdbtk_test srcwin3-3.3 "stack up (3)" {
475   $srcwin stack up
476   set r 0
477   set name [$statbar.name get]
478   set func [$statbar.func get]
479
480   # check contents of name and function comboboxes
481   if {$name != ""} {set r -1}
482   if {$func != "foo"} {set r -2}
483
484   # check that the correct file is displayed
485   set twin [$stw test_get twin]
486   set source(foo) [$twin get 1.0 end]
487   if {![string compare $source(foo) $source(bar)]} {set r -3}
488   
489   # check for PC_TAG and STACK_TAG on correct lines
490   if {$r == 0} {
491     if {![catch {set z [$twin dump -tag 1.0 end]}]} {
492       foreach {k v i} $z {
493         if {$k == "tagon"} {
494           if {$v == "STACK_TAG"} {
495             incr r
496           }
497           if {$v == "PC_TAG"} {incr r 10}
498           if {$v == "BROWSE_TAG"} {incr r 100}
499         }
500       }
501     } else {
502       set r -4
503     }
504   }
505   set r
506 } {1}
507
508 # Test: srcwin3-3.4
509 # Desc: Another "stack up"  test
510 gdbtk_test srcwin3-3.4 "stack up (4)" {
511   $srcwin stack up
512   set r 0
513   set name [$statbar.name get]
514   set func [$statbar.func get]
515
516   # check contents of name and function comboboxes
517   if {$name != ""} {set r -1}
518   if {$func != "main"} {set r -2}
519
520   # check that the correct file is displayed
521   set twin [$stw test_get twin]
522   set a [$twin get 1.0 end]
523   if {[string compare $source(main) $a]} {set r -3}
524   
525   # check for STACK_TAG
526   if {$r == 0} {
527     if {![catch {set z [$twin dump -tag 1.0 end]}]} {
528       foreach {k v i} $z {
529         if {$k == "tagon"} {
530           if {$v == "STACK_TAG"} {
531             incr r
532           }
533           if {$v == "PC_TAG"} {incr r 10}
534           if {$v == "BROWSE_TAG"} {incr r 100}
535         }
536       }
537     } else {
538       set r -4
539     }
540   }
541   set r
542 } {1}
543
544 # Disabled for now because there are different correct results.
545 # Test should be rewritten to include those.
546 # Test: srcwin3-3.5
547 # Desc: "stack up" when we are at the top
548 #gdbtk_test srcwin3-3.5 "stack up when at the top" {
549 #  $srcwin stack up
550 #  set r 0
551 #  set name [$statbar.name get]
552 #  set func [$statbar.func get]
553
554   # check contents of name and function comboboxes
555 #  if {$name != ""} {set r -1}
556 #  if {$func != "main"} {set r -2}
557
558   # check that the correct file is displayed
559 #  set twin [$stw test_get twin]
560 #  set a [$twin get 1.0 end]
561 #  if {[string compare $source(main) $a]} {set r -3}
562   
563   # check for STACK_TAG
564 #  if {$r == 0} {
565 #    if {![catch {set z [$twin dump -tag 1.0 end]}]} {
566 #      foreach {k v i} $z {
567 #       if {$k == "tagon"} {
568 #         if {$v == "STACK_TAG"} {
569 #           incr r
570 #         }
571 #         if {$v == "PC_TAG"} {incr r 10}
572 #         if {$v == "BROWSE_TAG"} {incr r 100}
573 #       }
574 #      }
575 #    } else {
576 #      set r -4
577 #    }
578 #  }
579 #  set r
580 #} {1}
581
582 # Test: srcwin3-3.6
583 # Desc: "stack down"  test
584 gdbtk_test srcwin3-3.6 "stack down" {
585   $srcwin stack down
586   set r 0
587   set name [$statbar.name get]
588   set func [$statbar.func get]
589
590   # check contents of name and function comboboxes
591   if {$name != ""} {set r -1}
592   if {$func != "foo"} {set r -2}
593
594   # check that the correct file is displayed
595   set twin [$stw test_get twin]
596   set a [$twin get 1.0 end]
597   if {[string compare $source(foo) $a]} {set r -3}
598   
599   # check for PC_TAG and STACK_TAG on correct lines
600   if {$r == 0} {
601     if {![catch {set z [$twin dump -tag 1.0 end]}]} {
602       foreach {k v i} $z {
603         if {$k == "tagon"} {
604           if {$v == "STACK_TAG"} {
605             incr r
606           }
607           if {$v == "PC_TAG"} {incr r 10}
608           if {$v == "BROWSE_TAG"} {incr r 100}
609         }
610       }
611     } else {
612       set r -4
613     }
614   }
615   set r
616 } {1}
617
618 # Test: srcwin3-3.7
619 # Desc: "stack bottom"  test
620 gdbtk_test srcwin3-3.7 "stack bottom" {
621   $srcwin stack bottom
622   set r 0
623   set name [$statbar.name get]
624   set func [$statbar.func get]
625
626   # check contents of name and function comboboxes
627   if {$name != ""} {set r -1}
628   if {$func != "oof"} {set r -2}
629
630   # check that the correct file is displayed
631   set twin [$stw test_get twin]
632   set a [$twin get 1.0 end]
633   if {[string compare $source(oof) $a]} {set r -3}
634   
635   # check for PC_TAG on correct line
636   if {$r == 0} {
637     if {![catch {set z [$twin dump -tag 1.0 end]}]} {
638       foreach {k v i} $z {
639         if {$k == "tagon"} {
640           if {$v == "PC_TAG"} {
641             incr r
642           }
643           if {$v == "STACK_TAG"} {incr r 10}
644           if {$v == "BROWSE_TAG"} {incr r 100}
645         }
646       }
647     } else {
648       set r -4
649     }
650   }
651   set r
652 } {1}
653
654 # Test: srcwin3-3.8
655 # Desc: "stack down" when at bottom
656 gdbtk_test srcwin3-3.8 "stack down when at bottom" {
657   $srcwin stack down
658   set r 0
659   set name [$statbar.name get]
660   set func [$statbar.func get]
661
662   # check contents of name and function comboboxes
663   if {$name != ""} {set r -1}
664   if {$func != "oof"} {set r -2}
665
666   # check that the correct file is displayed
667   set twin [$stw test_get twin]
668   set a [$twin get 1.0 end]
669   if {[string compare $source(oof) $a]} {set r -3}
670   
671   # check for PC_TAG on correct line
672   if {$r == 0} {
673     if {![catch {set z [$twin dump -tag 1.0 end]}]} {
674       foreach {k v i} $z {
675         if {$k == "tagon"} {
676           if {$v == "PC_TAG"} {
677             incr r
678           }
679           if {$v == "STACK_TAG"} {incr r 10}
680           if {$v == "BROWSE_TAG"} {incr r 100}
681         }
682       }
683     } else {
684       set r -4
685     }
686   }
687   set r
688 } {1}
689
690 # 4.1 bp, multiple, balloon, etc
691
692 # Test: srcwin3-4.1
693 # Desc: Set BP in another file. Tests bp and cache functions
694 gdbtk_test srcwin3-4.1 "set BP in another file" {
695   gdb_immediate "break foo" 1
696   $srcwin goto_func "" foo
697   set r 0
698   set name [$statbar.name get]
699   set func [$statbar.func get]
700
701   # check contents of name and function comboboxes
702   if {$name != ""} {set r -1}
703   if {$func != "foo"} {set r -2}
704
705   set twin [$stw test_get twin]
706   
707   # check for BROWSE_TAG and BP image
708   if {$r == 0} {
709     if {![catch {set z [$twin dump 1.0 end]}]} {
710       foreach {k v i} $z {
711         if {$k == "tagon"} {
712           if {$v == "BROWSE_TAG"} {
713             incr r
714           }
715           if {$v == "STACK_TAG"} {incr r 10}
716           if {$v == "PC_TAG"} {incr r 100}
717         } elseif {$k == "image"} {
718           incr r
719         }
720       }
721     } else {
722       set r -4
723     }
724   }
725   
726   if {$r == 2} {
727     # clear BP and compare with previous contents. This should succeed,
728     gdb_immediate "clear foo" 1
729     set a [$twin get 1.0 end]
730     if {[string compare $source(foo) $a]} {set r -3}
731   }
732   
733   set r
734 } {2}
735
736 # Test: srcwin3-4.2
737 # Desc: Test temporary BP
738 gdbtk_test srcwin3-4.2 "temporary BP" {
739   set r 0
740   if {[catch {gdb_immediate "tbreak foo" 1} msg]} {
741     set r -500
742   }
743   set name [$statbar.name get]
744   set func [$statbar.func get]
745   
746   # check contents of name and function comboboxes
747   if {$name != ""} {set r -1}
748   if {$func != "foo"} {set r -2}
749
750   set twin [$stw test_get twin]
751   
752   # check for BROWSE_TAG and BP image on correct line
753   if {$r == 0} {
754     if {![catch {set z [$twin dump 1.0 end]}]} {
755       foreach {k v i} $z {
756         if {$k == "tagon"} {
757           if {$v == "BROWSE_TAG"} {
758             incr r
759           }
760           if {$v == "STACK_TAG"} {incr r 10}
761           if {$v == "PC_TAG"} {incr r 100}
762         } elseif {$k == "image"} {
763           incr r
764         }
765       }
766     } else {
767       set r -4
768     }
769   }
770   
771   gdb_immediate "continue" 1
772   
773   # now check for PC_TAG and no image
774   if {$r == 2} {
775     if {![catch {set z [$twin dump 1.0 end]}]} {
776       foreach {k v i} $z {
777         if {$k == "tagon"} {
778           if {$v == "PC_TAG"} {
779             incr r
780           }
781           if {$v == "STACK_TAG"} {incr r 10}
782           if {$v == "BROWSE_TAG"} {incr r 100}
783         } elseif {$k == "image"} {
784           set r -200
785         }
786       }
787     } else {
788       set r -4
789     }
790   }
791   
792   set r
793 } {3}
794
795 gdbtk_test_done
796
797 # Local variables:
798 # mode: tcl
799 # change-log-default-name: "ChangeLog-gdbtk"
800 # End: