From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9838 invoked by alias); 7 Oct 2013 17:19:14 -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 9773 invoked by uid 89); 7 Oct 2013 17:19:13 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_PASS,UNPARSEABLE_RELAY autolearn=ham version=3.3.2 X-HELO: aserp1040.oracle.com Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com) (141.146.126.69) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Mon, 07 Oct 2013 17:19:12 +0000 Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94]) by aserp1040.oracle.com (Sentrion-MTA-4.3.1/Sentrion-MTA-4.3.1) with ESMTP id r97HJ8xl004523 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 7 Oct 2013 17:19:09 GMT Received: from userz7021.oracle.com (userz7021.oracle.com [156.151.31.85]) by ucsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id r97HJ78L010985 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 7 Oct 2013 17:19:08 GMT Received: from abhmt112.oracle.com (abhmt112.oracle.com [141.146.116.64]) by userz7021.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id r97HJ79g000991; Mon, 7 Oct 2013 17:19:07 GMT Received: from termi.oracle.com (/10.175.34.9) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 07 Oct 2013 10:19:07 -0700 From: jose.marchesi@oracle.com (Jose E. Marchesi) To: Pedro Alves Cc: gdb-patches@sourceware.org Subject: Re: [PATCH] testsuite: adjust line number in commands.exp References: <8761t9m8mo.fsf@oracle.com> <5252DE0D.4060106@redhat.com> Date: Mon, 07 Oct 2013 17:19:00 -0000 In-Reply-To: <5252DE0D.4060106@redhat.com> (Pedro Alves's message of "Mon, 07 Oct 2013 17:15:09 +0100") Message-ID: <87zjqlknes.fsf@oracle.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-IsSubscribed: yes X-SW-Source: 2013-10/txt/msg00193.txt.bz2 > Tested in both sparc64-*-linux-gnu and x86_64-*-linux-gnu. > > 2013-10-07 Jose E. Marchesi > > * gdb.base/commands.exp (watchpoint_command_test): Adjust line > number in run.c with the end of scope of the block containing > local_var. This is PR 15986. Could you make this use gdb_get_line_number? Something like this? For future patches I will search the bugzilla first :) 2013-10-07 Jose E. Marchesi PR gdb/15986 * gdb.base/run.c (main): gdb_get_line_number tag added for commands.exp. (factorial): Likewise. * gdb.base/commands.exp (watchpoint_command_test): Use gdb_get_line_number in order to determine the locations in run.c where local_var is detected to go out of scope. Index: testsuite/gdb.base/commands.exp =================================================================== RCS file: /cvs/src/src/gdb/testsuite/gdb.base/commands.exp,v retrieving revision 1.52 diff -u -r1.52 commands.exp --- testsuite/gdb.base/commands.exp 27 Jun 2013 18:49:03 -0000 1.52 +++ testsuite/gdb.base/commands.exp 7 Oct 2013 17:13:47 -0000 @@ -308,6 +308,8 @@ "end commands on watch" set test "continue with watch" + set lno_1 [gdb_get_line_number "commands.exp: hw local_var out of scope" "run.c"] + set lno_2 [gdb_get_line_number "commands.exp: local_var out of scope" "run.c"] gdb_test_multiple "continue" "$test" { -re "No symbol \"value\" in current context.\r\n$gdb_prompt $" { # Happens if GDB actually runs the watchpoints commands, @@ -315,7 +317,7 @@ # scope. fail $test } - -re "Continuing.*\[Ww\]atchpoint $wp_id deleted because the program has left the block in.*which its expression is valid.*run.c:(53|77).*$gdb_prompt $" { + -re "Continuing.*\[Ww\]atchpoint $wp_id deleted because the program has left the block in.*which its expression is valid.*run.c:($lno_1|$lno_2).*$gdb_prompt $" { pass $test } } Index: testsuite/gdb.base/run.c =================================================================== RCS file: /cvs/src/src/gdb/testsuite/gdb.base/run.c,v retrieving revision 1.2 diff -u -r1.2 run.c --- testsuite/gdb.base/run.c 13 Dec 2011 17:22:08 -0000 1.2 +++ testsuite/gdb.base/run.c 7 Oct 2013 17:13:47 -0000 @@ -50,7 +50,7 @@ #endif { #ifdef FAKEARGV - printf ("%d\n", factorial (1)); + printf ("%d\n", factorial (1)); /* commands.exp: hw local_var out of scope */ #else if (argc != 2) { printf ("usage: factorial \n"); @@ -75,4 +75,4 @@ } local_var = value; return (value); -} +} /* commands.exp: local_var out of scope */