Debugging on Windows

Arokh Slade arokhslade at gmail.com
Sat Apr 19 19:48:11 UTC 2025


On Friday, 18 April 2025 at 02:21:23 UTC, Mike Shah wrote:
> On Wednesday, 16 April 2025 at 20:08:00 UTC, Arokh Slade wrote:
>> Hello,
>>
>> I'm trying to get debugging on windows 10 to work.
>> d_test.d
>> ```D
>> void main() {
>> 	int i;
>> }
>> ```
>> I compile with:
>> dmd -g -gf -m64 .\d_test.d
>>
>> I load the msvc debugger with
>> devenv /DebugExe .\d_test.exe
>>
>> latest visualD installed.
>>
>> I can step into the program, but when I add `i` to the watch 
>> window,
>> msvs 2022 enters an infinite loop, allocating memory 
>> indefinitely (I watched until it passed 10GB).
>>
>> Any tips?
>> How do other people debug on windows?
>
> I have somewhere some instructions on windbg which my students 
> pointed me to at some point. Have you given that a try? I can 
> try to find them in the meantime.

Hello Mike.

Thanks for trying to help. I've watched some of your vids on 
Youtube, and appreciate your work.

I've given WinDBG a try following your suggestion.
It's an improvement in that the infinite-loop-with-memory-leak 
doesn't happen and I can inspect the value of an int.
However, I can't inspect arrays because it doesn't know D, only 
C/C++.

What I'm really looking for is to get VisualD working properly, 
as demonstrated on the official site.

https://rainers.github.io/visuald/visuald/Debugging.html

I had to set up a lot of paths manually, for it to find the 
visual studio linker and several of the linked libraries, like 
user32.lib.
Not sure what I could have done wrong there but I can't imagine 
what else could be the problem.

Has anyone else had issues with inspecting variables in VisualD?


More information about the Digitalmars-d-learn mailing list