rules_go: dlv problem
Hello,
I am trying to debug my golang program by dlv on OSX. bazel 0.7.0, rules_go latest.
If I build program by bazel, I receive error
➜ dlv attach 74960
could not attach to pid 74960: decoding dwarf section info at offset 0x0: too short
I found same issue for dlv: https://github.com/derekparker/delve/issues/79 But static linking does not work on OSX (according to rules_go documentation).
If I build program by
go build
dlv able to attach to my program
How to build golang binaries in bazel on OSX for working with dlv? Thank you
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 16 (7 by maintainers)
Commits related to this issue
- Fixes for aspect based builds Use the deps, not the direct dependancies of the deps Fixes reported in person issue with pure="on" Get the toolchain_flags from the rule not the aspect Fixes #993 — committed to ianthehat/rules_go by ianthehat 7 years ago
- Fixes for aspect based builds Use the deps, not the direct dependancies of the deps Fixes reported in person issue with pure="on" Get the toolchain_flags from the rule not the aspect Fixes #993 — committed to ianthehat/rules_go by ianthehat 7 years ago
- Fixes for aspect based builds (#997) Use the deps, not the direct dependancies of the deps Fixes reported in person issue with pure="on" Get the toolchain_flags from the rule not the aspect Fixe... — committed to bazelbuild/rules_go by ianthehat 7 years ago
-c is the short form of --compilation_mode
in debug mode we disable stripping and also inlining (you can control just stripping with --strip instead) I would not recommend putting it in tools/bazel.rc. It would work, but that file is intended to be checked in, and you probably don’t want to force everyone to build slow large binaries.
Note that you can also use --run_under
where bazel-run is the bazel run wrapper script you can get using
and that’s nice and easy to alias to bazel-dlv or something