microsoft / microsoft/vscode-cpptools
Running gdbserver as a `preLaunchTask` - need to press start/stop button several times
Personne n'a encore pris cette issue.
- Langage dominant
- TypeScript
- Étoiles
- 6.2k
- Forks
- 1.7k
- Merge moyen
- 14 h 46 min
- PR mergées (30 j)
- 61
Description
- VSCode Version: Code 1.14.0 (b8cd5b9556d8b70ea560d35b903422363f6c5c40, 2017-07-10T20:36:40.018Z)
- OS Version: Linux x64 4.4.0-53-generic
- Extensions:
| Extension | Author (truncated) | Version |
|---|---|---|
| vscode-docker | Pet | 0.0.16 |
| tslint | eg2 | 0.16.0 |
| language-haskell | jus | 2.3.1 |
| cpptools | ms- | 0.12.1 |
| debugger-for-chrome | msj | 3.1.6 |
| cmake | twx | 0.0.17 |
| cmake-tools | vec | 0.10.2 |
| debug | web | 0.20.0 |
| c-cpp-snippets | wlh | 0.1.0 |
Hello. Thank you for the great tool - I'm using vscode/cpptools everyday and happy with it.
Now to the problem. I have the following task in tasks.json:
{
"taskName": "docker build&run",
"linux": {
"args": [
"\"docker run --rm --privileged -p 2222:2222 -v ~/path/:/path/ -w /path/build cpp_tools bash -c 'cmake --build . && gdbserver localhost:2222 ./app'\""
]
},
"group": {
"kind": "build",
"isDefault": true
}
}
As you can see, it starts a docker container that builds an executable and runs gdbserver inside.
Here's my launch.json:
{
"version": "0.2.0",
"configurations": [
{
"name": "(gdb) remote",
"type": "cppdbg",
"request": "launch",
"preLaunchTask": "docker build&run",
"program": "${workspaceRoot}/build/app",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceRoot}/build",
"environment": [],
"externalConsole": true,
"MIMode": "gdb",
"miDebuggerServerAddress": "localhost:2222",
"sourceFileMap": {
"/path/": "~/path/"
},
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
]
}
]
}
I want to build an app and start the debug session with F5 button. The problem is that I need to press F5 twice - the first press builds an app and starts the debug server in docker container and the second press launches my application (which successfully connects). The problem appears both for F5 and Start Debugging button in GUI.
Also I have to press stop button 3 (three) times in order to stop an application (both for Shift+F5 and the Stop button in GUI).
Guide de contribution
Ouvrir le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Piste de recherche
Reproduisez le comportement à l’aide des configurations tasks.json et launch.json, en appuyant sur F5 puis en arrêtant la session comme décrit. Commencez par suivre le cycle de vie de preLaunchTask et de la session de débogage dans l’extension ; c’est terminé lorsqu’une pression sur F5 démarre la tâche et le débogueur, et qu’une action d’arrêt met fin à l’application et au serveur.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- cpp, docker
- Domaine
- developer-experience, devtools
- Type d'issue
- Bug
- Difficulté
- 3/5
- Temps estimé
- 1-2 jours
- Activité
- À l'abandon
- Clarté
- Plutôt claire
- Accessibilité débutants
- 45/100