Debug in VSCode - Can't trigger Breakpoint

Hi,

I’ve finally setup debugger in VSCode programming a VST plugin in JUCE.
Here’s my actual tasks.json:

{
	"version": "2.0.0",
	"tasks": [
		{
			"label": "SETUP (Targets)",
			"type": "shell",
			"command": "cmake -B cmake-build",
			"group": "build",
			"presentation": {
				"echo": true,
				"reveal": "always",
				"focus": false,
				"panel": "shared",
				"showReuseMessage": false,
				"clear": true
			},
			"problemMatcher": []
		},
		{
			"label": "BUILD",
			"type": "shell",
			"command": "cmake --build cmake-build",
			"group": "build",
			"presentation": {
				"echo": true,
				"reveal": "always",
				"focus": false,
				"panel": "shared",
				"showReuseMessage": false,
				"clear": true
			},
			"problemMatcher": []
		}
	]
}

and launch.json:

{
	"version": "0.2.0",
	"configurations": [
		{
			"name": "DEBUG (gdb)",
			"type": "cppdbg",
			"request": "launch",
			"program": "C:/vsthostx64/vsthost.exe",
			"args": [
				"-d",
                "C:/Program Files/Common Files/VST3/MyPlugin.vst3/Contents/x86_64-win/MyPluginJuce.vst3"
			],
			"stopAtEntry": false,
			"cwd": "C:/vsthostx64",
			"externalConsole": false,
			"avoidWindowsConsoleRedirection": true,
			"internalConsoleOptions": "openOnSessionStart",
			"MIMode": "gdb",
			"miDebuggerPath": "C:/msys64/mingw64/bin/gdb.exe",
			"miDebuggerArgs": "--silent --statistics",
			"setupCommands": [
				{
					"description": "Enable pretty-printing for gdb",
					"text": "-enable-pretty-printing",
					"ignoreFailures": true
				},
				{
					"description": "Disable Thead logging",
					"text": "set print thread-events off",
					"ignoreFailures": true
				}
			],
			"logging": {
				"engineLogging": false,
				"exceptions": true,
				"trace": false,
				"traceResponse": false,
				"moduleLoad": false,
				"programOutput": true
			},
			"preLaunchTask": "BUILD"
		}
	]
}

When I launch the script, it seems to build correctly, attach debugger and launch vsthost; when I load the plugin on vsthost, I see the gdb “working”, attaching the whole stuff, for example it outputs on the VSCode console:

=library-unloaded,id="C:\\Program Files\\Common Files\\VST3\\MyPluginJuce.vst3\\Contents\\x86_64-win\\MyPluginJuce.vst3",target-name="C:\\Program Files\\Common Files\\VST3\\MyPluginJuce.vst3\\Contents\\x86_64-win\\MyPluginJuce.vst3",host-name="C:\\Program Files\\Common Files\\VST3\\MyPluginJuce.vst3\\Contents\\x86_64-win\\MyPluginJuce.vst3",thread-group="i1"

But when I set a breakpoint on processBlock:

nothing stop/trigger it, and I basically can’t debug.

Where am I wrong?

Thanks for any suggestions.

Note: following this, I’ve also tried to add set(CMAKE_BUILD_TYPE Debug) on CMakeLists.txt:

image

and load on VSTHost the .vst3 on C:\repos\JUCE\MyPluginJuce\cmake-build\AudioPluginExample_artefacts\Debug\VST3\MyPluginJuce.vst3\Contents\x86_64-win\MyPluginJuce.vst3, but still can’t reach the breakpoint and trigger the debugger…

Just to rule out the obvious, is processBlock() being called? Do breakpoints work anywhere else in the code, do other debug things like DBG("some message") work as expected?

Well, I’ve add breakpoints and DBG() also on CTOR (on both PluginEditor and and PluginProcessor):

no DBG message or any breakpoint triggered :frowning:

@ImJimmi note: I’m using gdb, not lldb. Are both supported I believe?