www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 19989] New: Bad debug line info with default arguments in


          Issue ID: 19989
           Summary: Bad debug line info with default arguments in other
           Product: D
           Version: D2
          Hardware: All
                OS: Windows
            Status: NEW
          Keywords: symdeb
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: r.sagitario gmx.de

module dbi2;

string def() { return "test"; }

void fun3(string arg = def()) // line 5

module dbi;

import dbi2;

void main() // step once from here
    fun3(); // line 7

Compile with "dmd -g -m64 dbi.d dbi2.d", open debugger and set breakpoint at
"void main()":

- when stepping over/into once, the debugger immediately jumps to fun3. It
should step to the call at line 7 instead.

- with the impression of having stepped into fun3, "step out" runs until main()

- trying to set a brakpoint at line 7 seems to do nothing, it is set at dbi2.d,
line 5 instead

https://github.com/dlang/dmd/pull/6327 seems to have fixed this for expressions
from the same file (it looks ok if fun3 is declared in module dbi).

Jun 20 2019