From patchwork Wed Oct 29 18:25:55 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Arnez X-Patchwork-Id: 3482 Received: (qmail 1868 invoked by alias); 29 Oct 2014 18:26:04 -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 1858 invoked by uid 89); 29 Oct 2014 18:26:03 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: e06smtp14.uk.ibm.com Received: from e06smtp14.uk.ibm.com (HELO e06smtp14.uk.ibm.com) (195.75.94.110) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Wed, 29 Oct 2014 18:26:02 +0000 Received: from /spool/local by e06smtp14.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 29 Oct 2014 18:25:59 -0000 Received: from d06dlp01.portsmouth.uk.ibm.com (9.149.20.13) by e06smtp14.uk.ibm.com (192.168.101.144) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Wed, 29 Oct 2014 18:25:58 -0000 Received: from b06cxnps4075.portsmouth.uk.ibm.com (d06relay12.portsmouth.uk.ibm.com [9.149.109.197]) by d06dlp01.portsmouth.uk.ibm.com (Postfix) with ESMTP id DD7F117D8024 for ; Wed, 29 Oct 2014 18:26:00 +0000 (GMT) Received: from d06av04.portsmouth.uk.ibm.com (d06av04.portsmouth.uk.ibm.com [9.149.37.216]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id s9TIPvNc6226240 for ; Wed, 29 Oct 2014 18:25:57 GMT Received: from d06av04.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av04.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id s9TIPugO010618 for ; Wed, 29 Oct 2014 12:25:57 -0600 Received: from br87z6lw.de.ibm.com (dyn-9-152-212-196.boeblingen.de.ibm.com [9.152.212.196]) by d06av04.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id s9TIPu9I010608; Wed, 29 Oct 2014 12:25:56 -0600 From: Andreas Arnez To: Sergio Durigan Junior 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> Date: Wed, 29 Oct 2014 19:25:55 +0100 In-Reply-To: <87bnoukfql.fsf@redhat.com> (Sergio Durigan Junior's message of "Wed, 29 Oct 2014 12:22:42 -0400") Message-ID: <87h9ymag24.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: 14102918-0017-0000-0000-000001A3624F X-IsSubscribed: yes Hi Sergio, Thanks for reviewing! 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. Here are the changes I performed based on your suggestion: --- 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.