bazel-contrib / bazel-contrib/rules_go
Unable to debug using delve in VS Code
- Dominant language
- Go
- Stars
- 1.5k
- Forks
- 760
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 12
Description
I built my go binary using rules_go and gazelle. I'm using VS Code as my editor and using a launch configuration with mode "exec". I built my code using bazel build --strip=never -c dbg.
When I launch the debugger using "F5" in VS Code, my breakpoints aren't hit. However, when I launch "dlv" manually over the command line using "dlv exec /path/to/binary", it runs fine and hits my breakpoints.
Contributor guide
Research direction
Start with the VS Code launch configuration using mode "exec" and compare its F5 invocation with the manual `dlv exec /path/to/binary` command. Reproduce the binary build with `bazel build --strip=never -c dbg`, then inspect how rules_go and gazelle produce the executable and debug information. Done means breakpoints are hit when launching the Bazel-built binary from VS Code.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go, vscode
- Domain
- build-system, devtools
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100