Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

debug: allow debugAdapter=dlv-dap with remote attach mode #1873

Closed
wants to merge 2 commits into from

Conversation

polinasok
Copy link
Contributor

@polinasok polinasok commented Nov 3, 2021

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

@google-cla google-cla bot added the cla: yes Used by googlebot to label PRs as having a valid CLA. The text of this label should not change. label Nov 3, 2021
@gopherbot
Copy link
Collaborator

This PR (HEAD: 4a6ced4) has been imported to Gerrit for code review.

Please visit https://go-review.googlesource.com/c/vscode-go/+/360974 to see it.

Tip: You can toggle comments from me using the comments slash command (e.g. /comments off)
See the Wiki page for more info

@gopherbot
Copy link
Collaborator

Message from Hyang-Ah Hana Kim:

Patch Set 2:

(3 comments)


Please don’t reply on this GitHub thread. Visit golang.org/cl/360974.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Collaborator

Message from Polina Sokolova:

Patch Set 3:

(3 comments)


Please don’t reply on this GitHub thread. Visit golang.org/cl/360974.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Collaborator

This PR (HEAD: 3a0ce53) has been imported to Gerrit for code review.

Please visit https://go-review.googlesource.com/c/vscode-go/+/360974 to see it.

Tip: You can toggle comments from me using the comments slash command (e.g. /comments off)
See the Wiki page for more info

@gopherbot
Copy link
Collaborator

Message from Hyang-Ah Hana Kim:

Patch Set 6: Run-TryBot+1 Code-Review+2 Trust+1


Please don’t reply on this GitHub thread. Visit golang.org/cl/360974.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Collaborator

Message from kokoro:

Patch Set 6:

Kokoro presubmit build starting for golang/vscode-go/gcp_ubuntu/presubmit
Logs at:
https://source.cloud.google.com/results/invocations/56d09097-fbc5-4ec4-badf-dd920f21427b


Please don’t reply on this GitHub thread. Visit golang.org/cl/360974.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Collaborator

Message from kokoro:

Patch Set 6: TryBot-Result+1

Kokoro presubmit build finished with status: SUCCESS
Logs at: https://source.cloud.google.com/results/invocations/56d09097-fbc5-4ec4-badf-dd920f21427b


Please don’t reply on this GitHub thread. Visit golang.org/cl/360974.
After addressing review feedback, remember to publish your drafts!

gopherbot pushed a commit that referenced this pull request Nov 4, 2021
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>
@gopherbot
Copy link
Collaborator

This PR is being closed because golang.org/cl/360974 has been merged.

@gopherbot gopherbot closed this Nov 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes Used by googlebot to label PRs as having a valid CLA. The text of this label should not change.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants