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

Add a build flag for dlv debugging #1632

Closed
LiusCraft opened this issue Jan 15, 2024 · 0 comments
Closed

Add a build flag for dlv debugging #1632

LiusCraft opened this issue Jan 15, 2024 · 0 comments

Comments

@LiusCraft
Copy link
Contributor

Proposal

Consider adding a gop build -dlv switch. When the -dlv switch exists, gop_autogen.go and <dlv_gop> are generated. For this dlv_gop, I expect <absolute path>/xxx.gop, if the -trimpath flag is carried during build, it is expected to be: <module path>/xxx.gop

Example:
absolute: /Users/qiniu/projects/testgop/xxx.gop
module: testgop/xxx.gop

Background

  1. When setting breakpoints for debugging gop source files in the dlv debugger using the vscode client, specifying the source file location as an absolute path, the dap server cannot locate that location (currently it is a relative path).
  2. If the current project imports another gop module, and they both have a utils/csgo.gop, then there would only be one in the sources, and the debugger would not be able to distinguish between them.
20240115-153947@2x 20240115-153810@2x

Workarounds

no

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

No branches or pull requests

2 participants