From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4988 invoked by alias); 29 Oct 2014 22:11:28 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 4973 invoked by uid 89); 29 Oct 2014 22:11:27 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.4 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Wed, 29 Oct 2014 22:11:25 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s9TMBMUW002995 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 29 Oct 2014 18:11:22 -0400 Received: from localhost (dhcp-10-15-16-169.yyz.redhat.com [10.15.16.169]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s9TMBLpH031912 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=NO); Wed, 29 Oct 2014 18:11:22 -0400 From: Sergio Durigan Junior To: Andreas Arnez Cc: gdb-patches@sourceware.org Subject: Re: [PATCH 01/16] Eliminate literal line numbers in so-impl-ld.exp References: <1414597859-12523-1-git-send-email-arnez@linux.vnet.ibm.com> <1414598446-13831-1-git-send-email-arnez@linux.vnet.ibm.com> <87bnoukfql.fsf@redhat.com> <87h9ymag24.fsf@br87z6lw.de.ibm.com> X-URL: http://blog.sergiodj.net Date: Wed, 29 Oct 2014 22:11:00 -0000 In-Reply-To: <87h9ymag24.fsf@br87z6lw.de.ibm.com> (Andreas Arnez's message of "Wed, 29 Oct 2014 19:25:55 +0100") Message-ID: <87tx2mfrw6.fsf@redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-IsSubscribed: yes X-SW-Source: 2014-10/txt/msg00835.txt.bz2 On Wednesday, October 29 2014, Andreas Arnez wrote: > Hi Sergio, > > Thanks for reviewing! Thank you, Andreas! > On Wed, Oct 29 2014, Sergio Durigan Junior wrote: > >> On Wednesday, October 29 2014, Andreas Arnez wrote: >> >> [...] >>> diff --git a/gdb/testsuite/gdb.base/so-impl-ld.exp b/gdb/testsuite/gdb.base/so-impl-ld.exp >>> index 073c3df..03d10a5 100644 >>> --- a/gdb/testsuite/gdb.base/so-impl-ld.exp >>> +++ b/gdb/testsuite/gdb.base/so-impl-ld.exp >>> @@ -61,12 +61,12 @@ gdb_test "next" "21\[ \t\]*result = solib_main .result.;" \ >>> >>> # Verify that we can step into the second shlib call. >>> # >>> -gdb_test "step" "solib_main .arg=10000. at.*${libfile}.c:17.*" \ >>> +gdb_test "step" "solib_main .arg=10000. at.*${libfile}.c:.* HERE .*" \ >>> "step into solib call" >> >> Can't you use ${decimal} here, instead of expecting anything? > > Certainly. > >> >>> # Verify that we can step within the shlib call. >>> # >>> -gdb_test "next" "18\[ \t\]*\}" "step in solib call" >>> +gdb_test "next" "\[0-9\]+\[ \t\]*\}.* STEP .*" "step in solib call" >> >> Same here: ${decimal} is made to replace this \[0-9\]+. > > Good point. Changed both as suggested. Also replaced \[0-9\]+ by > ${decimal} in the patches for dbx.exp, call-ar-st.exp, call-rt-st.exp, > jump.exp, and shlib-call.exp. While reviewing again I also noticed that > I introduced an excess ".*" in front of a regexp in foll-exec.exp and > removed it. > > Note that some regexps are currently enclosed in a brace-quoted group, > where variables are not substituted -- particularly in the various uses > of gdb_test_sequence in call-ar-st.exp. There I still use \[0-9\]+, to > avoid larger modifications to the existing regexps. Yeah, that's good. You patch is a fix needed to run the testcase using a new GCC, so it's better to leave general cleanups for other patches. > Here are the changes I performed based on your suggestion: They seem great now, thanks a lot. I will review the other patches in the series later. > > --- a/gdb/testsuite/gdb.base/call-ar-st.exp > +++ b/gdb/testsuite/gdb.base/call-ar-st.exp > @@ -62,7 +62,7 @@ > > set stop_line [gdb_get_line_number "-tbreak1-"] > gdb_test "tbreak $stop_line" \ > - "Temporary breakpoint \[0-9\]+.*file.*$srcfile, line $stop_line.*" \ > + "Temporary breakpoint ${decimal}.*file.*$srcfile, line $stop_line.*" \ > "tbreakpoint at tbreak1" > > gdb_test continue \ > > --- a/gdb/testsuite/gdb.base/call-rt-st.exp > +++ b/gdb/testsuite/gdb.base/call-rt-st.exp > @@ -74,10 +74,10 @@ > "continue to loop_count" > > gdb_test_multiple "finish" "finish out from loop count" { > - -re "Run till exit from .0 loop_count \\(\\) at.*call-rt-st.c:$stop_line\[ \t\r\n\]+main \\(\\) at.*call-rt-st.c:\[0-9\]+\[ \t\r\n\]+\[0-9\]+\[\t \]+return 0;.*-finish1-.*$gdb_prompt $" { > + -re "Run till exit from .0 loop_count \\(\\) at.*call-rt-st.c:$stop_line\[ \t\r\n\]+main \\(\\) at.*call-rt-st.c:${decimal}\[ \t\r\n\]+${decimal}\[\t \]+return 0;.*-finish1-.*$gdb_prompt $" { > pass "finish out from loop_count (finish1)" > } > - -re "Run till exit from .0 loop_count \\(\\) at.*call-rt-st.c:$stop_line\[ \t\r\n\]+main \\(\\) at.*call-rt-st.c:\[0-9\]+\[ \t\r\n\]+\[0-9\]+\[\t \]+loop_count.*-finish2-.*$gdb_prompt $" { > + -re "Run till exit from .0 loop_count \\(\\) at.*call-rt-st.c:$stop_line\[ \t\r\n\]+main \\(\\) at.*call-rt-st.c:${decimal}\[ \t\r\n\]+${decimal}\[\t \]+loop_count.*-finish2-.*$gdb_prompt $" { > pass "finish out from loop_count (line 775)" > } > } > > --- a/gdb/testsuite/gdb.base/dbx.exp > +++ b/gdb/testsuite/gdb.base/dbx.exp > @@ -289,6 +289,7 @@ > #test_func > # > proc test_func { } { > + global decimal > global srcfile2 > gdb_test "cont" ".*" "cont 1" > gdb_test "step" ".*" > @@ -300,7 +301,7 @@ > gdb_test "cont" ".*" "cont 2" > # This always fails, but it's not clear why. -sts 1999-08-17 > setup_xfail "*-*-*" > - gdb_test "func print_average" ".*in print_average.*\\(list=.*, low=0, high=6\\).*at.*average\.c:\[0-9\]+\r\n\[0-9\]+\[ \t\]+total = sum\\(list, low, high\\);" > + gdb_test "func print_average" ".*in print_average.*\\(list=.*, low=0, high=6\\).*at.*average\.c:${decimal}\r\n\${decimal}\[ \t\]+total = sum\\(list, low, high\\);" > } > > # Start with a fresh gdb. > > --- a/gdb/testsuite/gdb.base/foll-exec.exp > +++ b/gdb/testsuite/gdb.base/foll-exec.exp > @@ -119,7 +119,7 @@ > # > send_gdb "next 3\n" > gdb_expect { > - -re ".*execlp \\(.*$gdb_prompt $"\ > + -re "execlp \\(.*$gdb_prompt $"\ > {pass "step to exec call"} > -re "$gdb_prompt $" {fail "step to exec call"} > timeout {fail "(timeout) step to exec call"} > > --- a/gdb/testsuite/gdb.base/jump.exp > +++ b/gdb/testsuite/gdb.base/jump.exp > @@ -40,7 +40,7 @@ > set bp_on_non_call 0 > set non_call_line [gdb_get_line_number "bp-on-non-call"] > gdb_test_multiple "break $non_call_line" "break before jump to non-call" { > - -re "\[Bb\]reakpoint (\[0-9\]*) at 0x\[0-9a-fA-F\]*: file .*${srcfile}, line $non_call_line.*$gdb_prompt $" { > + -re "\[Bb\]reakpoint (${decimal}) at ${hex}: file .*${srcfile}, line $non_call_line.*$gdb_prompt $" { > set bp_on_non_call $expect_out(1,string) > pass "break before jump to non-call" > } > @@ -48,7 +48,7 @@ > > # Can we jump to the statement? Do we stop there? > # > -gdb_test "jump $non_call_line" "Breakpoint \[0-9\]*, .*${srcfile}:$non_call_line.*" \ > +gdb_test "jump $non_call_line" "Breakpoint ${decimal}, .*${srcfile}:$non_call_line.*" \ > "jump to non-call" > > # Set a breakpoint on the statement that we're about to jump to. > @@ -57,7 +57,7 @@ > set bp_on_call 0 > set call_line [gdb_get_line_number "bp-on-call"] > gdb_test_multiple "break $call_line" "break before jump to call" { > - -re "\[Bb\]reakpoint (\[0-9\]*) at 0x\[0-9a-fA-F\]*: file .*${srcfile}, line $call_line.*$gdb_prompt $" { > + -re "\[Bb\]reakpoint (${decimal}) at ${hex}: file .*${srcfile}, line $call_line.*$gdb_prompt $" { > set bp_on_call $expect_out(1,string) > pass "break before jump to call" > } > @@ -66,7 +66,7 @@ > # Can we jump to the statement? Do we stop there? > # > gdb_test "jump $call_line" \ > - "Breakpoint \[0-9\]*, .*${srcfile}:$call_line.*" \ > + "Breakpoint ${decimal}, .*${srcfile}:$call_line.*" \ > "jump to call" > > # If we disable the breakpoint at the function call, and then > @@ -75,7 +75,7 @@ > # > gdb_test_no_output "disable $bp_on_call" "disable breakpoint on call" > > -gdb_test "jump $call_line" "Breakpoint \[0-9\]*, .*${srcfile}:$non_call_line.*" \ > +gdb_test "jump $call_line" "Breakpoint ${decimal}, .*${srcfile}:$non_call_line.*" \ > "jump to call with disabled breakpoint" > > # Verify that GDB responds gracefully to the "jump" command without > > --- a/gdb/testsuite/gdb.base/shlib-call.exp > +++ b/gdb/testsuite/gdb.base/shlib-call.exp > @@ -111,7 +111,7 @@ > "breakpoint function shr2" > > gdb_test "continue" \ > - "Continuing\\..*Breakpoint \[0-9\]+, shr2 \\(.*\\) at.*shr2\\.c:.*shr2-return \\*\\/" \ > + "Continuing\\..*Breakpoint ${decimal}, shr2 \\(.*\\) at.*shr2\\.c:${decimal}.*shr2-return \\*\\/" \ > "run until breakpoint set at a function" > > > --- a/gdb/testsuite/gdb.base/so-impl-ld.exp > +++ b/gdb/testsuite/gdb.base/so-impl-ld.exp > @@ -61,12 +61,12 @@ > > # Verify that we can step into the second shlib call. > # > -gdb_test "step" "solib_main .arg=10000. at.*${libfile}.c:.* HERE .*" \ > +gdb_test "step" "solib_main .arg=10000. at.*${libfile}.c:${decimal}.* HERE .*" \ > "step into solib call" > > # Verify that we can step within the shlib call. > # > -gdb_test "next" "\[0-9\]+\[ \t\]*\}.* STEP .*" "step in solib call" > +gdb_test "next" "${decimal}\[ \t\]*\}.* STEP .*" "step in solib call" > > # Verify that we can step out of the shlib call, and back out into > # the caller. -- Sergio GPG key ID: 0x65FC5E36 Please send encrypted e-mail if possible http://sergiodj.net/