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: delete legacy debug adapter #3096

Open
1 task
hyangah opened this issue Dec 18, 2023 · 29 comments
Open
1 task

debug: delete legacy debug adapter #3096

hyangah opened this issue Dec 18, 2023 · 29 comments
Milestone

Comments

@hyangah
Copy link
Contributor

hyangah commented Dec 18, 2023

It's been more than two years since we switched to dlv dap, and we halted any more dev/maintenance work for legacy debug adapter.

The legacy debug adapter is still being used as the default for "remote" debugging, but we also see an increased number of users switched to dlv-dap for remote debugging. (e.g. forked vscode-go for bazel, etc)
Before the deletion, we are going to switch the default (#2205) by warning potentially affected users and directing them to this issue.

(Update: 2024-04-04) Please see #3096 (comment)

Known issues:

@gopherbot gopherbot added this to the Untriaged milestone Dec 18, 2023
@gopherbot
Copy link
Collaborator

Change https://go.dev/cl/550917 mentions this issue: src/goDebugConfiguration: change remote/attach default to dlv-dap

gopherbot pushed a commit that referenced this issue Dec 27, 2023
And warn users who are affected by this change.

For #2205
For #3096

Change-Id: Ie74b0f2d02b1f64d984d1120463f0b01328e2bb0
Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/550917
TryBot-Result: kokoro <noreply+kokoro@google.com>
Reviewed-by: Suzy Mueller <suzmue@golang.org>
Commit-Queue: Hyang-Ah Hana Kim <hyangah@gmail.com>
@acekingke
Copy link

I Cannot make the breakpoint.

@ramory-l
Copy link

ramory-l commented Feb 19, 2024

I Cannot make the breakpoint.

Same

VS CODE:

Version: 1.86.2 (Universal)
Commit: 903b1e9d8990623e3d7da1df3d33db3e42d80eda
Date: 2024-02-13T19:42:13.651Z
Electron: 27.2.3
ElectronBuildId: 26908389
Chromium: 118.0.5993.159
Node.js: 18.17.1
V8: 11.8.172.18-electron.0
OS: Darwin arm64 23.3.0

VS CODE launch config:

{
  "version": "0.2.0",
  "configurations": [
    {
      "name": "Debug Go App",
      "type": "go",
      "request": "attach",
      "mode": "remote",
      "port": 2345,
      "host": "127.0.0.1",
      "showLog": true
    }
  ]
}

App runs in docker via:
/bin/dlv --listen=:2345 --headless=true --log=true --accept-multiclient --api-version=2 exec /app;

@gm0stache
Copy link

gm0stache commented Feb 19, 2024

i am trying to attach to a dlv instance running in a container.
i am unable to create breakpoints.

vscode version/env:

Version: 1.86.2
Commit: 903b1e9d8990623e3d7da1df3d33db3e42d80eda
Date: 2024-02-13T19:42:12.210Z
Electron: 27.2.3
ElectronBuildId: 26908389
Chromium: 118.0.5993.159
Node.js: 18.17.1
V8: 11.8.172.18-electron.0
OS: Darwin arm64 23.3.0

vscode launch config:

  "launch": {
    "configurations": [
      {
        "name": "my-remote-service",
        "type": "go",
        "request": "attach",
        "mode": "remote",
        "remotePath": "/app",
        "port": 5555,
        "host": "127.0.0.1",
        "showLog": true,
        "logOutput": "rpc"
      }
    ],
  },

the dlv command executed on the server (aka. the debugging target):

dlv --listen=:5555 --headless=true --api-version=2 --accept-multiclient exec /server

any help is highly appreciated!

br
gabriel

@gm0stache
Copy link

workaround for the meantime:
just use the legacy debug adapter. do so by adding this config to your settings.json:

  "go.delveConfig": {
    "debugAdapter": "legacy"
  }

! be sure to track this issue and remove this config again!

@qinggong8
Copy link

qinggong8 commented Feb 19, 2024

I added a new file settings.json under project/.vscode/settings.json with the above suggested content, restarted VSC, but still, I could not set break point (showing a circle but not in red). The BPs will display in red only when the debugger is not active.

Edit:
Adding "debugAdapter": "legacy" to the launch.json seems to work.

gm0stache was right. Adding changes to settings.json works for all VSC instances, while adding to launch.json only works for that instance. The location of the VSC settings.json is at: C:\Users\myuserid\AppData\Roaming\Code\User\settings.json

........
"colorTabs.titleBackground": true,
"colorTabs.ignoreCase": true,
"go.alternateTools": {
"dlv": "dlv"

},
"debug.allowBreakpointsEverywhere": true,
"go.delveConfig": {
    "debugAdapter": "legacy"
}

}

@gmikhaile
Copy link

same - can't make a breakpoint.

@CariappaKGanapathi
Copy link

I added a new file settings.json under project/.vscode/settings.json with the above suggested content, restarted VSC, but still, I could not set break point (showing a circle but not in red). The BPs will display in red only when the debugger is not active.

Edit: Adding "debugAdapter": "legacy" to the launch.json seems to work.

This worked for me as well. Thanks

@bhaskarEEN
Copy link

I added a new file settings.json under project/.vscode/settings.json with the above suggested content, restarted VSC, but still, I could not set break point (showing a circle but not in red). The BPs will display in red only when the debugger is not active.

Edit: Adding "debugAdapter": "legacy" to the launch.json seems to work.

This worked for me as well. Need to add this field inside the object under the configurations array

@nrapport
Copy link

I discovered that I couldn't make a breakpoint today either. I was under time pressure to resolve an issue and this caused a very frustrating delay.

@fcheng58
Copy link

same problem for me. I couldn't add a breakpoint and it was fixed when adding "debugAdapter": "legacy".

@andre-brizido
Copy link

Same problem. Could not set breakpoints with dlv running in a remote Linux virtual machine and VS code running on windows.
With the legacy adapter works.

@uniemimu
Copy link

uniemimu commented Mar 6, 2024

Same. Using legacy debug adapter works for remote debugging. Whatever the new thing is, it doesn't work.

@molixiaoge
Copy link

Without "debugAdapter": "legacy" config,I cannot set any breakpoint .

@KenelyOliveira
Copy link

Same problem, and when I try to add "debugAdapter": "legacy" config, I get the following error:

Legacy debug adapter is deprecated. Please comment on issue 3096 if this impacts your workflows.

@gm0stache
Copy link

related issue: #3096 (comment)

@AmanitaVerna
Copy link

I'm getting a "Legacy debug adapter is deprecated. Please comment on issue 3096 if this impacts your workflows." message when I debug locally.

The configuration I'm running has:
"type": "go", "request": "launch", "mode": "debug",

@sasklacz
Copy link

I'm getting a "Legacy debug adapter is deprecated. Please comment on issue 3096 if this impacts your workflows." message when I debug locally.

The configuration I'm running has: "type": "go", "request": "launch", "mode": "debug",

Same here.

@nrobert13
Copy link

I'm getting a "Legacy debug adapter is deprecated. Please comment on issue 3096 if this impacts your workflows." message when I debug locally.

The configuration I'm running has: "type": "go", "request": "launch", "mode": "debug",

same here

@sasklacz
Copy link

Also this partially helps, but I still can't add breakpoints in dependency libraries #3175

@bydanovm
Copy link

I can't debug with new dvl-dlp adapter.
I to add "debugAdapter": "legacy" config, it is help me

@FurmanovD
Copy link

And I've just fucked up a tech assessment because of this shit.
I am soooooo frustrated...

@paulbrittain
Copy link

Like others here, I couldn't add a breakpoint without using the legacy adapter. The issue is that the file in which the breakpoint is being added can't be found.

Interestingly, this is the same problem I'm experiencing with Neovim's dap.

I'd love to know what the legacy adapter does that the new adapter doesn't do. It might help me to fix my neovim dap configuration. Then I can have the option of using VSCode or Neovim.

@denis-manokhin
Copy link

The same problem. Can't add breakpoint without legacy debug adapter.
Sample debug config:

{
    "name": "service_name",
    "type": "go",
    "request": "attach",
    "mode": "remote",
    "remotePath": "",
    "port": 40000,
    "host": "127.0.0.1",
    "showLog": true,
    "trace": "log",
    "logOutput": "rpc"
}

And when I try to add breakpoint:
Screenshot 2024-04-04 at 11 39 15

@suzmue
Copy link
Contributor

suzmue commented Apr 4, 2024

Thanks for all of the feedback! The legacy debug adapter attempts to match the files from the VS Code client to a list of files that are in the compiled binary (#45), whereas the dlv dap relies on manual configuration. It is clear from the comments on this issue and #3175 that dlv dap does need to have a solution for this problem beyond manual configuration.

We have decided to revert the change of the default back to legacy for remote attach in v0.41.3 and will address this breakpoint issue by adding automated path mapping to dlv dap, which will require changes in both delve and vscode-go.

The work on automated path mapping will be tracked in #3193.

@gm0stache
Copy link

thanks for addressing the issue!
highly appreciate you work!

@bluec0re
Copy link

bluec0re commented Apr 5, 2024

We're using the legacy adapter so that we can debug bazel (rules_go) managed binaries from within VS code (parts of the small wrapper to make it work: https://gist.github.com/bluec0re/af19ded857749fd2ec145f4e06f0e9b3).

@91diego
Copy link

91diego commented Apr 19, 2024

Got this error

Expected to connect to external dlv --headless server @ v1.7.3 or later via DAP. Older versions fail with "error layer=rpc rpc:invalid character 'C' looking for beginning of value" logged to the terminal.

@hyangah
Copy link
Contributor Author

hyangah commented Apr 19, 2024

@91diego Can you check the versions of go and dlv used in your remote container? Is it possible to upgrade delve?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests