This is an old post but I got debugging working in part thanks to it. So i guess I will share how i did it.
I have a “Rack-SDK” folder and inside it a “.vscode” folder with this files.
settings.json
{
{
"terminal.integrated.shell.windows": "c:\\msys64\\usr\\bin\\bash.exe",
"terminal.integrated.shellArgs.windows": ["--login"],
"terminal.integrated.env.windows": {
"CHERE_INVOKING": "1",
"MSYSTEM": "MINGW64"
}
}
task.json
{
{
"version": "2.0.0",
"tasks": [
{
"label": "Build VCV Rack plugin",
"type": "shell",
"command": "make install -j4",
"options": {
"cwd": "${workspaceFolder}/plugins/LomasModules",
"env": {
"PATH": "C:\\msys64\\usr\\bin\\;C:\\msys64\\mingw64\\bin"
}
},
"problemMatcher": {
"owner": "cpp",
"fileLocation": [
"absolute"
],
"pattern": {
"regexp": "^(.*):(\\d+):(\\d+):\\s+(warning|error):\\s+(.*)$",
"file": 1,
"line": 2,
"column": 3,
"severity": 4,
"message": 5
}
}
},
{
"label": "Build VCV Rack plugin & lauch Rack",
"type": "process",
"command": "C:\\Program Files\\VCV\\Rack\\Rack.exe",
"problemMatcher": [],
"dependsOn": ["Build VCV Rack plugin"],
"group": {
"kind": "build",
"isDefault": true
}
}
]
}
launch.json
{
{
// 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": [
{
"name": "(gdb) Launch",
"type": "cppdbg",
"request": "launch",
"program": "C:\\Program Files\\VCV\\Rack\\Rack.exe",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"externalConsole": true,
"MIMode": "gdb",
"miDebuggerPath": "C:/msys64/mingw64/bin/gdb.exe",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
],
"preLaunchTask": "Build VCV Rack plugin"
}
]
}
After those files gdb started running but line breakpoints did not work. The key was what @Richie said:
ifdef ARCH_MAC
$(STRIP) -S dist/$(SLUG)/$(TARGET)
else
# RJH $(STRIP) -s dist/$(SLUG)/$(TARGET)
endif
After commenting that line the breakpoints are working.
If you want to use the files you will have to change the plugin relative path “${workspaceFolder}/plugins/LomasModules” to point to your plugin folder. Also you may need to change the paths to gdb, gcc, and rack. I have MSYS2 on c: and Rack on Program Files.