microsoft / microsoft/vscode-cpptools
Issue with escaping characters in launch.json arguments
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 6.2k
- Forks
- 1.7k
- Avg merge
- 14h 46m
- Merged PRs (30d)
- 61
Description
Environment
-
OS and version: 22.04.4 LTS (Jammy Jellyfish)
-
VS Code:
Version: 1.89.1
Commit: dc96b837cf6bb4af9cd736aa3af08cf8279f7685
Date: 2024-05-07T05:16:23.416Z
Electron: 28.2.8
ElectronBuildId: 27744544
Chromium: 120.0.6099.291
Node.js: 18.18.2
V8: 12.0.267.19-electron.0
OS: Linux x64 6.5.0-35-generic snap -
C/C++ extension:
C/C++ v1.20.5
C/C++ Extension Pack v1.3.0 -
GDB / LLDB version:
GNU gdb (Ubuntu 12.1-0ubuntu1~22.04) 12.1
Command 'lldb' not found
Bug Summary and Steps to Reproduce
Description:
When configuring launch.json in VSCode, I am encountering an issue with properly escaping double quotes in my arguments. My current configuration looks like this:
{
"version": "0.2.0",
"configurations": [
{
"name": "Launch Program",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/program.exe",
# args under discussion
"cwd": "${workspaceFolder}",
"externalConsole": false,
"MIMode": "gdb"
}
]
}
Args under discussion
The result in arg I want is command "file":
- The first and most obvious args that I tried was
"args": ["-g", "command \"file\"'"]resulting in running code thatargbecomes:command fileand which is not as expectedcommand "file". - The second was
"args": ["-g", "command \\\"file\\\"'"]resulting in running code thatargbecomes:command \"file\", which is not what I want, but which is as expected. - The third try was
"args": ["-g", "command "file""]which isn't correct/allowed launch.json syntax.
Isn't there a bug luring around here in the first attempt?
Thank you in advance
Henrik Bach
Debugger Configurations
{
"name": "Debug C Program",
"type": "cppdbg", // Run
"request": "launch",
"program": "${workspaceFolder}/src/cvechecker",
# args under discussion
,"stopAtEntry": true,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
],
"preLaunchTask": "make-build",
"miDebuggerPath": "/usr/bin/gdb", // Adjust this path if necessary
"logging": {
"engineLogging": true
}
}
Debugger Logs
N/A
Other Extensions
N/A
Additional Information
No response
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 reproducing the supplied launch.json configuration with the three argument-escaping variants and inspect the argument received by the program. There are no named source files or tests in the report; done means establishing the expected escaping behavior and documenting or fixing the path that produces the incorrect argument.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp, vscode
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100