microsoft / microsoft/vscode-cpptools
Control gdb output to Debug Console
まだ誰も着手していません。
- 主要言語
- TypeScript
- スター
- 6.2k
- フォーク
- 1.7k
- 平均マージ
- 14時間 46分
- マージ済み PR(30日)
- 61
説明
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"
}
]
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
まず launch.json のログ記録設定、特に programOutput と、報告で言及されている関連する MIEngine プロジェクトを確認します。tasks.json はビルド設定のみを記述しています。GDB メッセージとプログラム出力がどこでまとめられているかを特定し、それらを独立して制御しつつ、要求された場合はプログラム出力を保持できる方法を定義します。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- cpp, typescript, vscode
- 領域
- devtools
- issue の種類
- 機能追加
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 35/100