Comment #0 by thomas.hedstrom — 2019-06-13T11:16:01Z
Some array constructs do not work correctly in the debugger.
Mago used
VisualD 0.50.0-beta2
VS2017 15.9.13
1. In the following code, watch on "data" fails in x64 LDC debug.
module main;
import std.stdio;
alias retData = ubyte[uint][2];
int main(string[] argv)
{
retData b,a;
b[1][27] = 123;
a = test();
writeln(a,b); // break 2
return 0;
}
retData test()
{
retData data;
data[1][27] = 123;
writeln(data);
return data; // break 1
}
2. Reducing the type/assignments for: alias retData = ubyte[uint]
This makes "data" watchable, but now "a" no longer works in LDC x64 or x86.
Not sure but I think problem 1 was ok/better in 0.49.
Might be LDC debug info problem but in actual code where I use a more complex array type, both LDC and DMD x64 have problem but not any x86.
Comment #1 by thomas.hedstrom — 2019-06-13T11:32:00Z
Correction on versions:
VisualD 0.50.0-beta2 with LDC/DMD provided.
Previous setup whithout thus bug was:
VisualD 0.48.1
LDC 1.12.0
DMD 2.048.0
Comment #2 by r.sagitario — 2019-06-15T10:22:53Z
I don't see it working in older versions. It works with dmd for me.
One problem with LDC is that even the debug build keeps locals in registers for sections of code, and the debug info is then a list of "ranges" that describe the location. Mago so far only supports a single range.
Comment #3 by thomas.hedstrom — 2019-06-18T19:00:55Z
Seems a bit stranger than that also...
When I try my own example on another machine with VS2017 Community 15.9.13, I can't reproduce what I saw. Using the same beta 2 VisualD.
Might be different running environment for VS2017 (user rights?).
Will look more closely on the problematic installation (VS2017 Professional etc).
Comment #4 by r.sagitario — 2019-06-18T19:13:31Z
I think I have a fix to be released soon. Stay tuned.
Comment #5 by thomas.hedstrom — 2019-06-18T19:19:37Z
(In reply to Thomas from comment #3)
> I can't reproduce what I saw. Using the same beta 2 VisualD.
Sorry, premature conclusion.
I can reproduce the LDC x64 problem on this other machine for example 1 but not for the second.
Seems reasonable that this is the LDC only problem.