microsoft / microsoft/vscode-cpptools
Control gdb output to Debug Console
Nessuno ha ancora preso questa issue.
- Lingua principale
- TypeScript
- Stelle
- 6.2k
- Fork
- 1.7k
- Merge medio
- 14h 46m
- PR unite (30g)
- 61
Descrizione
Type: Debugger
- OS and Version: Windows 10.0. 4393 x64
- VS Code Version: 1.25.1
- C/C++ Extension Version: 0.17.6
- Using mingw-w64 8.1.0
Using a minimal example for a sample program:
#include <iostream>
int main() {
std::cout << "Hello, world!" << std::endl;
return 0;
}
It would be nice to have more control over what gdb messages are printed in the Debug Console.
launch.json provides logging options for moduleLoad, engineLogging, trace, exceptions, programOutput, traceResponse, but it seems as though most gdb messages are grouped under programOutput. Sometimes I just want to see my program output when debugging, without the clutter from other gdb commands/events, but I haven't found a way to achieve that.
Adding --silent to miDebuggerArgs and set print thread-events off to setupCommands can turn off the gdb startup message and New thread/Thread exited messages in the Debug Console. But unless I completely disable programOutput (and lose the output stream), the following gets printed on every run:
=thread-group-added,id="i1"
Warning: Debuggee TargetArchitecture not detected, assuming x86_64.
=cmd-param-changed,param="pagination",value="off"
=library-unloaded,id<...>
=library-unloaded,id<...>
...
It can be very verbose, and I haven't been able to find a way to disable it using gdb commands.
I'm not sure whether this request is best suited for here or the MIEngine project?
For reference, full launch and tasks configurations:
launch.json
"configurations": [
{
"preLaunchTask": "Build gcc",
"name": "(gdb) Launch",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceRoot}/build/${fileBasenameNoExtension}.exe",
"args": [],
"stopAtEntry": true,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": false,
"internalConsoleOptions": "openOnSessionStart",
"MIMode": "gdb",
"miDebuggerPath": "C:/MinGW/mingw64/bin/gdb.exe",
"miDebuggerArgs": "--silent",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
},
{
"description": "Reduce gdb verbosity",
"text": "set print thread-events off",
"ignoreFailures": true
}
],
"logging": {
"moduleLoad": false,
"engineLogging": false,
"trace": false,
"exceptions": false,
"programOutput": true,
"traceResponse": false
}
}
]
tasks.json
"tasks": [
{
"label": "Build gcc",
"type": "shell",
"command": "g++",
"args": [
"-ggdb",
"\"${relativeFile}\"",
"-o",
"\"build/${fileBasenameNoExtension}.exe\""
],
"problemMatcher": [
"$gcc"
],
"group": "build"
}
]
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Inizia esaminando la configurazione di logging di launch.json, in particolare programOutput, e il progetto MIEngine correlato menzionato nel report; tasks.json descrive solo la configurazione della build. Determina dove vengono raggruppati i messaggi di GDB e l'output del programma, quindi definisci un modo per controllarli indipendentemente, preservando l'output del programma quando richiesto.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- cpp, typescript, vscode
- Ambito
- devtools
- Tipo di issue
- Funzionalità
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 35/100