microsoft / microsoft/vscode-cpptools
Pretty Print not working
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 6.2k
- Forks
- 1.7k
- Avg merge
- 14h 46m
- Merged PRs (30d)
- 61
Description
Bug type: Debugger
-GDB version: 9.2 (installed using "apt install gdb")
- OS and Version: wsl ubuntu 20.04 running on windows 10
- VS Code Version: 1.62.3
- C/C++ Extension Version: v1.8.0-insiders
- A clear and concise description of what the bug is.
Description: Char arrays in c are not pretty-printed in vscode sidebar, but are pretty-printed when calling -exec info locals in the Debug Console (see at bottom of image).
Screenshot demonstrating error:
To Reproduce
launch.json:
{
"version": "0.2.0",
"configurations": [
{
"name": "clang - Build and debug active file",
"type": "cppdbg",
"request": "launch",
"program": "${fileDirname}/${fileBasenameNoExtension}",
"args": [],
"stopAtEntry": false,
"cwd": "${fileDirname}",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
],
"preLaunchTask": "C/C++: clang build active file",
"miDebuggerPath": "/usr/bin/gdb"
}
]
}
tasks.json:
{
"version": "2.0.0",
"tasks": [
{
"type": "cppbuild",
"label": "C/C++: clang build active file",
"command": "/usr/bin/clang",
"args": [
"-fdiagnostics-color=always",
"-g",
"${file}",
"-o",
"${fileDirname}/${fileBasenameNoExtension}"
],
"options": {
"cwd": "${fileDirname}"
},
"problemMatcher": [
"$gcc"
],
"group": {
"kind": "build",
"isDefault": true
},
"detail": "compiler: /usr/bin/clang"
}
]
}
main.c:
int main() {
char str[5] = "test";
return 0;
}
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 sidebar behavior with main.c, launch.json, and tasks.json under the reported GDB, WSL Ubuntu, and VS Code versions. Compare the sidebar with the Debug Console's -exec info locals; done means the char array is displayed consistently in the sidebar as well.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c, vscode
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100