From 6410ec0a03b51e52212e387bb87c9e58c10c2076 Mon Sep 17 00:00:00 2001 From: Andy Neff Date: Tue, 14 Mar 2017 19:51:29 -0400 Subject: [PATCH 1/5] 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 From fde8d577a3b8753446ba440c26bf4089ea0c8e02 Mon Sep 17 00:00:00 2001 From: Andy Neff Date: Tue, 14 Mar 2017 19:54:32 -0400 Subject: [PATCH 2/5] Update PipeTransport.md --- Documentation/Debugger/gdb/PipeTransport.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/Debugger/gdb/PipeTransport.md b/Documentation/Debugger/gdb/PipeTransport.md index 149c5966e4..4cc170dc47 100644 --- a/Documentation/Debugger/gdb/PipeTransport.md +++ b/Documentation/Debugger/gdb/PipeTransport.md @@ -47,4 +47,4 @@ The `pipeTransport` can also be used to debug a process in a Docker container. F }, ``` -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 +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/) From 13375a7b899cdef64207b6d8b17fe2daa0627ef1 Mon Sep 17 00:00:00 2001 From: Andy Neff Date: Tue, 14 Mar 2017 19:55:32 -0400 Subject: [PATCH 3/5] Update PipeTransport.md --- Documentation/Debugger/gdb/PipeTransport.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Documentation/Debugger/gdb/PipeTransport.md b/Documentation/Debugger/gdb/PipeTransport.md index 4cc170dc47..928687cee3 100644 --- a/Documentation/Debugger/gdb/PipeTransport.md +++ b/Documentation/Debugger/gdb/PipeTransport.md @@ -47,4 +47,6 @@ The `pipeTransport` can also be used to debug a process in a Docker container. F }, ``` +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/) From e8e80cc4a4a62fc007d7511bda03d95408dd6edf Mon Sep 17 00:00:00 2001 From: Andy Neff Date: Tue, 14 Mar 2017 19:55:53 -0400 Subject: [PATCH 4/5] Update PipeTransport.md --- Documentation/Debugger/gdb/PipeTransport.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Documentation/Debugger/gdb/PipeTransport.md b/Documentation/Debugger/gdb/PipeTransport.md index 928687cee3..ab2e141c5f 100644 --- a/Documentation/Debugger/gdb/PipeTransport.md +++ b/Documentation/Debugger/gdb/PipeTransport.md @@ -3,7 +3,7 @@ Pipe Transport allows communication through a pipe program to a remote shell. An ## How-To We have added `"pipeTransport"` as an option within the `launch.json` file. The structure looks as follows: -``` +```json "pipeTransport": { "pipeCwd": "/usr/bin", "pipeProgram": "/usr/bin/ssh", @@ -18,7 +18,7 @@ We have added `"pipeTransport"` as an option within the `launch.json` file. The The `pipeArgs` can be any set of arguments necessary to setup and authenticate the pipe connection. In the example, a password is used but you can also use an ssh key. You may also need to add a `sourceFileMap` to map the path of where the code exists on the remote shell to where it is locally: -``` +```json "sourceFileMap": { // "remote": "local" "/home/user/src": "/src/projectA/src" From 33649d6eb4037732401efa126b7ffc275c8a77fc Mon Sep 17 00:00:00 2001 From: Andy Neff Date: Tue, 14 Mar 2017 19:56:53 -0400 Subject: [PATCH 5/5] Update PipeTransport.md --- Documentation/Debugger/gdb/PipeTransport.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Documentation/Debugger/gdb/PipeTransport.md b/Documentation/Debugger/gdb/PipeTransport.md index ab2e141c5f..4c863208bf 100644 --- a/Documentation/Debugger/gdb/PipeTransport.md +++ b/Documentation/Debugger/gdb/PipeTransport.md @@ -3,7 +3,7 @@ Pipe Transport allows communication through a pipe program to a remote shell. An ## How-To We have added `"pipeTransport"` as an option within the `launch.json` file. The structure looks as follows: -```json +``` "pipeTransport": { "pipeCwd": "/usr/bin", "pipeProgram": "/usr/bin/ssh", @@ -18,7 +18,7 @@ We have added `"pipeTransport"` as an option within the `launch.json` file. The The `pipeArgs` can be any set of arguments necessary to setup and authenticate the pipe connection. In the example, a password is used but you can also use an ssh key. You may also need to add a `sourceFileMap` to map the path of where the code exists on the remote shell to where it is locally: -```json +``` "sourceFileMap": { // "remote": "local" "/home/user/src": "/src/projectA/src" @@ -32,7 +32,7 @@ You can also use the above `pipeTransport` block to attach to a remote process. 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",