-
Notifications
You must be signed in to change notification settings - Fork 767
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
debug: breakpoints don't work when working with symlink #622
Comments
Logs from reproducing this on darwin:
Delve does not attempt to resolve symlinks (delve#1808) so when the extension passes a path within ~/Github, it fails to set the breakpoint (since the files used to build the program were actually in ~/go/src/github.com). To fix this we probably need to resolve the path ourselves before passing to delve or use the delve config suggested in delve#1808 ( |
I think |
Yes |
Change https://golang.org/cl/257204 mentions this issue: |
This change documents the fact that this extension does not support debugging symlinked projects. Updates #622 Change-Id: Iffc3bfb0438a84cc3afbb6aadd00df040b83c14b Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/257204 Trust: Suzy Mueller <suzmue@golang.org> Run-TryBot: Suzy Mueller <suzmue@golang.org> TryBot-Result: kokoro <noreply+kokoro@google.com> Reviewed-by: Polina Sokolova <polina@google.com> Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
We plan to address this issue by providing a user configuration to map directories to each other. This would allow users to specify to and the debug adapter would translate all paths that it sends to delve and receives from delve. This will not attempt to resolve symlinked paths, but should make debugging more usable for users that are debugging symlinked directories. |
Change https://golang.org/cl/270017 mentions this issue: |
This change adds a new configuration option to both launch and attach requests. substituePath takes an array that maps from string to string that is used to translate paths passed to the debugger and then back to the client. This allows users to translate their symlinked directories to the files that were actually used to build the binary. In addition this can also be used for remote debugging, and when the location of the files has moved since the program was built. Update #622 Change-Id: I71b081d17a29655c14cd20093dc9f88867fbcc69 Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/270017 Trust: Suzy Mueller <suzmue@golang.org> Trust: Hyang-Ah Hana Kim <hyangah@gmail.com> Run-TryBot: Suzy Mueller <suzmue@golang.org> TryBot-Result: kokoro <noreply+kokoro@google.com> Reviewed-by: Polina Sokolova <polina@google.com> Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
Change https://golang.org/cl/277961 mentions this issue: |
Although these tests do work right now, they depend on the implementation of the go command in a way I do not fully understand. The rest of the tests are sufficient to test the substitutePath implementation as opposed to how symlinks are interpreted by go or dlv. substitutePath may not be necessary for all symlinked projects. For example, when running on darwin: $ ls ~/go/src/github.com/user/package main.go $ ln -s ~/go/src/github.com/user ~/githubuser/ $ cd ~/githubuser/package; dlv debug (dlv) sources ~/go/src/github.com/user/package/main.go If a go.mod file is added into the package in the GOPATH: $ ls ~/go/src/github.com/user/package main.go go.mod $ ln -s ~/go/src/github.com/user ~/githubuser/ $ cd ~/githubuser/package; dlv debug (dlv) sources ~/githubuser/package/main.go Updates #622 Change-Id: Ie9893ac3cdcac3a8efcda95056dca6df271a85bd Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/277961 Trust: Suzy Mueller <suzmue@golang.org> Trust: Hyang-Ah Hana Kim <hyangah@gmail.com> Run-TryBot: Suzy Mueller <suzmue@golang.org> TryBot-Result: kokoro <noreply+kokoro@google.com> Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
@suzmue Do we need anything more to close this issue? |
The substitutePath configuration will allow users to configure their projects so they can link from symlinked directories. For more information see the documentation. |
Continuation of microsoft/vscode-go#2958 (lost during repo migration) and microsoft/vscode-go#1935. If we can't find a fix, we need to document this problem at least.
cc @suzmue @quoctruong
From microsoft/vscode-go#2958:
It is a continuation of an issue #1935
Unfortunately, the conversation there was locked to members only, so I had to open this card.
I have been able to reproduce the behavior (VSCode does not stop at breakpoints, while dlv itself does) for the symlinked GOPATH on two separate Ubuntu 19.10 installations, and I am pretty sure the issue is reproducible in other distros this way as well.
Set up to reproduce:
Reproducing
No launch configuration was created, all default - debug was in both cases launched just by a press of F5.
Unfortunately, I have not been able to take a look inside the debugger yet, but at least this reproduction scenario might be helpful
The text was updated successfully, but these errors were encountered: