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: dlv-dap remote attach doesn't recognize cwd/remotePath - should it? #1874

Open
polinasok opened this issue Nov 3, 2021 · 1 comment
Labels
debug/remote issues related to remote debugging support Debug Issues related to the debugging functionality of the extension.
Projects

Comments

@polinasok
Copy link
Contributor

polinasok commented Nov 3, 2021

Once #1873 is in, using hello-world program from hello directory from vscode, set a breakpoint in the editor.
Then start the dlv server from the symbolic link directory.

hello1_ln$ dlv debug . --headless --listen=:54321 --api-version=2

There are two ways to configure the path mapping with "debugAdapter": "legacy" that work:

            "cwd":"/path/to/hello",
            "remotePath":"/different/path/to/hello1_ln",
            "substitutePath": [
                {
                  "from": "/Users/polina/go/src/hello1",
                  "to": "/Users/polina/go/src/hello1_ln",
                },
            ]

Both only substitutePath works with dlv-dap.

@suzmue @hyangah
Should we use this as an opportunity to migrate the users from remotePath to substitutePath, which is more powerful with multiple entries and new dlv config support in dap, matches dlv terminal, and can be used when connecting to dlv dap servers as well. Or should we aim for backward compatibility and map remotePath+cwd to substitutePath for the user? If not, we should update package.json because it misleadingly says "If specified, becomes the first entry in substitutePath."

Update: this doesn't matter for Cloud Code. They can easily update their configuration to use whatevere.

@gopherbot gopherbot added this to the Untriaged milestone Nov 3, 2021
@suzmue suzmue modified the milestones: Untriaged, On Deck Nov 4, 2021
@suzmue suzmue added this to Needs triage in Debug via automation Nov 4, 2021
@suzmue suzmue added Debug Issues related to the debugging functionality of the extension. DlvDAPDA labels Nov 4, 2021
@polinasok
Copy link
Contributor Author

I just noticed the following deprecation setting in package.json:

vscode-go/package.json

Lines 852 to 857 in cc34acf

"remotePath": {
"type": "string",
"description": "The path to the source code on the remote machine, when the remote path is different from the local machine. If specified, becomes the first entry in substitutePath.",
"markdownDeprecationMessage": "Use `substitutePath` instead.",
"default": ""
},

added in dac1500

I must have missed this earlier. But looks like the plan is to deprecate remotePath, so switch to dlv-dap might serve as a good catalyst and we should therefore not map remotePath to substitutePath automoatically..

@polinasok polinasok added the debug/remote issues related to remote debugging support label Mar 30, 2022
@hyangah hyangah removed the DA: DlvDAP label Jun 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
debug/remote issues related to remote debugging support Debug Issues related to the debugging functionality of the extension.
Projects
No open projects
Debug
  
Needs triage
Development

No branches or pull requests

4 participants