-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
SubstitutePath doesn't work well when debugging remotely #3265
Comments
If I'm understanding correctly you are trying to replace the local source location with the remote source location, is that right? This is the incorrect way to use the substitute path rule. The source files are read by the client, not the server, so substituting the path to the sources on the remote server will not work. Please comment if my understanding is incorrect and I can reopen and investigate. |
Not really.
When I set a breakpoint and start it, the breakpoint does not work. log:
I think dlv should convert the path to a path that is recognized by the current system. I can provide PR for this. |
@derekparker PTAL. |
@tttoad where is the source code during compilation? That is what's going to be stored in the binary and what Delve will use to set a breakpoint. If you type |
@derekparker Both Mac and windows. |
@tttoad Ah, ok. I think what you want is to change the |
@derekparker |
Alright, reopening and labeling as a bug, sorry for my misunderstanding. It seems you have configured everything correctly, but the path is not being formatted correctly. |
@tttoad can you try not using backslahes? Windows should accept forward slash for path separation as well. |
Thank you, it works. |
@tttoad great, going to close this as resolved then. |
@tttoad I have a similar issue with nvim-dap running locally on my machine and connecting to |
If the local project path is
Full configuration:
You can use
|
What version of Delve are you using (
dlv version
)?v1.20.1
What version of Go are you using? (
go version
)?v1.19
What operating system and processor architecture are you using?
client: MacOS arm64
server: windows amd64
What did you do?
Set SubstitutePath value to
The client's program in "/Users/toad/work/demo/main.go".
The server's program in "C:\Users\toad\work\demo\main.go".
"/Users/toad/work/demo/main.go” is changed to "C:\Users\toad\work\demo\main.go" instead of "C:\Users\toad\work\/demo/main.go"
The text was updated successfully, but these errors were encountered: