microsoft / microsoft/vscode-cpptools
Linux LLDB cannot use integrated terminal
Nadie ha tomado este issue todavía.
- Lenguaje dominante
- TypeScript
- Estrellas
- 6.2k
- Forks
- 1.7k
- Merge medio
- 14 h 46 min
- PR fusionados (30 d)
- 61
Descripción
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 theDebug Consolepane instead of theTerminalpane, and theDebug Consolepane 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:
- Click the ‘Start Debugging’ or ‘Run Without Debugging’ menu items (I see no difference in their behaviour).
- 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
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Línea de trabajo
Reproduce el problema con los archivos proporcionados main.c y launch.json usando LLDB, comparando el comportamiento de integrated Terminal y Debug Console. Empiece en el punto de entrada de la configuración del depurador para el manejo de MIMode y externalConsole; el trabajo estará terminado cuando la salida de depuración de LLDB aparezca en el terminal integrado y el programa acepte stdin allí.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- c, vscode
- Área
- desktop, devtools
- Tipo de issue
- Error
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 45/100