From b845066654fb6cf4ec1ffb9724e035364286924c Mon Sep 17 00:00:00 2001 From: Martin Hunt Date: Sat, 30 Jan 1999 02:56:04 +0000 Subject: [PATCH] 1999-01-29 Martin Hunt * srcwin.test (click): New function that generates an event at a location. (srcwin-4.4): New test. Simulate a click on a line and check for breakpoint set. (srcwin-4.5): New test. Right-click on a line and select "Continue to Here" from popup. * srcwin.exp: Source srcwin3.test, which will test source window assembly debugging on executables built without "-g". --- gdb/testsuite/gdb.gdbtk/ChangeLog-gdbtk | 53 ++++-------------- gdb/testsuite/gdb.gdbtk/srcwin.test | 97 +++++++++++++++++++++++++++++++-- 2 files changed, 104 insertions(+), 46 deletions(-) diff --git a/gdb/testsuite/gdb.gdbtk/ChangeLog-gdbtk b/gdb/testsuite/gdb.gdbtk/ChangeLog-gdbtk index f8fdaa5..f11cfb4 100644 --- a/gdb/testsuite/gdb.gdbtk/ChangeLog-gdbtk +++ b/gdb/testsuite/gdb.gdbtk/ChangeLog-gdbtk @@ -1,13 +1,16 @@ -Fri Jan 29 06:32:16 1999 Keith Seitz - - * gdb.gdbtk/cpp_variable.test (cpp_variable-1.1): Fix - function name error. - - * gdb.gdbtk/cpp_variable.h (class VC): Fix compiler warning. - 1999-01-29 Martin Hunt - * srcwin.test(srcwin-4.3) Change bytype field to 3. + * srcwin.test (click): New function that generates an event + at a location. + (srcwin-4.4): New test. Simulate a click on a line and + check for breakpoint set. + (srcwin-4.5): New test. Right-click on a line and select "Continue + to Here" from popup. + + * srcwin.exp: Source srcwin3.test, which will test source window + assembly debugging on executables built without "-g". + +1999-01-29 Martin Hunt * srcwin.exp: Add srcwin2.test, which are basically the same tests as srcwin.test, but run with a missing source file. @@ -18,40 +21,6 @@ Fri Jan 29 06:32:16 1999 Keith Seitz testing BP balloons, variable balloons, and mixed-mode disassembly of include files. -Wed Dec 30 08:52:58 1998 Keith Seitz - - * gdb.gdbtk/{console.exp, browser.exp}: If no DISPLAY is set, - skip the tests. - -1998-09-29 Keith Seitz - - * gdb.gdbtk/browser.test: Fix tests which incorrectly assume - that gdb knows _exactly_ which files belong to the user - and which come from libraries. - -Fri Jul 24 14:57:19 1998 Keith Seitz - - * gdb.gdbtk/Makefile.in: Add new example program "stack". - * gdb.gdbtk/browser.test,browser.exp: Add browser window - tests. - * gdb.gdbtk/stack1.c,stack2.c: Test case for browser window. - -Sun Jun 28 22:34:34 1998 Martin M. Hunt - - * gdb.gdbtk/simple.c (main): Make main return an - int so compiler will stop complaining. - -Fri Jun 26 14:27:13 1998 Keith Seitz - - * lib/gdb.exp (gdbtk_start): Add startup for gdbtk. - - * configure.in: Add options for gdbtk testsuite. - - * configure: Regenerate. - - * gdb.gdbtk: New directory to hold gdbtk tests. - - * gdb.gdbtk/console.{exp, test}: New console window tests. Local Variables: mode: change-log diff --git a/gdb/testsuite/gdb.gdbtk/srcwin.test b/gdb/testsuite/gdb.gdbtk/srcwin.test index fb97935..068491a 100644 --- a/gdb/testsuite/gdb.gdbtk/srcwin.test +++ b/gdb/testsuite/gdb.gdbtk/srcwin.test @@ -44,6 +44,18 @@ proc move_mouse_to {win bbox} { } } +proc click {win bbox event} { + move_mouse_to $win $bbox + update + set x [expr [lindex $bbox 0] + [lindex $bbox 2] / 2] + set y [expr [lindex $bbox 1] + [lindex $bbox 3] / 2] + + if {[catch {event generate $win $event -x $x -y $y} result]} { + return 0 + } + return 1 +} + ##### ##### # # @@ -688,7 +700,6 @@ gdbtk_test srcwin-3.4 "stack up (4)" { if {$i == "12.2"} { incr r } else { - dbug X $i incr r 5 } } @@ -863,7 +874,7 @@ gdbtk_test srcwin-3.8 "stack down when at bottom" { set r } {1} -# 4.1 bp, multiple, balloon, etc +# 4 - BREAKPOINTS # Test: srcwin-4.1 # Desc: Set BP in another file. Tests bp and cache functions @@ -1060,9 +1071,87 @@ gdbtk_test srcwin-4.3 "BP Balloons" { set r } {2} +#ManagedWin::open DebugWin + +# Test: srcwin-4.4 +# Desc: Click on line to set BP +gdbtk_test srcwin-4.4 "Click on line to set BP" { + set r 0 + + # click mouse button 1 at index 14.1 + if {![click $twin [$twin bbox 14.1] ]} {set r -100} + + # now look for BP at line 14 + foreach bpnum [gdb_get_breakpoint_list] { + set bpinfo [gdb_get_breakpoint_info $bpnum] + lassign $bpinfo file func line pc type enabled disposition \ + ignore_count commands cond thread hit_count + set file [lindex [file split $file] end] + if {$file == "list0.h"} { + if {$line == "14"} { + if {$enabled == "1"} {incr r} + if {$func == "foo"} {incr r} + if {$type == "breakpoint"} {incr r} + if {$disposition == "donttouch"} {incr r} + } + } + } + set r +} {4} + + +# Test: srcwin-4.5 +# Desc: Continue till here popup +gdbtk_test srcwin-4.4 "Continue till here popup" { + set r + set twin [$stw test_get twin] + + # click mouse button 1 at index 12.1 + set b [$twin bbox 12.1] + if {![click $twin $b ]} {set r -100} + + # Hack. Just release the botton 10 pixels to the right and below + # where the press was. This should select the first entry in the + # popup menu, "Continue to Here". This should be made more robust. + set x [expr [lindex $b 0] + [lindex $b 2] / 2 + 10] + set y [expr [lindex $b 1] + [lindex $b 3] / 2 + 10] + if {![click $twin [list $x $y 0 0] ]} {set r -200} + + # check for PC_TAG on the correct line + if {$r == 0} { + if {![catch {set z [$twin dump 1.0 end]}]} { + foreach {k v i} $z { + if {$k == "tagon"} { + if {$v == "PC_TAG"} { + if {$i == "12.2"} { + incr r + } else { + incr r 5 + } + } + if {$v == "STACK_TAG"} {incr r 10} + if {$v == "BROWSE_TAG"} {incr r 100} + } elseif {$k == "image"} { + switch $i { + 10.0 {incr r} + 12.0 {incr r} + 14.0 {incr r} + default {incr r 1000} + } + } + } + } else { + set r -4 + } + } + # should have seen on PC_TAG at line 12, plus BP images at 10.0, 12.0 and 14.0 + set r +} {4} + # 5.1 balloon variables # Test: srcwin-5.1 # Desc: variable balloon test +# continues to BP at line 14 and checks to see that value was updated gdbtk_test srcwin-5.1 "variable balloon test" { # move pointer out of the way warp_pointer . 0 0 @@ -1074,9 +1163,9 @@ gdbtk_test srcwin-5.1 "variable balloon test" { move_mouse_to $twin [$twin bbox 10.$index] sleep 1 if {[winfo ismapped $balloon]} { - if {![string compare "x=2" [$balloon.label cget -text]]} {incr r} + if {![string compare "x=6" [$balloon.label cget -text]]} {incr r} gdb_immediate "continue" 1 - if {![string compare "x=4" [$balloon.label cget -text]]} {incr r} + if {![string compare "x=8" [$balloon.label cget -text]]} {incr r} } else { set r -1 } -- 2.7.4