microsoft / microsoft/vscode-cpptools
Feature Request to customize psLinuxCommand
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
I would like the ability to customize the psLinuxCommand, since the current psLinuxCommand does not work on all Linuxes
The ps command ps -axww -o pid=,comm=${PsProcessParser.commColumnTitle},args= used in nativeAttach.js does not work on all Linuxes. For example when using pipeTransport to an alpine distribution, xww is not supported. Since there are bound to be many similar situations, would it be possible to expose a custom ps command to the launch.json.
Right now when I run into this problem, I just can't use ${command:pickRemoteProcess}. If I could write my own custom ps command, then I could try and figure out a way to list all processes, with the processname padded to 80 characters, etc..
Most gdbs are complied with python, and it is not to difficult to write a gdb command that embedded executes python to accomplish this.
This is crude and for a slightly different objective, but the idea is the same (I wouldn't use info os processes again, it's unreliable among all OSes):
var psCommand = "gdb -q -ex 'target extended-remote "+address+"' "
psCommand += "-ex 'python import tempfile; tmp=tempfile.NamedTemporaryFile(); gdb.execute(\"set logging file \"+tmp.name)' "
//Create a temp file for logging so that the output of gdb commands go to temp file
psCommand += "-ex 'set logging on' "
//turn on logging
psCommand += "-ex 'info os processes' "
//Get list of processed
psCommand += "-ex 'set logging off' "
//Turn off loggging
psCommand += "-ex 'python pids = open(tmp.name, \"r\").readlines()[1:]; import sys; [sys.stdout.write(\"%s %"+PsAttachItemsProvider.secondColumnCharacters+"s %s\\n\" % tuple(pid.split(None, 2))) for pid in pids]' "
//Read in file, parse, and output it in an identical ps format
psCommand += "-ex disconnect "
psCommand += "-ex q"
return common_1.execChildProcess(psCommand, null).then(function (processes) {
return _this.parseProcessFromPs(processes.split("\nDone logging")[1].split('\nEnding remote debugging.')[0]);
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
Comienza con nativeAttach.js y la ruta de configuración launch.json; después, sigue cómo ${command:pickRemoteProcess} invoca el comando ps y cómo parseProcessFromPs consume su salida. Se considera terminado cuando se puede configurar un comando personalizado para listar procesos Linux remotos y la selección de procesos existente sigue funcionando.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- javascript, typescript
- Área
- tooling
- Tipo de issue
- Nueva funcionalidad
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 35/100