debug: allow debugAdapter=dlv-dap with remote attach mode #1873
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 usedlv-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