Open TurkeyMan opened 5 days ago
Indeed, it seems that it should work. I suspect that it is masked by he string visualization, you can still see the length value if you use text,!
to show the raw data. It also works for other array types.
The problem here is that the text argument is actually passed by reference ABI-wise, and that's typed as a pointer in the debug info. The expression evaluator fails to crawl this additional indirection. If you assign the text
to a local variable txt
, then txt.length
is evaluated correctly.
Is there any way to correct this? Can it be typed as a reference instead of a pointer? I suspect this particular situation is causing a great many cases I've been seeing to fail in a similar way.
It should be possible to fix it in the compiler (LDC seems to work better), but in this case, the evaluator should also support the indirection when using '.' with a pointer as it is valid syntax. BTW: (*text).length
works, too.
You can find a preliminary version of the fixed debugger plugin in the artifacts of the CI builds here: https://ci.appveyor.com/project/rainers/mago/build/artifacts
You just need to replace this file: "c:\Program Files\Microsoft Visual Studio\2022\Preview\Common7\Packages\Debugger\MagoNatCC.dll" where "Preview" is probably something else on your system.
I tried that DLL and this particular problem was resolved. I'll run for a while and see if any of my other issues are also resolved... Cheers!
If it still stalls/takes forever (no changes with respect to that), you can also use the pdb-file to get an idea where it is wasting all the time when attaching a debugger to devenv.exe.
I'll definitely do that next time I notice it locking up.
My colleague reported this one to me:
This is just a tweak of the wizard app. In this code, break on that line, you can't inspect
length
. I feel like I used to be able to inspect the length of arrays?