[Issue 17619] [REG2.072] Wrong debug line information with single line loops

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Sat Jul 8 01:26:58 PDT 2017


https://issues.dlang.org/show_bug.cgi?id=17619

Rainer Schuetze <r.sagitario at gmx.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |r.sagitario at gmx.de

--- Comment #1 from Rainer Schuetze <r.sagitario at gmx.de> ---
I think there are (at least) two issues here:

1. the line number attached to the end of the for statement is the line of the
token following the loop, while it should be the line after the last token of
the statement. That would not really help if the declaration of "bad" would not
be separated by an empty line, though.

2. there is no perfect fit for the line number attached to the loop iteration
and jump back to the start:

  - if it is after the loop, it looks as if the loop has already terminated (as
reported here). This also happens sometimes for C++ code with VC (not sure
about gcc).

  - if it is on the loop statement the call stack of a function call inside the
loop can get confusing, e.g.

    void main()
    {
        test1();
        foreach (i; 0 .. 3)
            test2();
    }

     When breaking inside test2, the call stack will look like it is being
called by test1();

--


More information about the Digitalmars-d-bugs mailing list