From patchwork Fri Feb 2 18:36:41 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Keith Seitz X-Patchwork-Id: 25779 Received: (qmail 20379 invoked by alias); 2 Feb 2018 18:36:46 -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 20355 invoked by uid 89); 2 Feb 2018 18:36:46 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_LAZY_DOMAIN_SECURITY, KAM_SHORT, SPF_HELO_PASS, T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy=well-known, wellknown 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 ESMTP; Fri, 02 Feb 2018 18:36:44 +0000 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B013857 for ; Fri, 2 Feb 2018 18:36:43 +0000 (UTC) Received: from theo.uglyboxes.com (ovpn04.gateway.prod.ext.phx2.redhat.com [10.5.9.4]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7F1A3BA6A for ; Fri, 2 Feb 2018 18:36:43 +0000 (UTC) From: Keith Seitz To: gdb-patches@sourceware.org Subject: [PATCH 2/3] Remove hard-coded line number from templates.exp Date: Fri, 2 Feb 2018 10:36:41 -0800 Message-Id: <20180202183642.4288-2-keiths@redhat.com> In-Reply-To: <20180202183642.4288-1-keiths@redhat.com> References: <20180202183642.4288-1-keiths@redhat.com> X-IsSubscribed: yes templates.exp has a hard-coded line number in it: gdb_test "b 770" \ "Breakpoint .* at .*, line 770." The problems with this are well-known, and this patch simply removes it. I've also added the missing FSF copyright header to templates.cc. testsuite/ChangeLog: * gdb.cp/templates.cc (main): Add breakpoint marker comment. * gdb.cp/templates.exp: Remove hard-coded line number. --- gdb/testsuite/gdb.cp/templates.cc | 19 ++++++++++++++++++- gdb/testsuite/gdb.cp/templates.exp | 8 ++------ 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/gdb/testsuite/gdb.cp/templates.cc b/gdb/testsuite/gdb.cp/templates.cc index 49cf6b66ef..db2dfe8a58 100644 --- a/gdb/testsuite/gdb.cp/templates.cc +++ b/gdb/testsuite/gdb.cp/templates.cc @@ -1,3 +1,20 @@ +/* This testcase is part of GDB, the GNU debugger. + + Copyright 1992-2018 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + /* This test code is from Wendell Baker (wbaker@comet.berkeley.edu) */ #include @@ -801,5 +818,5 @@ int main() arg.method(empty); - return 0; + return 0; // break here } diff --git a/gdb/testsuite/gdb.cp/templates.exp b/gdb/testsuite/gdb.cp/templates.exp index 3d8e9aa43e..af722689c7 100644 --- a/gdb/testsuite/gdb.cp/templates.exp +++ b/gdb/testsuite/gdb.cp/templates.exp @@ -283,12 +283,8 @@ do_tests # weren't breakpointing past a point where the below expressions were # initialized in the actual source. - djb -gdb_test "b 770" \ - "Breakpoint .* at .*, line 770." - -gdb_test "c" \ - "Continuing.*Breakpoint .*" \ - "continue to line 770" +gdb_breakpoint [gdb_get_line_number "break here"] +gdb_continue_to_breakpoint "continue to test marker" gdb_test "print fint" \ "\\$\[0-9\]* = \\{x = 0, t = 0\\}"