Skip to content

Commit

Permalink
Merge pull request #568 from andyneff/docker
Browse files Browse the repository at this point in the history
Documentation on PipeTransport to Docker
  • Loading branch information
pieandcakes authored Mar 21, 2017
2 parents 62a0865 + 33649d6 commit d6bdf31
Showing 1 changed file with 24 additions and 1 deletion.
25 changes: 24 additions & 1 deletion Documentation/Debugger/gdb/PipeTransport.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`.
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/)

0 comments on commit d6bdf31

Please sign in to comment.