[RFA/linespec] wrong line number in breakpoint location

Simon Marchi simon.marchi@polymtl.ca
Thu Dec 21 01:31:00 GMT 2017

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).  */



More information about the Gdb-patches mailing list