microsoft / microsoft/DebugMCP
DebugMCP incorrectly infers .exe target on WSL instead of using existing launch.json program
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 511
- Forks
- 60
- Avg merge
- 2d 1h
- Merged PRs (30d)
- 18
Description
Environment
- VS Code: 1.119.0
- Platform: Linux (WSL / Dev Container)
- Architecture: x64
- DebugMCP server running successfully
- C/C++ extension installed (
ms-vscode.cpptools) - Debug adapter:
cppdbg - Debugger:
gdb
Problem
DebugMCP fails to start an existing C/C++ debug configuration on WSL/Linux.
Manual debugging with F5 works correctly using the existing launch.json.
However, when DebugMCP attempts to start the debug session, it appears to ignore or override the configured "program" field and instead derives a Windows-style executable name from the source file.
It attempts to launch:
/workspaces/ubuntu-c3c/nanopb/build-tests/legacy_cmake_simple/simple.exe
which does not exist.
The real executable is:
/workspaces/ubuntu-c3c/nanopb/build-tests/legacy_cmake_simple/build/simple
Existing launch.json
{
"name": "Debug nanopb simple",
"type": "cppdbg",
"request": "launch",
"program": "/workspaces/ubuntu-c3c/nanopb/build-tests/legacy_cmake_simple/build/simple",
"cwd": "/workspaces/ubuntu-c3c/nanopb/build-tests/legacy_cmake_simple/build",
"MIMode": "gdb",
"miDebuggerPath": "/usr/bin/gdb"
}
Observed behavior
DebugMCP agent output references:
{
"fileFullPath": "/workspaces/ubuntu-c3c/nanopb/build-tests/legacy_cmake_simple/simple.c",
"workingDirectory": "/workspaces/ubuntu-c3c/nanopb/build-tests/legacy_cmake_simple",
"configurationName": "Debug nanopb simple"
}
and then attempts to launch:
simple.exe
instead of using the configured "program" value from launch.json.
Expected behavior
DebugMCP should:
- Use the existing VS Code debug configuration exactly as defined
- Respect the
"program"field fromlaunch.json - Avoid generating
.exetargets on Linux/WSL environments - Avoid inferring executables from source filenames when a valid launch configuration already exists
Additional notes
- Starting the debug session manually with
F5works perfectly - Breakpoints work correctly
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by examining how the existing launch.json configuration named "Debug nanopb simple" is selected and how its fileFullPath and workingDirectory are converted into a debug target. Reproduce the WSL case with the provided cppdbg configuration, then verify that the configured program path is used and no simple.exe target is generated.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp, typescript, vscode
- Domain
- devtools, operating-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100