microsoft / microsoft/vscode-cpptools

Debug session cannot be started a second time, extension re-installation required

Open
#8,371 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

debugger
Dominant language
TypeScript
Stars
6.2k
Forks
1.7k
Avg merge
14h 46m
Merged PRs (30d)
61

Description

Bug type: Debugger

Describe the bug

  • OS and Version: RHEL 7.6
  • VS Code Version: 1.6.1.0
  • C/C++ Extension Version: v1.7.1

I can successfully start a first debugging session of my C++ binary.
After stopping it, I cannot start anymore a debug session: the bottom bar turns orange and immediately back to normal.
Nothing seems to be logged anywhere, even with all logs enabled.
I have to uninstall the ms-vscode.cpptools extension, reload VSCode, and re-install the extension to debug again.
The problem is the same after the re-installation.

Here is my launch.json:

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "mdsystem-tests",
            "type": "cppdbg",
            "request": "launch",
            "program": "/tmp/mdsystem",
            "args": [],
            "stopAtEntry": false,
            "cwd": "${workspaceFolder}",
            "envFile": "${workspaceFolder}/.vscode/debug.env",
            "externalConsole": false,
            "MIMode": "gdb",
            "setupCommands": [
                {
                    "description": "Enable pretty-printing for gdb",
                    "text": "-enable-pretty-printing",
                    "ignoreFailures": true
                }
            ],
            "logging": {
                "engineLogging": true,
                "exceptions": true,
                "moduleLoad": true,
                "programOutput": true,
                "trace": true,
                "traceResponse": true,
            }
        }
    ]
}

I have recorded the issue:

  • Starting a debug session by pressing F5 to show that it works fine the first time
  • The debugger starts, logs in the debug console and the breakpoint is hit as expected
  • Disconnecting by pressing the red stop button in the debug menu bar
  • Pressing F5 after that does not work anymore

https://user-images.githubusercontent.com/4199392/140548203-ecb0fea5-7acb-4a2f-98ca-320b477bcd01.mp4

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the failure with the supplied launch.json: start debugging with F5, stop using the red button, then press F5 again. Compare the debug console and enabled engine, exception, module-load, program-output, trace, and trace-response logs; done means a second session starts without reinstalling the extension.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, typescript, vscode
Domain
devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.