I am trying to debug a C++ application on Windows that has been started by a python script. I am able to attach to the process using GDB from command line and everything works fine.
However, when trying to use VS Code to attach GDB, it manages attach, but all the breakpoints are stuck on Attempting to bind to the breakpoint... and trying to execute a command in the debug console returns Unable to perform this action because the process is running..
This is my launch.json configuration:
{
"name": "(gdb) Attach",
"type": "cppdbg",
"request": "attach",
"program": "${workspaceFolder}\\build\\program.exe",
"processId": "${command:pickProcess}",
"MIMode": "gdb",
"miDebuggerPath": "C:\\Program Files (x86)\\mingw-w64\\i686-8.1.0-posix-dwarf-rt_v6-rev0\\mingw32\\bin\\gdb.exe",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
]
}
I assume that VS code is doing something extra/weird when starting GDB, is there a way to fix this?