From patchwork Wed Oct 29 16:00:19 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Arnez X-Patchwork-Id: 3467 Received: (qmail 10179 invoked by alias); 29 Oct 2014 16:01:43 -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 10168 invoked by uid 89); 29 Oct 2014 16:01:43 -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: e06smtp16.uk.ibm.com Received: from e06smtp16.uk.ibm.com (HELO e06smtp16.uk.ibm.com) (195.75.94.112) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Wed, 29 Oct 2014 16:01:38 +0000 Received: from /spool/local by e06smtp16.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 29 Oct 2014 16:01:35 -0000 Received: from d06dlp01.portsmouth.uk.ibm.com (9.149.20.13) by e06smtp16.uk.ibm.com (192.168.101.146) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Wed, 29 Oct 2014 16:01:33 -0000 Received: from b06cxnps3074.portsmouth.uk.ibm.com (d06relay09.portsmouth.uk.ibm.com [9.149.109.194]) by d06dlp01.portsmouth.uk.ibm.com (Postfix) with ESMTP id 99F3817D804E for ; Wed, 29 Oct 2014 16:01:36 +0000 (GMT) Received: from d06av05.portsmouth.uk.ibm.com (d06av05.portsmouth.uk.ibm.com [9.149.37.229]) by b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id s9TG1XRV14090536 for ; Wed, 29 Oct 2014 16:01:33 GMT Received: from d06av05.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av05.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id s9TG1XWa001736 for ; Wed, 29 Oct 2014 10:01:33 -0600 Received: from br87z6lw.boeblingen.de.ibm.com (dyn-9-152-212-196.boeblingen.de.ibm.com [9.152.212.196]) by d06av05.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id s9TG0lWN032270 for ; Wed, 29 Oct 2014 10:01:33 -0600 From: Andreas Arnez To: gdb-patches@sourceware.org Subject: [PATCH 04/16] Eliminate literal line numbers in call-rt-st.exp Date: Wed, 29 Oct 2014 17:00:19 +0100 Message-Id: <1414598446-13831-4-git-send-email-arnez@linux.vnet.ibm.com> In-Reply-To: <1414597859-12523-1-git-send-email-arnez@linux.vnet.ibm.com> References: <1414597859-12523-1-git-send-email-arnez@linux.vnet.ibm.com> X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 14102916-0025-0000-0000-000002208F79 X-IsSubscribed: yes Remove literal line numbers from the regexps in call-rt-st.exp. Add appropriate eye-catchers to call-rt-st.c and refer to those instead. gdb/testsuite/ChangeLog: * gdb.base/call-rt-st.c: Add eye-catchers. * gdb.base/call-rt-st.exp: Refer to eye-catchers instead of literal line numbers. --- gdb/testsuite/gdb.base/call-rt-st.c | 6 +++--- gdb/testsuite/gdb.base/call-rt-st.exp | 11 ++++++----- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/gdb/testsuite/gdb.base/call-rt-st.c b/gdb/testsuite/gdb.base/call-rt-st.c index 09dd5bb..a583bab 100644 --- a/gdb/testsuite/gdb.base/call-rt-st.c +++ b/gdb/testsuite/gdb.base/call-rt-st.c @@ -125,7 +125,7 @@ void loop_count () { int index; - for (index=0; index<4; index++); + for (index=0; index<4; index++); /* -break1- */ } /***************************************************************** @@ -772,9 +772,9 @@ int main () { print_int_char_combo(*int_char_combo); print_struct_rep(*struct1); - loop_count(); + loop_count(); /* -finish2- */ - return 0; + return 0; /* -finish1- */ } diff --git a/gdb/testsuite/gdb.base/call-rt-st.exp b/gdb/testsuite/gdb.base/call-rt-st.exp index 0ca312c..925d896 100644 --- a/gdb/testsuite/gdb.base/call-rt-st.exp +++ b/gdb/testsuite/gdb.base/call-rt-st.exp @@ -64,19 +64,20 @@ if ![runto_main] then { } +set stop_line [gdb_get_line_number "-break1-"] gdb_test "break loop_count" \ - "Breakpoint.* file .*call-rt-st.c, line 128\\." \ + "Breakpoint.* file .*call-rt-st.c, line $stop_line\\." \ "breakpoint loop_count" gdb_test "continue" \ - "Continuing\\..*Breakpoint.*loop_count \\(\\) at.*call-rt-st.c:128\[ \t\r\n\]+128\[\t \]+for \\(index=0; index.4; index..\\);\[\r\n \]+" \ + "Continuing\\..*Breakpoint.*loop_count \\(\\) at.*call-rt-st.c:$stop_line\[ \t\r\n\]+$stop_line\[\t \]+for \\(index=0; index.4; index..\\);.*\[\r\n \]+" \ "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:128\[ \t\r\n\]+main \\(\\) at.*call-rt-st.c:777\[ \t\r\n\]+777\[\t \]+return 0;.*$gdb_prompt $" { - pass "finish out from loop_count (line 777)" + -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 $" { + pass "finish out from loop_count (finish1)" } - -re "Run till exit from .0 loop_count \\(\\) at.*call-rt-st.c:128\[ \t\r\n\]+main \\(\\) at.*call-rt-st.c:775\[ \t\r\n\]+775\[\t \]+loop_count.*$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:\[0-9\]+\[ \t\r\n\]+\[0-9\]+\[\t \]+loop_count.*-finish2-.*$gdb_prompt $" { pass "finish out from loop_count (line 775)" } }