microsoft / microsoft/vscode-cpptools

Linux LLDB cannot use integrated terminal

オープン
#6,715 コメント 4 件 リアクション 10 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

debugger Feature Request
主要言語
TypeScript
スター
6.2k
フォーク
1.7k
平均マージ
14時間 46分
マージ済み PR(30日)
61

説明

Type: Debugger

Description

  • OS and Version: system: "x86_64-linux", multi-user?: yes, version: nix-env (Nix) 2.3.9, channels(twey): "home-manager", channels(root): "nixos-21.03pre257780.e9158eca70a", nixpkgs: /nix/var/nix/profiles/per-user/root/channels/nixos
  • VS Code Version: 1.51.1 (also reproduced on 1.52 on macOS)
  • C/C++ Extension Version: 1.1.3
  • Other extensions you installed (and if the issue persists after disabling them): none
  • A clear and concise description of what the bug is: when using lldb, all debug output appears in the Debug Console pane instead of the Terminal pane, and the Debug Console pane does not support entering user input (stdin).

Reproduction

main.c:

#include <stdio.h>

int main(int argc, char ** argv) {
    printf("Hello, world!\n");
    char s[128];
    int n = scanf("%s", s);
    printf("\"%s\"\n", s);
}

launch.json (as generated, except to remove the path to lldb-mi, which is incorrect on my system):

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "clang - Build and debug active file",
            "type": "cppdbg",
            "request": "launch",
            "program": "${fileDirname}/${fileBasenameNoExtension}",
            "args": [],
            "stopAtEntry": false,
            "cwd": "${workspaceFolder}",
            "environment": [],
            "externalConsole": false,
            "MIMode": "lldb",
            "setupCommands": [
                {
                    "description": "Enable pretty-printing for gdb",
                    "text": "-enable-pretty-printing",
                    "ignoreFailures": true
                }
            ],
            "preLaunchTask": "C/C++: clang build active file"
        }
    ]
}

Steps to reproduce the behaviour:

  1. Click the ‘Start Debugging’ or ‘Run Without Debugging’ menu items (I see no difference in their behaviour).
  2. Observe the ‘Terminal’ and ‘Debug Console’ panes.

Expected behaviour

Output from the program appears in the integrated terminal window, and I can type into the integrated terminal window to provide input to the program on stdin.
(This is the behaviour with GDB, if I just change "MIMode": "lldb" to "MIMode": "gdb")

Observed behaviour

All program output appears on the Debug Console, where it is written as an NSString literal:

Warning: Debuggee TargetArchitecture not detected, assuming x86_64.
=thread-selected,id="1"
Loaded '/nix/store/9l06v7fc38c1x3r2iydl15ksgz0ysb82-glibc-2.32/lib/ld-2.32.so'. Symbols loaded.
Loaded '[vdso]'. Cannot find or open the symbol file.
Loaded '/tmp/hello/main'. Symbols loaded.
Loaded '/nix/store/9l06v7fc38c1x3r2iydl15ksgz0ysb82-glibc-2.32/lib/libc.so.6'. Symbols loaded.
@"Hello, world!\r\n"

Any attempt to provide input as I would were I running lldb directly (using -exec or by typing directly into the Debug Console command line) is met with:

Unable to perform this action because the process is running.

and thus there is no way for the user to provide stdin input to the program.

Possibly related issues:
https://github.com/microsoft/vscode-cpptools/issues/5079
https://github.com/microsoft/vscode-cpptools/issues/3968
https://github.com/microsoft/vscode-cpptools/issues/5491

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

提供された main.c と launch.json を使用し、LLDB で問題を再現して、integrated Terminal と Debug Console の動作を比較します。MIMode と externalConsole の処理に関するデバッガー設定のエントリーポイントから開始します。LLDB のデバッグ出力が統合ターミナルに表示され、プログラムがそこで stdin を受け付けるようになれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
c, vscode
領域
desktop, devtools
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
45/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。