microsoft / microsoft/vscode-cpptools
Pretty Print not working
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- TypeScript
- Sterne
- 6.2k
- Forks
- 1.7k
- Ø Merge
- 14 Std. 46 Min.
- Gemergte PRs (30 T.)
- 61
Beschreibung
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;
}
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne damit, das Verhalten der Seitenleiste mit main.c, launch.json und tasks.json unter den gemeldeten Versionen von GDB, WSL Ubuntu und VS Code zu reproduzieren. Vergleiche die Seitenleiste mit -exec info locals in der Debug Console; als erledigt gilt, dass das char-Array auch in der Seitenleiste konsistent angezeigt wird.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- c, vscode
- Bereich
- devtools
- Issue-Typ
- Bug
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 42/100