A core feature of Visual Studio that allows developers to inspect, analyze, and troubleshoot code during execution.
Thanks for reaching out. this is a known regression in newer versions of VS code (1.111.x/1.112.x) afftecting:
- CMake Tools extension
- c/c++ debug adapter (cppdbg)
- Debug session lifecycle
What's happening internally:
- CMake triggers debug session.
- VS Code Starts debug adapter
- Debug session gets canceled before attach/ launch completes.
- No UI error-> appears like "nothing happens"
This matches the error: debugTarget Canceled
This is not a configuration issue and NOT a problem with launch.json or gdb.
Recommended fixes
- Primary Workaround (Confirmed fix) Rollback to stable version: Use VS Code 1.110.1
- Update Extensions (important) Update these to latest
- CMake Tools
- C/C++ (ms-vscode.cpptools) Because:
- Extensions depend on VS Code debug APIs
- Newer versions may include compatibility fixes.
- Disable Cmake debug integration (workaround) Instead of using CMake debug button: Run debug manually via launch.json (F5) or temporarily disable:
CMake: Debugging -> Off - Force Clean Cmake cache Sometimes cancellation is triggered by stale state:
Then:rm -rf build/- Reconfigure project
- Rebuild
- Try debugging again
- Run Without CMake(Isolation test) Try simple debug:
Update launch.jsong++ main.cpp -g -o test
if this works: Confirm issue is CMake integration + VS Code bug."program": "${workspaceFolder}/test"
if the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".