Reputation: 1428
I am using JetBrains GoLand and I am trying to debug my go file and I am getting the following error:
decoding dwarf section info at offset 0x0: too short
I tried to find an answer here at StackOverflow but unfortunately, I didn't get any solution.
Upvotes: 18
Views: 14776
Reputation: 1324258
Note: this is followed by go-delve/delve
issue 1138 on go-delve
side (not Goland).
It referenced at the time (2018) this answer, where Gogland is using its own dlv
binary, as in previous answers on this page.
But it also mentions that upgrading to Go 1.12 was enough (Q2 2019).
It now adds a different cause (Q3 2024):
I did a
xcode-select --switch
to a different binary the other day and this messed up my development environment.
Switching it back to/Applications/Xcode.app
fixed it.
The same thread also references issue 3797:
GOBIN=/Users/$USER/Applications/GoLand.app/Contents/plugins/go-plugin/lib/dlv/macarm go install github.com/go-delve/delve/cmd/dlv@b9fadba
# For application installed for all users
GOBIN=/Applications/GoLand.app/Contents/plugins/go-plugin/lib/dlv/macarm go install github.com/go-delve/delve/cmd/dlv@master
Upvotes: 0
Reputation: 31
For my Mac the problem is related to the dlv package as installed by Golang plugin.
Go to this directory
($HOME//Library/Application Support/IntelliJIdea2017.3/intellij-go/lib/dlv/mac)
and rename dlv to any other name. Get the right dlv executable by using
which dlv (/usr/local/Cellar/go/1.11.1/libexec/bin/dlv for my computer)
and add a symbolic link
(ln -s /usr/local/Cellar/go/1.11.1/libexec/bin/dlv dlv).
Upvotes: 2
Reputation: 3318
After hours of effort, I was able to find the issue. It was due to Golang Plugin which is deprecated and was not compatible with IntelliJ IDEA 2018.2.2 (Ultimate Edition).
I uninstalled the plugin and reinstall the IntelliJ. Hope this also helps to above solutions.
Upvotes: 1
Reputation: 23766
I would like to share my experience here too as it may be helpful for community, I made it works by doing the following:
18.3
xcode-select --install
delv
already installed inside GOPATH/bin
, remove it and re-install it again by following instructions here Upvotes: 2
Reputation: 7477
GoLand ships with a bundled version of Delve. Update to 2018.2.2 and it should work. If you need to do remote debugging, then you need to update your Delve installation on/for the target machine as well (make sure you compile it with Go 1.11).
Edit: There are two more possible cases where this issue can appear:
Upvotes: 16