How to debug in vscode Windows?

solidstate1991 laszloszeremi at outlook.com
Wed Jan 1 16:21:32 UTC 2020


On Wednesday, 1 January 2020 at 14:46:01 UTC, NaN wrote:
> You can use visual studio (works in 2019, havent tried earlier 
> versions) to debug any exe you want. You do this...
>
> Go to File menu, then Open, then Project/Solution
>
> Make sure "all project files" is selected, then find the exe 
> you want to debug, click Open.
>
> Now you can debug that exe inside Visual Studio (as long as its 
> been compiled with debug info) You can also save the solution 
> so next time you just open the solution and you're ready to 
> debug.
>
> You can drop source files into visual studio and set 
> breakpoints, but it will also automatically pull up the source 
> when it hits an exception. Although you might need adjust VS 
> settings so it breaks on all exceptions IIRC... explains how on 
> this page...
>
> https://docs.microsoft.com/en-us/visualstudio/debugger/managing-exceptions-with-the-debugger?view=vs-2019
>
> Its pretty much all working, except you cant see dynamic array 
> contents and occasionally it steps a line out of sync.
>
> I never managed to get any debugger working in VSCode. But this 
> way you get the Visual Studio debugger which as good as it 
> gets, and its just a couple of clicks away.
>
> Oh I'm using LDC to compile so I'm not sure how well it works 
> with DMD, haven't tried, but should work the same I imagine.

I usually just make an empty project and set up the exe file to 
the one that dub creates instead.


More information about the Digitalmars-d-learn mailing list