Skip to content

Instantly share code, notes, and snippets.

@RednibCoding
Last active May 27, 2024 14:06
Show Gist options
  • Save RednibCoding/0210783b7b9145b43fd6705630cbd86a to your computer and use it in GitHub Desktop.
Save RednibCoding/0210783b7b9145b43fd6705630cbd86a to your computer and use it in GitHub Desktop.
Dlang debuggin in vs-code

Setup

To setup debugging for Dlang programs on Windows with VsCode follow these steps:

  • make sure you have the D Programming Language (code-d) (VsCode extension) installed
  • make sure you have the C/C++ extension pack (VsCode extension) installed
  • create a .vscode folder at the root of your Odin project
  • copy the launch.json and tasks.json into it
  • in the launch.json at line: "program": "./my-app.exe", change my-app.exe to your executable name (look in the dub.json under name).
  • click on the debug tab in VsCode, then click on the debug button at the top (or press F5)

FAQ

Q: When I start debugging, I get the following error popup: Configured debug type 'cppvsdbg' is not supported.

A: Make sure you have the C/C++ extension pack installed. If it is already installed, try reinstalling it.

{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "code-d",
"request": "launch",
"name": "Debug D project",
"cwd": "${workspaceFolder}",
"program": "./my-app.exe",
"preLaunchTask": "Build"
}
]
}
{
"version": "2.0.0",
"command": "",
"args": [],
"tasks": [
{
"label": "Build",
"type": "shell",
"command": "dub build -a=x86_64 -b=debug -c=application",
"group": "build"
},
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment