microsoft / microsoft/vscode-cmake-tools

Unable to launch debugger

Open
#4,211 3 comments 0 reactions 0 assignees View on GitHub
more info needed
Dominant language
TypeScript
Stars
1.7k
Forks
546
Avg merge
2d 16h
Merged PRs (30d)
32

Description

### Brief Issue Summary

Launching debugger for the selected target does not work. After multiple reloads of VS Code it will eventually work. There is no issue building or launching the target, only when debugging.

I am connected to a docker container through VS Code.

### CMake Tools Diagnostics

```shell
{
"os": "linux",
"vscodeVersion": "1.95.3",
"cmtVersion": "1.20.30",
"configurations": [
{
"folder": "/workarea",
"cmakeVersion": "3.31.0",
"configured": true,
"generator": "Ninja",
"usesPresets": false,
"compilers": {
"C": "/opt/bb/bin/gcc",
"CXX": "/opt/bb/bin/g++"
}
}
],
"cpptoolsIntegration": {
"isReady": false,
"hasCodeModel": false,
"activeBuildType": "",
"buildTypesSeen": [],
"requests": [],
"responses": [],
"partialMatches": [],
"targetCount": 0,
"executablesCount": 0,
"librariesCount": 0,
"targets": []
},
"settings": [
{
"communicationMode": "automatic",
"useCMakePresets": "auto",
"configureOnOpen": false
}
]
}
```

### Debug Log

```shell
When trying to launch the debugger:
[extension] [1222] cmake.debugTarget finished (returned undefined)

Possibly related, when trying to set the build target:
[extension] [2831] cmake.setDefaultTarget finished (returned undefined)
```

### Additional Information

Selecting the launch target does not have the same issue:
```
[extension] [3327] cmake.selectLaunchTarget finished (returned "/home/nobody/buildarea/___/___.exe")
```

_No response_

Contributor guide

Open the contributing guide

Research direction

Start by tracing the cmake.debugTarget and cmake.setDefaultTarget operations, using the CMake Tools Diagnostics and debug log in the issue as the initial reproduction context. Compare them with the successful cmake.selectLaunchTarget operation in a VS Code-connected Docker container. Done means the selected target can consistently launch under the debugger without reloads.

Written by the indexing model from the issue text.

Assessment

Tech stack
cmake, docker, typescript, vscode
Domain
build-system, developer-experience, devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.