public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Simon Marchi <simon.marchi@polymtl.ca>
To: Joel Brobecker <brobecker@adacore.com>
Cc: gdb-patches@sourceware.org, Keith Seitz <keiths@redhat.com>,
	       Xavier Roirand <roirand@adacore.com>
Subject: Re: [RFA/linespec] wrong line number in breakpoint location
Date: Thu, 21 Dec 2017 01:31:00 -0000	[thread overview]
Message-ID: <206d75d6b1f14e55b6a0dff523d8c722@polymtl.ca> (raw)
In-Reply-To: <20171219092405.n2dql5ji52qhjilj@adacore.com>

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

  reply	other threads:[~2017-12-21  1:31 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-18  2:44 Joel Brobecker
2017-12-18  4:09 ` Simon Marchi
2017-12-19  9:24   ` Joel Brobecker
2017-12-21  1:31     ` Simon Marchi [this message]
2017-12-21 11:31       ` Joel Brobecker
2017-12-21 11:32         ` Joel Brobecker
2018-01-22  4:17           ` pushed: " Joel Brobecker
2018-01-26 17:16           ` Simon Marchi
2018-01-29  4:45             ` Joel Brobecker
2018-01-29 17:01               ` Simon Marchi
2018-01-30  4:09                 ` Joel Brobecker
2018-01-30 12:39                   ` Pedro Alves

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=206d75d6b1f14e55b6a0dff523d8c722@polymtl.ca \
    --to=simon.marchi@polymtl.ca \
    --cc=brobecker@adacore.com \
    --cc=gdb-patches@sourceware.org \
    --cc=keiths@redhat.com \
    --cc=roirand@adacore.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).