From 6410ec0a03b51e52212e387bb87c9e58c10c2076 Mon Sep 17 00:00:00 2001 From: Andy Neff Date: Tue, 14 Mar 2017 19:51:29 -0400 Subject: [PATCH] Added docker example --- Documentation/Debugger/gdb/PipeTransport.md | 23 ++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/Documentation/Debugger/gdb/PipeTransport.md b/Documentation/Debugger/gdb/PipeTransport.md index 9892bee9e9..149c5966e4 100644 --- a/Documentation/Debugger/gdb/PipeTransport.md +++ b/Documentation/Debugger/gdb/PipeTransport.md @@ -26,4 +26,25 @@ You may also need to add a `sourceFileMap` to map the path of where the code exi ``` ## Attach -You can also use the above `pipeTransport` block to attach to a remote process. In the attach case, you will need to specify a `processId`. We have added the ability to query processes from the remote machine. To do this, change `"processId": "${command.pickProcess}"` to `"processId": "${command.pickRemoteProcess}"`. The `pipeTransport` settings will be used to query the processes on the remote machine. Then select the process from the drop down list. As with `launch`, you may need to configure `sourceFileMap`. \ No newline at end of file +You can also use the above `pipeTransport` block to attach to a remote process. In the attach case, you will need to specify a `processId`. We have added the ability to query processes from the remote machine. To do this, change `"processId": "${command.pickProcess}"` to `"processId": "${command.pickRemoteProcess}"`. The `pipeTransport` settings will be used to query the processes on the remote machine. Then select the process from the drop down list. As with `launch`, you may need to configure `sourceFileMap`. + +## Docker example + +The `pipeTransport` can also be used to debug a process in a Docker container. For an attach, the `launch.json` will include: + +```json + "pipeTransport": { + "pipeCwd": "${workspaceRoot}", + "pipeProgram": "docker", + "pipeArgs": [ + "exec", + "-i", + "hello_gdb", + "sh", + "-c" + ], + "debuggerPath": "/usr/bin/gdb" + }, +``` + +Launching a process is accomplished by starting a container and then using the same `pipeTransport` launch additional processes in the container. See this `[launch.json](https://github.com/andyneff/hello-world-gdb/blob/master/.vscode/launch.json)` for a [full example](https://github.com/andyneff/hello-world-gdb/) \ No newline at end of file