-
Notifications
You must be signed in to change notification settings - Fork 797
debug: enable remote attach with dlv-dap in the extension #1861
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
I can't think of a good way to check the binary version of a running server. We can't use the same logic we use to check the version of the installed tools because we don't know which binary was used or if it was started on a local machine. There is no rpc method to ask for the binary version and, even if there was, using a special client connection just to check the version seems overly complicated. The simplest thing would be to continue using If the user makes a mistake and requests
Ideally we should translate that into something informing the user that they need a newer version of dlv or at the very least, we should include this detail in our documentation. |
Change https://golang.org/cl/360974 mentions this issue: |
If debug adapter is not specified, still default to `legacy` for remote attach in case users haven't updated their tools to newer version of dlv that supports this via DAP. We can flip the default in a couple of months. In the meantime, users will need to specify directly if they want to use `dlv-dap` adapter. There is no good way to detect the version of a running server, so we will always allow them to proceed, while providing a warning about the right version at session start-up and at shutdown via Go Debug output channel if we detect that the connection failed with no responses. After this change, we will have the following behavior: attach + remote + debugAdapter= => legacy attach + remote + debugAdapter=dlv-dap => dlv-dap + version warnings attach + remote + debugAdapter=legacy => legacy attach + !remote + debugAdapter=dlv-dap + port => warning to drop port if not using external server launch + !remote + debugAdapter=dlv-dap + port => warning to drop port if not using external server launch + remote + debugAdapter=dlv-dap + port => error from dlv server Updates #1861 Change-Id: Ia2e6b35f9d401ea2e719a65c78d9cf8e5ef90c24 GitHub-Last-Rev: 3a0ce53 GitHub-Pull-Request: #1873 Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/360974 Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com> Reviewed-by: Polina Sokolova <polina@google.com> Trust: Hyang-Ah Hana Kim <hyangah@gmail.com> Run-TryBot: Hyang-Ah Hana Kim <hyangah@gmail.com> TryBot-Result: kokoro <noreply+kokoro@google.com>
Change https://golang.org/cl/367854 mentions this issue: |
…ging via DAP Updates #1861 Change-Id: Icc133623362b98d16fc0cc9fe0f235e4241a928b GitHub-Last-Rev: 4a15622 GitHub-Pull-Request: #1920 Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/367854 Reviewed-by: Polina Sokolova <polina@google.com> Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
Change https://golang.org/cl/368936 mentions this issue: |
Updates #1861 Change-Id: Ic429043aee93bcb0be34de2be861124bf548cde5 GitHub-Last-Rev: 9195536 GitHub-Pull-Request: #1925 Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/368936 Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com> Reviewed-by: Polina Sokolova <polina@google.com> Run-TryBot: Hyang-Ah Hana Kim <hyangah@gmail.com> TryBot-Result: kokoro <noreply+kokoro@google.com>
Change https://golang.org/cl/371494 mentions this issue: |
Updates #1930 Updates #1861 Will add gophercon details separately. Change-Id: I87fbe7dc3a41d0c9d3b27e40bd81b84a269a2ef9 GitHub-Last-Rev: 8a1b13f GitHub-Pull-Request: #1943 Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/371494 Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com> Trust: Hyang-Ah Hana Kim <hyangah@gmail.com> Run-TryBot: Hyang-Ah Hana Kim <hyangah@gmail.com> Trust: Peter Weinberger <pjw@google.com> TryBot-Result: kokoro <noreply+kokoro@google.com>
Change https://golang.org/cl/371974 mentions this issue: |
…mote dlv-dap Updates #1861 The informational message alerting the user that they are using new remote dlv-dap mode will always pop-up when remote attach session is started. The user has the option to disable it with "Do not show again". If connection/attach fail, an additional pop-up will occur to high-light that this is dlv-dap mode that requires newer versions of dlv. Change-Id: If56a9481323c57c11a740d1b61df20631c796bd0 GitHub-Last-Rev: a731107 GitHub-Pull-Request: #1945 Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/371974 Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com> Reviewed-by: Polina Sokolova <polina@google.com>
Dlv has been upgraded to support remote attach via DAP (available with
go install github.com/go-delve/delve/cmd/dlv@HEAD
).In vscode-go currently by default if

remote
mode is used with a port, the extension just uses the legacy adapter. Ifdlv-dap
is explicitly specified inlaunch.json
orsettings.json
withremote
mode, the following error is displayedThe only way to by-pass these is to not specify the adapter (
dlv-dap
by default) and usedebugServer
instead ofport
with remote attach mode.We need to roll out the new dap remote attach, but do so gradually as users will be updating their tools at different rates. Ideally we should check the version of dlv used. If the version supports remote-attach, we can use
dlv-dap
configuration unless the user explicitly specifiedlegacy
. If the version is too old, we can either fail or fallback tolegacy
while printing a warning that the user should update their tools because remote attach is now available withdlv-dap
as well.@hyangah @suzmue
The text was updated successfully, but these errors were encountered: