Thread overview
Setting up VS Code on Windows for debugging
6 days ago
Brother Bill
5 days ago
felixfxu
5 days ago
Brother Bill
5 days ago
evilrat
6 days ago

I am using VS Code on Windows, and would like to use standard debugging, such as breakpoints, examining variable contents, etc.

I am unable to do so, instead adding writeln to examine the run time.
FWIW, author Adam Freeman prefers this approach, eschewing the debugger.

But if I wanted to use the VSCode debugger, what configuration steps to make it available and working?

5 days ago

On Sunday, 28 September 2025 at 10:47:45 UTC, Brother Bill wrote:

>

I am using VS Code on Windows, and would like to use standard debugging, such as breakpoints, examining variable contents, etc.

I am unable to do so, instead adding writeln to examine the run time.
FWIW, author Adam Freeman prefers this approach, eschewing the debugger.

But if I wanted to use the VSCode debugger, what configuration steps to make it available and working?

It should be possible, because I'm using it.

The installed extensions in vscode includes: code-d, serve-d

Then .vscode/launch.json is like:

    "configurations": [
        {
            "type": "code-d",
            "request": "launch",
            "dubBuild": true,
            "name": "Build & Debug DUB project",
            "cwd": "${command:dubWorkingDirectory}",
            "program": "${command:dubTarget}"
        },
    ]
5 days ago

On Sunday, 28 September 2025 at 10:47:45 UTC, Brother Bill wrote:

>

I am using VS Code on Windows, and would like to use standard debugging, such as breakpoints, examining variable contents, etc.

I am unable to do so, instead adding writeln to examine the run time.
FWIW, author Adam Freeman prefers this approach, eschewing the debugger.

But if I wanted to use the VSCode debugger, what configuration steps to make it available and working?

you need 'C++' extension, after setting it up it is straightforward process - simply add a C++ debug target and set your executable and arguments (if any). for maximum compatibility you might also want to build your program with -gc flag that will try to emit C++ compatible debug info. due to TLS by default and some other D features some debugging niceties like struct members might not work correctly.

5 days ago

On Monday, 29 September 2025 at 09:27:20 UTC, felixfxu wrote:

>

On Sunday, 28 September 2025 at 10:47:45 UTC, Brother Bill wrote:

>

I am using VS Code on Windows, and would like to use standard debugging, such as breakpoints, examining variable contents, etc.

I am unable to do so, instead adding writeln to examine the run time.
FWIW, author Adam Freeman prefers this approach, eschewing the debugger.

But if I wanted to use the VSCode debugger, what configuration steps to make it available and working?

It should be possible, because I'm using it.

The installed extensions in vscode includes: code-d, serve-d

Then .vscode/launch.json is like:

    "configurations": [
        {
            "type": "code-d",
            "request": "launch",
            "dubBuild": true,
            "name": "Build & Debug DUB project",
            "cwd": "${command:dubWorkingDirectory}",
            "program": "${command:dubTarget}"
        },
    ]

Added .vscode/launch.json to root of project, sibling to source dir.
But this didn't run.

Please provide a helloWorld project (zipped) or link to it, that is set up for VS Code, so I may reproduce it.

I've installed these VS Code extensions:

  1. D Programming Language (code-d) by WebFreak
  2. D Language utility extension pack by WebFreak
  3. Debug DLang for VSCode by Amarokice

Am running on Windows 11.
2.