Skip to content

Commit d6bdf31

Browse files
authored
Merge pull request #568 from andyneff/docker
Documentation on PipeTransport to Docker
2 parents 62a0865 + 33649d6 commit d6bdf31

File tree

1 file changed

+24
-1
lines changed

1 file changed

+24
-1
lines changed

Documentation/Debugger/gdb/PipeTransport.md

+24-1
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,27 @@ You may also need to add a `sourceFileMap` to map the path of where the code exi
2626
```
2727

2828
## Attach
29-
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`.
29+
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`.
30+
31+
## Docker example
32+
33+
The `pipeTransport` can also be used to debug a process in a Docker container. For an attach, the `launch.json` will include:
34+
35+
```
36+
"pipeTransport": {
37+
"pipeCwd": "${workspaceRoot}",
38+
"pipeProgram": "docker",
39+
"pipeArgs": [
40+
"exec",
41+
"-i",
42+
"hello_gdb",
43+
"sh",
44+
"-c"
45+
],
46+
"debuggerPath": "/usr/bin/gdb"
47+
},
48+
```
49+
50+
Where `hello_gdb` is the name of your container.
51+
52+
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/)

0 commit comments

Comments
 (0)