Breakpoint does not work if working directory path contains symbolic link #74
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
NeonXP/nvim-dap-go#74
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
I found that if current working directory path contains symbolic link, running
require('dap-go').debug_test()will ignore breakpoint.It is like following:
~/workspace/gotestln -s gotest ~/workspace/gotestcd gotestThen set arbitrary breakpoint, and run
require('dap-go').debug_test().This will not happen by running
require('dap').cotinue()and select 1 to debugmain.go, even working directory path contains symbolic link. So I suppose it is caused bydebug_testfunction.It seems that this is the problem:
leoluz/nvim-dap-go@36abe1d320/lua/dap-go-ts.lua (L137C27-L137C59)I didn't initially found a filename modifier to work with symlinks:
https://neovim.io/doc/user/cmdline.html#filename-modifiers
Maybe consider using real files instead of symlinks?
jTo be upfront, there is probably a better way of solving this. I have a workaround which is described below.
I open my projects in
/home/marc/devwhich is a symlink to/mnt/Data/devon an additional SSD mounted to/mnt/Dataduring startup. You might need to change the paths.I solved it with overwriting the config which is passed to dap when calling
nvim-dap-go.debug_test():delve or dap (don't know to be honest) provide a way of substituting paths when symlinks are used. https://go.googlesource.com/vscode-go/+/c3516da303907ca11ee51e64f961cf2a4ac5339a/docs/dlv-dap.md
I have more or less the same issue when using c++. I have a similar situation where
~/Documents/devpoints somewhere else (either via a symlink or a mounted bind!). The breakpoint I've set will not be picked up. However, if I launch from the original directory, everything is fine, so I'll just use that as a workaround.there is a similar problem with discovering breakpoints in the modules.
If I jump inside the source of the modules I use Im able to set breakpoint and even the breakpoint itself works fine.
but when the code jumps to the breakpoint it opens another empty buffer and shows an error:
It seems it can't resolve modules existing buffers.
it can be done by a fullpath or taking a module hash commit (a bit more complicated, but reliable to differentiate the versions in go/mod).
sometime later even those breakpoints stopped working leaving the breakpoint icon red (no clue what it means)
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.