From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 69956 invoked by alias); 21 Dec 2017 01:31:42 -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 69943 invoked by uid 89); 21 Dec 2017 01:31:42 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy=our X-HELO: smtp.polymtl.ca Received: from smtp.polymtl.ca (HELO smtp.polymtl.ca) (132.207.4.11) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 21 Dec 2017 01:31:40 +0000 Received: from simark.ca (simark.ca [158.69.221.121]) (authenticated bits=0) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id vBL1VYip001046 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 20 Dec 2017 20:31:38 -0500 Received: by simark.ca (Postfix, from userid 112) id 0A4F81E59F; Wed, 20 Dec 2017 20:31:34 -0500 (EST) Received: from simark.ca (localhost [127.0.0.1]) by simark.ca (Postfix) with ESMTP id A434E1E037; Wed, 20 Dec 2017 20:31:32 -0500 (EST) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Thu, 21 Dec 2017 01:31:00 -0000 From: Simon Marchi To: Joel Brobecker Cc: gdb-patches@sourceware.org, Keith Seitz , Xavier Roirand Subject: Re: [RFA/linespec] wrong line number in breakpoint location In-Reply-To: <20171219092405.n2dql5ji52qhjilj@adacore.com> References: <1513565091-118926-1-git-send-email-brobecker@adacore.com> <20171219092405.n2dql5ji52qhjilj@adacore.com> Message-ID: <206d75d6b1f14e55b6a0dff523d8c722@polymtl.ca> X-Sender: simon.marchi@polymtl.ca User-Agent: Roundcube Webmail/1.3.2 X-Poly-FromMTA: (simark.ca [158.69.221.121]) at Thu, 21 Dec 2017 01:31:34 +0000 X-IsSubscribed: yes X-SW-Source: 2017-12/txt/msg00457.txt.bz2 On 2017-12-19 04:24, Joel Brobecker wrote: > That's correct. Attached is a second version of the patch which > hopefully clarifies everything: > > /* The following function's implementation starts by including a file > (break-include.inc) which contains a copyright header followed by > a single C statement. When we break on the line where the function I would say "place a breakpoint" instead of break. For me "to break" is the action of the program stopping on a breakpoint (though maybe it > name is declared, we expect GDB to skip the function's prologue, > and insert the breakpoint on the first line of "user" code for > that function, which we have set up to be that single statement > break-include.inc provides. > > The purpose of this testcase is to verify that, when we insert > that breakpoint, GDB reports the location as being in that include > file, but also using the correct line number inside that include > file -- NOT the line number we originally used to insert the > breakpoint, nor the location where the file is included from. > In order to verify that GDB shows the right line number, we must > be careful that this first statement located in break-include.inc > and our function are not on the same line number. Otherwise, > we could potentially have a false PASS. > > This is why we implement the following function as far away > from the start of this file as possible, as we know that > break-include.inc is a fairly short file (copyright header > and single statement only). */ LGTM. Simon