From patchwork Tue Apr 14 15:07:53 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Arnez X-Patchwork-Id: 6216 Received: (qmail 53181 invoked by alias); 14 Apr 2015 15:08:01 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 52835 invoked by uid 89); 14 Apr 2015 15:08:00 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.7 required=5.0 tests=AWL, BAYES_00, KAM_LAZY_DOMAIN_SECURITY, T_RP_MATCHES_RCVD autolearn=no version=3.3.2 X-HELO: e06smtp12.uk.ibm.com Received: from e06smtp12.uk.ibm.com (HELO e06smtp12.uk.ibm.com) (195.75.94.108) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Tue, 14 Apr 2015 15:07:59 +0000 Received: from /spool/local by e06smtp12.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 14 Apr 2015 16:07:55 +0100 Received: from d06dlp03.portsmouth.uk.ibm.com (9.149.20.15) by e06smtp12.uk.ibm.com (192.168.101.142) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 14 Apr 2015 16:07:55 +0100 Received: from b06cxnps4076.portsmouth.uk.ibm.com (d06relay13.portsmouth.uk.ibm.com [9.149.109.198]) by d06dlp03.portsmouth.uk.ibm.com (Postfix) with ESMTP id 405051B08067 for ; Tue, 14 Apr 2015 16:08:28 +0100 (BST) Received: from d06av09.portsmouth.uk.ibm.com (d06av09.portsmouth.uk.ibm.com [9.149.37.250]) by b06cxnps4076.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id t3EF7swV8454586 for ; Tue, 14 Apr 2015 15:07:54 GMT Received: from d06av09.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av09.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id t3EF7siU014315 for ; Tue, 14 Apr 2015 09:07:54 -0600 Received: from br87z6lw.de.ibm.com (dyn-9-152-212-115.boeblingen.de.ibm.com [9.152.212.115]) by d06av09.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id t3EF7ruM014295; Tue, 14 Apr 2015 09:07:53 -0600 From: Andreas Arnez To: Doug Evans Cc: gdb-patches@sourceware.org, Ulrich Weigand Subject: Re: [PATCH] GDB tests for Go language support: remove unnecessary first breakpoint References: <87twwyshi2.fsf@br87z6lw.de.ibm.com> <21804.9427.337377.896395@ruffy2.mtv.corp.google.com> Date: Tue, 14 Apr 2015 17:07:53 +0200 In-Reply-To: <21804.9427.337377.896395@ruffy2.mtv.corp.google.com> (Doug Evans's message of "Mon, 13 Apr 2015 13:19:31 -0700") Message-ID: <87h9sisq7q.fsf@br87z6lw.de.ibm.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux) MIME-Version: 1.0 X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 15041415-0009-0000-0000-000003CFC17D X-IsSubscribed: yes On Mon, Apr 13 2015, Doug Evans wrote: > Hi. > Ok with one nit fixed. > > > diff --git a/gdb/testsuite/gdb.go/hello.exp b/gdb/testsuite/gdb.go/hello.exp > > index 577d9a0..898a04a 100644 > > --- a/gdb/testsuite/gdb.go/hello.exp > > +++ b/gdb/testsuite/gdb.go/hello.exp > > @@ -27,7 +27,6 @@ if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} {debug go}] } { > > return -1 > > } > > > > -set bp_location1 [gdb_get_line_number "set breakpoint 1 here"] > > set bp_location2 [gdb_get_line_number "set breakpoint 2 here"] > > Can you rename breakpoint 2 to 1? > I see there's two appearances of "set breakpoint 2 here" in hello.go. > Just delete the second copy. Sure. For consistency I also renamed bp_location2 to bp_location1 and likewise adjusted the message "going to second breakpoint". Here's the updated patch. -- >8 -- Subject: [PATCH v2] GDB tests for Go language support: remove unnecessary first breakpoint 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/gdb.go/handcall.exp | 8 -------- gdb/testsuite/gdb.go/handcall.go | 2 +- gdb/testsuite/gdb.go/hello.exp | 13 +++---------- gdb/testsuite/gdb.go/hello.go | 6 +++--- gdb/testsuite/gdb.go/strings.exp | 8 -------- gdb/testsuite/gdb.go/strings.go | 2 +- gdb/testsuite/gdb.go/unsafe.exp | 8 -------- gdb/testsuite/gdb.go/unsafe.go | 2 +- 8 files changed, 9 insertions(+), 40 deletions(-) diff --git a/gdb/testsuite/gdb.go/handcall.exp b/gdb/testsuite/gdb.go/handcall.exp index 44c03c4..b57535a 100644 --- a/gdb/testsuite/gdb.go/handcall.exp +++ b/gdb/testsuite/gdb.go/handcall.exp @@ -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" diff --git a/gdb/testsuite/gdb.go/handcall.go b/gdb/testsuite/gdb.go/handcall.go index f32b5e9..c09d997 100644 --- a/gdb/testsuite/gdb.go/handcall.go +++ b/gdb/testsuite/gdb.go/handcall.go @@ -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 } diff --git a/gdb/testsuite/gdb.go/hello.exp b/gdb/testsuite/gdb.go/hello.exp index 577d9a0..8d73919 100644 --- a/gdb/testsuite/gdb.go/hello.exp +++ b/gdb/testsuite/gdb.go/hello.exp @@ -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!\"" \ diff --git a/gdb/testsuite/gdb.go/hello.go b/gdb/testsuite/gdb.go/hello.go index 6e56112..17b1d4a 100644 --- a/gdb/testsuite/gdb.go/hello.go +++ b/gdb/testsuite/gdb.go/hello.go @@ -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) } diff --git a/gdb/testsuite/gdb.go/strings.exp b/gdb/testsuite/gdb.go/strings.exp index 9274a54..246d7eb 100644 --- a/gdb/testsuite/gdb.go/strings.exp +++ b/gdb/testsuite/gdb.go/strings.exp @@ -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"} diff --git a/gdb/testsuite/gdb.go/strings.go b/gdb/testsuite/gdb.go/strings.go index fc62e39..c80f081 100644 --- a/gdb/testsuite/gdb.go/strings.go +++ b/gdb/testsuite/gdb.go/strings.go @@ -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) } diff --git a/gdb/testsuite/gdb.go/unsafe.exp b/gdb/testsuite/gdb.go/unsafe.exp index 6017dcb..a631f85 100644 --- a/gdb/testsuite/gdb.go/unsafe.exp +++ b/gdb/testsuite/gdb.go/unsafe.exp @@ -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" diff --git a/gdb/testsuite/gdb.go/unsafe.go b/gdb/testsuite/gdb.go/unsafe.go index 95318bd..ac8a6f6 100644 --- a/gdb/testsuite/gdb.go/unsafe.go +++ b/gdb/testsuite/gdb.go/unsafe.go @@ -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)) }