Share via

Debugger not launching in vscode

Rasmus Ballmer 0 Reputation points
2026-03-24T19:10:27.3866667+00:00

I recently updated vscode to version 1.112.1, and all of a sudden I wasn't able to start debugging.

Neither debugging via F5 (vscode launcher), nor via the debug button of cmake worked. Also my python debug configuration didn't work.

I created a request in stack overflow https://stackoverflow.com/questions/79913278/c-c-debugger-not-launching-in-vscode, where I tried to get help and described the problem.

In the end only switching back to version 1.110.1 helped (in 1.111.1 the issue still existed)

Developer technologies | Visual Studio | Debugging
0 comments No comments

2 answers

Sort by: Most helpful
  1. Adiba Khan 2,345 Reputation points Microsoft External Staff
    2026-03-25T11:14:12.7466667+00:00

    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

    1. Primary Workaround (Confirmed fix) Rollback to stable version: Use VS Code 1.110.1
    2. Update Extensions (important) Update these to latest
      1. CMake Tools
      2. C/C++ (ms-vscode.cpptools) Because:
      3. Extensions depend on VS Code debug APIs
      4. Newer versions may include compatibility fixes.
    3. Disable Cmake debug integration (workaround) Instead of using CMake debug button: Run debug manually via launch.json (F5) or temporarily disable:
         CMake: Debugging -> Off 
      
    4. Force Clean Cmake cache Sometimes cancellation is triggered by stale state:
         rm -rf build/
      
      Then:
      1. Reconfigure project
      2. Rebuild
      3. Try debugging again
    5. Run Without CMake(Isolation test) Try simple debug:
         g++ main.cpp -g -o test
      
      Update launch.json
         "program": "${workspaceFolder}/test"
      
      if this works: Confirm issue is CMake integration + VS Code bug.

    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". 


  2. Q&A Assist
    2026-03-24T19:10:49.6466667+00:00
    AI generated content. This question contains an answer created with AI from Q&A Assist. Learn more

    The issue description matches a regression in recent tooling where the debugger fails to attach or start correctly after an update. There is no specific documented fix in the provided context for Visual Studio Code 1.112.1, but the following patterns from similar debugging issues apply:

    1. Use a configuration that is known to work In a similar case with Visual Studio and .NET 10, the only reliable workaround was to switch to a different platform target for debugging (for example, x86 instead of Any CPU/x64) until the product team fixed the regression. Applying the same idea in VS Code:
      • For C/C++: in launch.json, temporarily force a different architecture or debugger type if available (for example, use a configuration that targets a different debugger backend or platform).
      • For .NET: ensure the launch configuration uses a specific runtime/architecture that is known to work.
    2. Stay on the last known-good version As already discovered, rolling back to 1.110.1 restores debugging. This is consistent with the guidance from similar issues where the product team is still investigating and the recommended action is to stay on the last stable version until a fix is released.
    3. Verify basic debugging flow still works in the working version When on a working VS Code version, confirm that standard debug flows behave as expected:
      • Open the Run and Debug view and start debugging via Run and Debug or F5, as described in the .NET console debugging tutorial.
      • Set breakpoints, start the debugger, and verify that execution stops at breakpoints and variables are visible in the Variables window.
      • For C/C++ or other languages, follow the same pattern: set a breakpoint, start debugging (F5), and ensure the debugger attaches and stops at the breakpoint.
    4. Monitor for a product fix Because the problem appears only after updating VS Code and affects multiple debug types (C/C++, CMake, Python), the root cause is likely in the VS Code/debugger integration itself rather than in individual extensions or projects. The practical path is:
      • Keep using 1.110.1 (or any later version where the issue is fixed) for active debugging.
      • Periodically test newer VS Code versions in a separate install or profile to see when the regression is resolved.

    If debugging must work immediately on 1.112.1 and no configuration change restores it, the supported workaround based on the available context is to remain on the last version where debugging functions correctly, analogous to using a specific working configuration/architecture in Visual Studio until a debugger bug is fixed.


    References:

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.