microsoft / microsoft/vscode-cpptools

Linux LLDB cannot use integrated terminal

Offen
#6,715 4 Kommentare 10 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

debugger Feature Request
Vorherrschende Sprache
TypeScript
Sterne
6.2k
Forks
1.7k
Ø Merge
14 Std. 46 Min.
Gemergte PRs (30 T.)
61

Beschreibung

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

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Reproduzieren Sie das Problem mit den bereitgestellten Dateien main.c und launch.json unter Verwendung von LLDB und vergleichen Sie das Verhalten von integriertem Terminal und Debug Console. Beginnen Sie am Einstiegspunkt der Debugger-Konfiguration für die Behandlung von MIMode und externalConsole; abgeschlossen ist die Aufgabe, wenn die LLDB-Debugausgabe im integrierten Terminal erscheint und das Programm dort stdin akzeptiert.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
c, vscode
Bereich
desktop, devtools
Issue-Typ
Bug
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
45/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.