microsoft / microsoft/vscode-cpptools

Linux LLDB cannot use integrated terminal

Aperta
#6,715 4 commenti 10 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

debugger Feature Request
Lingua principale
TypeScript
Stelle
6.2k
Fork
1.7k
Merge medio
14h 46m
PR unite (30g)
61

Descrizione

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

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Riproduci il problema con i file forniti main.c e launch.json usando LLDB, confrontando il comportamento di integrated Terminal e Debug Console. Inizia dal punto di ingresso della configurazione del debugger per la gestione di MIMode ed externalConsole; il lavoro è completato quando l'output di debug di LLDB appare nel terminale integrato e il programma accetta stdin al suo interno.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
c, vscode
Ambito
desktop, devtools
Tipo di issue
Bug
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
45/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.