[vscode-go] debugging.md: add a note about using --continue with remote server

44 views
Skip to first unread message

Gerrit Dou (Gerrit)

unread,
Dec 28, 2021, 7:06:15 PM12/28/21
to goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

Gerrit Dou has uploaded this change for review.

View Change

debugging.md: add a note about using --continue with remote server

Updates https://github.com/go-delve/delve/issues/2323

Change-Id: I4c89c299ffa569bb3ecbcb0e730f2f7ad04e16d8
GitHub-Last-Rev: 139ba7cd8de4a0562372f7e96c69ae69295eb97c
GitHub-Pull-Request: golang/vscode-go#1979
---
M docs/debugging.md
1 file changed, 16 insertions(+), 3 deletions(-)

diff --git a/docs/debugging.md b/docs/debugging.md
index 4019f80..0a7d643 100644
--- a/docs/debugging.md
+++ b/docs/debugging.md
@@ -379,13 +379,13 @@

In this mode the user must first manually start a [`dlv --headless`](https://github.com/go-delve/delve/tree/master/Documentation/api) server listening at `host:port` while specifying the target program to debug/test/exec or a process to attach to on the command-line. A [remote attach](#attach) configuration is then used to connect to the debugger with a running target.

-The [headless dlv server](https://github.com/go-delve/delve/tree/master/Documentation/api) can now be used with both `"debugAdapter": "legacy"` (default value) and `"debugAdapter": "dlv-dap"` (with Delve v1.7.3 or newer) as well as Delve's [command-line interface](https://github.com/go-delve/delve/tree/master/Documentation/cli) via `dlv connect`. The `--accept-multiclient` flag can be used to make this a multi-use server that persists on `Disconnect` from a client and allows repeated client connections. Please see `dlv --help` and `dlv [command] --help` for dlv's command-line options.
+The [headless dlv server](https://github.com/go-delve/delve/tree/master/Documentation/api) can now be used with both `"debugAdapter": "legacy"` (default value) and `"debugAdapter": "dlv-dap"` (with Delve v1.7.3 or newer) as well as Delve's [command-line interface](https://github.com/go-delve/delve/tree/master/Documentation/cli) via `dlv connect`. The `--accept-multiclient` flag makes this a multi-use server that persists on `Disconnect` from a client and allows repeated connections from any of the aforementioned clients. A combination of `--accept-multiclient --continue` flags can be used to resume process execution on start-up. Please see `dlv --help` and `dlv [command] --help` for dlv's command-line options.

We encourage you to give the newly added `"debugAdapter": "dlv-dap"` support a try and to [let us know of any issues](https://github.com/golang/vscode-go/issues/new). If you need to use the `legacy` mode, pleasse also see the [legacy remote debugging](https://github.com/golang/vscode-go/blob/master/docs/debugging-legacy.md#remote-debugging) documentation.

For example, start external headless server:
```
-dlv debug /path/to/program/ --headless --listen=:12345
+dlv debug /path/to/program/ --headless --listen=:12345 # also add as needed: --accept-multiclient --continue
```

Connect to it with a remote attach configuration in your `launch.json`:
@@ -447,7 +447,7 @@
```

⚠️ Limitations
-* Delve DAP does not support `--accept-multiclient` or `--continue` flags, which means after a debug session ends, the dlv-dap process will always exit.
+* Unliked `dlv --headless` above, `dlv dap` does not support `--accept-multiclient` or `--continue` flags, which means after a debug session ends, the dlv-dap process will always exit.
* If you use `debug` or `test` mode `launch` requests, Delve builds the target binary. Delve tries to build the target from the directory where the `dlv` (or `dlv-dap`) process is running, so make sure to run the `dlv-dap` command from the directory you would run the `go build` or `go test` command.

### Running Debugee Externally

To view, visit change 374615. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: vscode-go
Gerrit-Branch: master
Gerrit-Change-Id: I4c89c299ffa569bb3ecbcb0e730f2f7ad04e16d8
Gerrit-Change-Number: 374615
Gerrit-PatchSet: 1
Gerrit-Owner: Gerrit Dou <letsus...@gmail.com>
Gerrit-MessageType: newchange

Hyang-Ah Hana Kim (Gerrit)

unread,
Dec 29, 2021, 12:29:44 AM12/29/21
to Gerrit Dou, goph...@pubsubhelper.golang.org, Hyang-Ah Hana Kim, Suzy Mueller, Polina Sokolova, Gopher Robot, golang-co...@googlegroups.com

Attention is currently required from: Suzy Mueller.

Patch set 1:Code-Review +2

View Change

1 comment:

To view, visit change 374615. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: vscode-go
Gerrit-Branch: master
Gerrit-Change-Id: I4c89c299ffa569bb3ecbcb0e730f2f7ad04e16d8
Gerrit-Change-Number: 374615
Gerrit-PatchSet: 1
Gerrit-Owner: Gerrit Dou <letsus...@gmail.com>
Gerrit-Reviewer: Hyang-Ah Hana Kim <hya...@gmail.com>
Gerrit-Reviewer: Suzy Mueller <suz...@golang.org>
Gerrit-CC: Gopher Robot <go...@golang.org>
Gerrit-CC: Polina Sokolova <pol...@google.com>
Gerrit-Attention: Suzy Mueller <suz...@golang.org>
Gerrit-Comment-Date: Wed, 29 Dec 2021 05:29:39 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment

Polina Sokolova (Gerrit)

unread,
Dec 29, 2021, 4:09:26 AM12/29/21
to Gerrit Dou, goph...@pubsubhelper.golang.org, Hyang-Ah Hana Kim, Suzy Mueller, Gopher Robot, golang-co...@googlegroups.com

Attention is currently required from: Suzy Mueller.

View Change

1 comment:

  • File docs/debugging.md:

    • Done

To view, visit change 374615. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: vscode-go
Gerrit-Branch: master
Gerrit-Change-Id: I4c89c299ffa569bb3ecbcb0e730f2f7ad04e16d8
Gerrit-Change-Number: 374615
Gerrit-PatchSet: 1
Gerrit-Owner: Gerrit Dou <letsus...@gmail.com>
Gerrit-Reviewer: Hyang-Ah Hana Kim <hya...@gmail.com>
Gerrit-Reviewer: Suzy Mueller <suz...@golang.org>
Gerrit-CC: Gopher Robot <go...@golang.org>
Gerrit-CC: Polina Sokolova <pol...@google.com>
Gerrit-Attention: Suzy Mueller <suz...@golang.org>
Gerrit-Comment-Date: Wed, 29 Dec 2021 09:09:20 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Hyang-Ah Hana Kim <hya...@gmail.com>
Gerrit-MessageType: comment

Gerrit Dou (Gerrit)

unread,
Dec 29, 2021, 4:10:44 AM12/29/21
to goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

Attention is currently required from: Suzy Mueller.

Gerrit Dou uploaded patch set #2 to this change.

View Change

debugging.md: add a note about using --continue with remote server

Updates https://github.com/go-delve/delve/issues/2323

Change-Id: I4c89c299ffa569bb3ecbcb0e730f2f7ad04e16d8
GitHub-Last-Rev: 26bb7f9eb0cdb29dcd820f91562b3c60b8313a31

GitHub-Pull-Request: golang/vscode-go#1979
---
M docs/debugging.md
1 file changed, 16 insertions(+), 3 deletions(-)

To view, visit change 374615. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: vscode-go
Gerrit-Branch: master
Gerrit-Change-Id: I4c89c299ffa569bb3ecbcb0e730f2f7ad04e16d8
Gerrit-Change-Number: 374615
Gerrit-PatchSet: 2
Gerrit-Owner: Gerrit Dou <letsus...@gmail.com>
Gerrit-Reviewer: Hyang-Ah Hana Kim <hya...@gmail.com>
Gerrit-Reviewer: Suzy Mueller <suz...@golang.org>
Gerrit-CC: Gopher Robot <go...@golang.org>
Gerrit-CC: Polina Sokolova <pol...@google.com>
Gerrit-Attention: Suzy Mueller <suz...@golang.org>
Gerrit-MessageType: newpatchset

Polina Sokolova (Gerrit)

unread,
Dec 29, 2021, 4:14:05 AM12/29/21
to Gerrit Dou, goph...@pubsubhelper.golang.org, Hyang-Ah Hana Kim, Suzy Mueller, Gopher Robot, golang-co...@googlegroups.com

Attention is currently required from: Suzy Mueller.

Patch set 2:Code-Review +2

View Change

    To view, visit change 374615. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-Project: vscode-go
    Gerrit-Branch: master
    Gerrit-Change-Id: I4c89c299ffa569bb3ecbcb0e730f2f7ad04e16d8
    Gerrit-Change-Number: 374615
    Gerrit-PatchSet: 2
    Gerrit-Owner: Gerrit Dou <letsus...@gmail.com>
    Gerrit-Reviewer: Hyang-Ah Hana Kim <hya...@gmail.com>
    Gerrit-Reviewer: Polina Sokolova <pol...@google.com>
    Gerrit-Reviewer: Suzy Mueller <suz...@golang.org>
    Gerrit-CC: Gopher Robot <go...@golang.org>
    Gerrit-Attention: Suzy Mueller <suz...@golang.org>
    Gerrit-Comment-Date: Wed, 29 Dec 2021 09:13:59 +0000
    Gerrit-HasComments: No
    Gerrit-Has-Labels: Yes
    Gerrit-MessageType: comment

    Gerrit Dou (Gerrit)

    unread,
    Dec 29, 2021, 4:17:20 AM12/29/21
    to goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

    Attention is currently required from: Suzy Mueller.

    Gerrit Dou uploaded patch set #3 to this change.

    View Change

    debugging.md: add a note about using --continue with remote server

    Updates go-delve/delve#2323


    Change-Id: I4c89c299ffa569bb3ecbcb0e730f2f7ad04e16d8
    GitHub-Last-Rev: 26bb7f9eb0cdb29dcd820f91562b3c60b8313a31
    GitHub-Pull-Request: golang/vscode-go#1979
    ---
    M docs/debugging.md
    1 file changed, 16 insertions(+), 3 deletions(-)

    To view, visit change 374615. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-Project: vscode-go
    Gerrit-Branch: master
    Gerrit-Change-Id: I4c89c299ffa569bb3ecbcb0e730f2f7ad04e16d8
    Gerrit-Change-Number: 374615
    Gerrit-PatchSet: 3
    Gerrit-Owner: Gerrit Dou <letsus...@gmail.com>
    Gerrit-Reviewer: Hyang-Ah Hana Kim <hya...@gmail.com>
    Gerrit-Reviewer: Polina Sokolova <pol...@google.com>
    Gerrit-Reviewer: Suzy Mueller <suz...@golang.org>
    Gerrit-CC: Gopher Robot <go...@golang.org>
    Gerrit-Attention: Suzy Mueller <suz...@golang.org>
    Gerrit-MessageType: newpatchset

    Polina Sokolova (Gerrit)

    unread,
    Dec 29, 2021, 4:22:23 AM12/29/21
    to Gerrit Dou, goph...@pubsubhelper.golang.org, golang-...@googlegroups.com, Hyang-Ah Hana Kim, Suzy Mueller, Gopher Robot, golang-co...@googlegroups.com

    Polina Sokolova submitted this change.

    View Change



    2 is the latest approved patch-set.
    No files were changed between the latest approved patch-set and the submitted one.

    Approvals: Hyang-Ah Hana Kim: Looks good to me, approved Polina Sokolova: Looks good to me, approved
    debugging.md: add a note about using --continue with remote server

    Updates go-delve/delve#2323

    Change-Id: I4c89c299ffa569bb3ecbcb0e730f2f7ad04e16d8
    GitHub-Last-Rev: 26bb7f9eb0cdb29dcd820f91562b3c60b8313a31
    GitHub-Pull-Request: golang/vscode-go#1979
    Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/374615
    Reviewed-by: Hyang-Ah Hana Kim <hya...@gmail.com>
    Reviewed-by: Polina Sokolova <pol...@google.com>
    ---
    M docs/debugging.md
    1 file changed, 19 insertions(+), 3 deletions(-)

    diff --git a/docs/debugging.md b/docs/debugging.md
    index 4019f80..051b019 100644

    --- a/docs/debugging.md
    +++ b/docs/debugging.md
    @@ -379,13 +379,13 @@

    In this mode the user must first manually start a [`dlv --headless`](https://github.com/go-delve/delve/tree/master/Documentation/api) server listening at `host:port` while specifying the target program to debug/test/exec or a process to attach to on the command-line. A [remote attach](#attach) configuration is then used to connect to the debugger with a running target.

    -The [headless dlv server](https://github.com/go-delve/delve/tree/master/Documentation/api) can now be used with both `"debugAdapter": "legacy"` (default value) and `"debugAdapter": "dlv-dap"` (with Delve v1.7.3 or newer) as well as Delve's [command-line interface](https://github.com/go-delve/delve/tree/master/Documentation/cli) via `dlv connect`. The `--accept-multiclient` flag can be used to make this a multi-use server that persists on `Disconnect` from a client and allows repeated client connections. Please see `dlv --help` and `dlv [command] --help` for dlv's command-line options.
    +The [headless dlv server](https://github.com/go-delve/delve/tree/master/Documentation/api) can now be used with both `"debugAdapter": "legacy"` (default value) and `"debugAdapter": "dlv-dap"` (with Delve v1.7.3 or newer) as well as Delve's [command-line interface](https://github.com/go-delve/delve/tree/master/Documentation/cli) via `dlv connect`. The `--accept-multiclient` flag makes this a multi-use server that persists on `Disconnect` from a client and allows repeated connections from any of the aforementioned clients. A combination of `--accept-multiclient --continue` flags can be used to resume process execution on start-up. Please see `dlv --help` and `dlv [command] --help` for dlv's command-line options.

    We encourage you to give the newly added `"debugAdapter": "dlv-dap"` support a try and to [let us know of any issues](https://github.com/golang/vscode-go/issues/new). If you need to use the `legacy` mode, pleasse also see the [legacy remote debugging](https://github.com/golang/vscode-go/blob/master/docs/debugging-legacy.md#remote-debugging) documentation.

    For example, start external headless server:
    ```
    -dlv debug /path/to/program/ --headless --listen=:12345
    +dlv debug /path/to/program/ --headless --listen=:12345 # also add as needed: --accept-multiclient --continue
    ```

    Connect to it with a remote attach configuration in your `launch.json`:
    @@ -447,7 +447,7 @@
    ```

    ⚠️ Limitations
    -* Delve DAP does not support `--accept-multiclient` or `--continue` flags, which means after a debug session ends, the dlv-dap process will always exit.
    +*   Unlike `dlv --headless` above, `dlv dap` does not support `--accept-multiclient` or `--continue` flags, which means after a debug session ends, the dlv-dap process will always exit.

    * If you use `debug` or `test` mode `launch` requests, Delve builds the target binary. Delve tries to build the target from the directory where the `dlv` (or `dlv-dap`) process is running, so make sure to run the `dlv-dap` command from the directory you would run the `go build` or `go test` command.

    ### Running Debugee Externally

    To view, visit change 374615. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-Project: vscode-go
    Gerrit-Branch: master
    Gerrit-Change-Id: I4c89c299ffa569bb3ecbcb0e730f2f7ad04e16d8
    Gerrit-Change-Number: 374615
    Gerrit-PatchSet: 4
    Gerrit-Owner: Gerrit Dou <letsus...@gmail.com>
    Gerrit-Reviewer: Hyang-Ah Hana Kim <hya...@gmail.com>
    Gerrit-Reviewer: Polina Sokolova <pol...@google.com>
    Gerrit-Reviewer: Suzy Mueller <suz...@golang.org>
    Gerrit-CC: Gopher Robot <go...@golang.org>
    Gerrit-MessageType: merged
    Reply all
    Reply to author
    Forward
    0 new messages