microsoft / microsoft/vscode-cpptools
Running gdbserver as a `preLaunchTask` - need to press start/stop button several times
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- TypeScript
- Sterne
- 6.2k
- Forks
- 1.7k
- Ø Merge
- 14 Std. 46 Min.
- Gemergte PRs (30 T.)
- 61
Beschreibung
- 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).
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Reproduziere das Verhalten mit den Konfigurationen tasks.json und launch.json, indem du wie beschrieben F5 drückst und anschließend die Sitzung stoppst. Beginne damit, den Lebenszyklus von preLaunchTask und der Debug-Sitzung in der Erweiterung nachzuverfolgen; erledigt ist die Aufgabe, wenn ein Druck auf F5 die Aufgabe und den Debugger startet und eine Stoppaktion die Anwendung und den Server beendet.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- cpp, docker
- Bereich
- developer-experience, devtools
- Issue-Typ
- Bug
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 45/100