diff --git a/Documentation/Debugger/gdb/PipeTransport.md b/Documentation/Debugger/gdb/PipeTransport.md index 9892bee9e9..4c863208bf 100644 --- a/Documentation/Debugger/gdb/PipeTransport.md +++ b/Documentation/Debugger/gdb/PipeTransport.md @@ -26,4 +26,27 @@ 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: + +``` + "pipeTransport": { + "pipeCwd": "${workspaceRoot}", + "pipeProgram": "docker", + "pipeArgs": [ + "exec", + "-i", + "hello_gdb", + "sh", + "-c" + ], + "debuggerPath": "/usr/bin/gdb" + }, +``` + +Where `hello_gdb` is the name of your container. + +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/)