GDB tests for Go language support: remove unnecessary first breakpoint
authorAndreas Arnez <arnez@linux.vnet.ibm.com>
Thu, 16 Apr 2015 11:03:47 +0000 (13:03 +0200)
committerAndreas Krebbel <krebbel@linux.vnet.ibm.com>
Thu, 16 Apr 2015 11:03:47 +0000 (13:03 +0200)
On s390x targets some of the Go test cases fail because the first
breakpoint happens to be at the same spot as the breakpoint at
main.main.  When such a test case tries to continue to the first
breakpoint, the program runs until the end instead, and the test fails
like this:

FAIL: gdb.go/handcall.exp: Going to first breakpoint (the program exited)

This patch removes all the handling related to the first breakpoint in
those cases.  After applying the patch, the tests run successfully on
s390x.

gdb/testsuite/ChangeLog:

* gdb.go/handcall.exp: Remove all logic related to the first
breakpoint and rely on go_runto_main instead.
* gdb.go/strings.exp: Likewise.
* gdb.go/unsafe.exp: Likewise.
* gdb.go/hello.exp: Likewise.  Also rename the remaining
breakpoint marker to "breakpoint 1".
* gdb.go/handcall.go: Remove comment "set breakpoint 1 here".
* gdb.go/strings.go: Likewise.
* gdb.go/unsafe.go: Likewise.
* gdb.go/hello.go: Likewise.  Also remove the second occurrence of
"set breakpoint 2 here" and rename the remaining breakpoint marker
to "breakpoint 1".

gdb/testsuite/ChangeLog
gdb/testsuite/gdb.go/handcall.exp
gdb/testsuite/gdb.go/handcall.go
gdb/testsuite/gdb.go/hello.exp
gdb/testsuite/gdb.go/hello.go
gdb/testsuite/gdb.go/strings.exp
gdb/testsuite/gdb.go/strings.go
gdb/testsuite/gdb.go/unsafe.exp
gdb/testsuite/gdb.go/unsafe.go

index 91fd9a917ac3a2ebcead3eb2e5c0947066e17691..55a593a58dca581788349726675394fce9fd4be7 100644 (file)
@@ -1,3 +1,18 @@
+2015-04-16  Andreas Arnez  <arnez@linux.vnet.ibm.com>
+
+       * gdb.go/handcall.exp: Remove all logic related to the first
+       breakpoint and rely on go_runto_main instead.
+       * gdb.go/strings.exp: Likewise.
+       * gdb.go/unsafe.exp: Likewise.
+       * gdb.go/hello.exp: Likewise.  Also rename the remaining
+       breakpoint marker to "breakpoint 1".
+       * gdb.go/handcall.go: Remove comment "set breakpoint 1 here".
+       * gdb.go/strings.go: Likewise.
+       * gdb.go/unsafe.go: Likewise.
+       * gdb.go/hello.go: Likewise.  Also remove the second occurrence of
+       "set breakpoint 2 here" and rename the remaining breakpoint marker
+       to "breakpoint 1".
+
 2015-04-15  Simon Marchi  <simon.marchi@ericsson.com>
 
        * gdb.python/py-framefilter.py (ErrorFilter.filter): Use map function
index 44c03c47fe13718ff3d2eef31d988657a649b8c1..b57535ab576bb4dd876c528443c3563d4fbd8d1a 100644 (file)
@@ -27,18 +27,10 @@ if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} {debug go}] } {
     return -1
 }
 
-set bp_location1 [gdb_get_line_number "set breakpoint 1 here"]
-
 if { [go_runto_main] < 0 } {
     untested $testfile
     return -1
 }
 
-if { [gdb_breakpoint ${srcfile}:${bp_location1}] } {
-    pass "setting breakpoint 1"
-}
-
-gdb_test "cont" "Breakpoint .*:${bp_location1}.*" "Going to first breakpoint"
-
 gdb_test "print add (1, 2)" " = 3"
 gdb_test "print main.add (1, 2)" " = 3"
index f32b5e9a47307cef75abb3ae77908b13a5398a80..c09d997f1488511461242366b7664d479cf7c523 100644 (file)
@@ -11,5 +11,5 @@ func sub (a,b int) (int) {
 var v_int int
 
 func main () {
-  v_int = 42 // set breakpoint 1 here
+  v_int = 42
 }
index 577d9a01d507eccd0edb3f3341b0d9ae57c314e5..8d7391948f04dcdc9724f742052bc1a3c8097d16 100644 (file)
@@ -28,19 +28,12 @@ if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} {debug go}] } {
 }
 
 set bp_location1 [gdb_get_line_number "set breakpoint 1 here"]
-set bp_location2 [gdb_get_line_number "set breakpoint 2 here"]
 
 if { [go_runto_main] < 0 } {
     untested $testfile
     return -1
 }
 
-if { [gdb_breakpoint ${srcfile}:${bp_location1}] } {
-    pass "setting breakpoint 1"
-}
-
-gdb_test "cont" "Breakpoint .*:${bp_location1}.*" "Going to first breakpoint"
-
 # This used to print "", i.e., the local "st" initialized as "".
 setup_xfail "*-*-*"
 
@@ -48,11 +41,11 @@ gdb_test "print st" \
     ".* = $hex \"\"" \
     "Starting string check"
 
-if { [gdb_breakpoint ${srcfile}:${bp_location2}] } {
-    pass "setting breakpoint 2"
+if { [gdb_breakpoint ${srcfile}:${bp_location1}] } {
+    pass "setting breakpoint 1"
 }
 
-gdb_test "cont" "Breakpoint .*:${bp_location2}.*" "Going to second breakpoint"
+gdb_test "cont" "Breakpoint .*:${bp_location1}.*" "Going to first breakpoint"
 
 gdb_test "print st" \
     ".* = $hex \"Hello, world!\"" \
index 6e561129cdc6798291049d68e66045da9abe6f64..17b1d4ac1fd750ed71ccbe8b0a2f5526b03e1fde 100644 (file)
@@ -5,8 +5,8 @@ import "fmt"
 var myst = "Shall we?"
 
 func main () {
-  fmt.Println ("Before assignment") // set breakpoint 1 here
+  fmt.Println ("Before assignment")
   st := "Hello, world!" // this intentionally shadows the global "st"
-  fmt.Println (st) // set breakpoint 2 here
-  fmt.Println (myst) // set breakpoint 2 here
+  fmt.Println (st) // set breakpoint 1 here
+  fmt.Println (myst)
 }
index 9274a5403d34cd0a1418f430998b8c33f53158e3..246d7ebd9005a9d8315c68023bee4eccbc605279 100644 (file)
@@ -25,17 +25,9 @@ if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} {debug go}] } {
     return -1
 }
 
-set bp_location1 [gdb_get_line_number "set breakpoint 1 here"]
-
 if { [go_runto_main] < 0 } {
     untested $testfile
     return -1
 }
 
-if { [gdb_breakpoint ${srcfile}:${bp_location1}] } {
-    pass "setting breakpoint 1"
-}
-
-gdb_test "cont" "Breakpoint .*:${bp_location1}.*" "Going to first breakpoint"
-
 gdb_test {print "abc" + "def"} {.* = "abcdef"}
index fc62e396427d8119f81caa7d5c4459a91bf7831a..c80f0815f591284f7bec1a69775bc046488c465a 100644 (file)
@@ -5,6 +5,6 @@ import "fmt"
 var v_string string = "foo"
 
 func main () {
-  fmt.Println ("hello") // set breakpoint 1 here
+  fmt.Println ("hello")
   fmt.Printf ("%s\n", v_string)
 }
index 6017dcb7ae9f7d2cd11501f9d524c9c187bbc412..a631f85402be3283ebb6d25260a12fec302cbe29 100644 (file)
@@ -27,17 +27,9 @@ if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} {debug go}] } {
     return -1
 }
 
-set bp_location1 [gdb_get_line_number "set breakpoint 1 here"]
-
 if { [go_runto_main] < 0 } {
     untested $testfile
     return -1
 }
 
-if { [gdb_breakpoint ${srcfile}:${bp_location1}] } {
-    pass "setting breakpoint 1"
-}
-
-gdb_test "cont" "Breakpoint .*:${bp_location1}.*" "Going to first breakpoint"
-
 gdb_test "print unsafe.Sizeof(42)" ".* = 4"
index 95318bd6d7878200c21ce42c9b2b633865b47543..ac8a6f679ca2d0cabb0e6d1a1c15ff4993e5170a 100644 (file)
@@ -6,6 +6,6 @@ import ("fmt"
 var mystring = "Shall we?"
 
 func main () {
-  fmt.Printf ("%d\n", unsafe.Sizeof (42)) // set breakpoint 1 here
+  fmt.Printf ("%d\n", unsafe.Sizeof (42))
   fmt.Printf ("%d\n", unsafe.Sizeof (mystring))
 }
This page took 0.033742 seconds and 4 git commands to generate.