microsoft / microsoft/vscode-cpptools
Text in "setupCommands" not properly escaped for XML
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 6.2k
- Forks
- 1.7k
- Avg merge
- 14h 46m
- Merged PRs (30d)
- 61
Description
Type: Debugger
Describe the bug
- OS and Version: Windows 10 Pro (64-bit) 10.0.19041
- Remote OS version: Ubuntu 16.04.7 LTS - Linux x64 4.19.128-microsoft-standard
- VS Code Version: Code 1.50.0
- C/C++ Extension Version: 1.0.1
- Other extensions you installed (and if the issue persists after disabling them): -
Text in setupCommands in a launch configuration is not properly escaped for use in an internally generated XML.
To Reproduce
Debug the following launch configuration in launch.json:
{
"version": "0.2.0",
"configurations": [
{
"name": "setup command text bug",
"type": "cppdbg",
"request": "launch",
"program": "/bin/cat",
"args": [], // unused for demonstration purposes
"stopAtEntry": true,
"cwd": "/bin",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
"logging": {
"engineLogging": true
},
"setupCommands": [
{
"text": "-exec-arguments </dev/null"
}
]
}
]
}
This gives the error:

It's possible that other similar settings like customLaunchSetupCommands exhibit the same issue.
Log:
1: (249) LaunchOptions<LocalLaunchOptions xmlns='http://schemas.microsoft.com/vstudio/MDDDebuggerOptions/2014'
1: (276) LaunchOptions ExePath='/bin/cat'
1: (277) LaunchOptions WorkingDirectory='/bin'
1: (277) LaunchOptions ExeArguments=''
1: (277) LaunchOptions MIMode='gdb'
1: (277) LaunchOptions MIDebuggerPath=''
1: (277) LaunchOptions WaitDynamicLibLoad='false'
1: (277) LaunchOptions>
1: (277) LaunchOptions <SetupCommands>
1: (277) LaunchOptions <Command IgnoreFailures='false' Description=''>-exec-arguments </dev/null</Command>
1: (277) LaunchOptions </SetupCommands>
1: (277) LaunchOptions</LocalLaunchOptions>
1: (356) Send Event AD7MessageEvent
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 with the launch.json reproduction and the setupCommands handling in the VS Code C/C++ extension, then run the debugger with the shown command containing <. Confirm that the internally generated XML is well-formed and that the setup command is passed through without causing the reported launch error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript, vscode
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100