Skip to content

Commit

Permalink
Added docker example
Browse files Browse the repository at this point in the history
  • Loading branch information
andyneff committed Mar 14, 2017
1 parent 62a0865 commit 6410ec0
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion Documentation/Debugger/gdb/PipeTransport.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`.
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/)

0 comments on commit 6410ec0

Please sign in to comment.