Bug 19719 – Debugging string mixins using -mixin doesn't work

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
Windows
Creation time
2019-03-06T07:57:33Z
Last change time
2019-04-05T14:23:09Z
Keywords
pull
Assigned to
No Owner
Creator
Rainer Schuetze

Comments

Comment #0 by r.sagitario — 2019-03-06T07:57:33Z
Stepping through mixin code in the debugger using -mixin doesn't work on Windows. For COFF, no debug line info is emitted if it is from a different file than the one containing the function declaration. For OMF, there are instructions without any source code when switching from one file to another causing the VS debugger to not show any code or step out of the function. For example, this function void fun() { mixin("int a = 0; int z = 1; int y = a + z; a = y + z;"); } disssembles as void fun() 0040224c enter 0xc, 0x0 --- No source file ------------------------------------------------------------- 00402250 push ebx --- C:\test\WindowsApp1.mixin // expansion at WindowsApp1.d(14) int a = 0; 00402251 xor eax, eax 00402253 mov [ebp-0xc], eax int z = 1; 00402256 mov ecx, 0x1 0040225b mov [ebp-0x8], ecx int y = a + z; 0040225e lea edx, [eax+ecx] 00402261 mov [ebp-0x4], edx a = y + z; 00402264 lea ebx, [edx+ecx] --- No source file ------------------------------------------------------------- 00402267 mov [ebp-0xc], ebx --- C:\test\WindowsApp1.d --------- } void fun() { mixin("int a = 0; int z = 1; int y = a + z; a = y + z;"); } 0040226a pop ebx --- No source file ------------------------------------------------------------- 0040226b leave 0040226c ret 0040226d int3 0040226e int3 0040226f int3
Comment #1 by dlang-bot — 2019-03-19T08:27:12Z
@rainers created dlang/dmd pull request #9464 "fix Issue 19719 - Debugging string mixins using -mixin doesn't work" fixing this issue: - fix Issue 19719 - Debugging string mixins using -mixin doesn't work COFF: extend line number info to allow multiple segments in different source files ensure empty line after mixin expansion https://github.com/dlang/dmd/pull/9464
Comment #2 by dlang-bot — 2019-04-05T14:23:09Z
dlang/dmd pull request #9464 "fix Issue 19719 - Debugging string mixins using -mixin doesn't work" was merged into master: - 51dfe6b91872002418e5889cd2a90110cbb144b7 by Rainer Schuetze: fix Issue 19719 - Debugging string mixins using -mixin doesn't work COFF: extend line number info to allow multiple segments in different source files ensure empty line after mixin expansion https://github.com/dlang/dmd/pull/9464