17

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.

Jonathan Hall
  • 75,165
  • 16
  • 143
  • 189
Nir Berko
  • 1,368
  • 1
  • 13
  • 33

4 Answers4

16

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:

  • the application was compiled with all the debugging flags turned off and the additional debugging information stripped
  • the application uses the standard library "plugin" package, which is known to cause an issue in the Go compiler. This will be fixed in Go 1.12.
dlsniper
  • 7,188
  • 1
  • 35
  • 44
  • 2
    I had the same issue after updateing Go. Delve update helped: `go get -u github.com/go-delve/delve/cmd/dlv` – user318750 Mar 18 '19 at 08:31
  • 1
    GoLand ships with its own delve copy so updating the external version should not change anything. – dlsniper Mar 19 '19 at 04:29
  • 2
    Yes, I know Go ships with its own Delve copy, but the wierd thing is that I had this issue exactly after updateing Go. Everything started working again only after `go get -u github.com/go-delve/delve/cmd/dlv` – user318750 Mar 21 '19 at 17:14
  • 1
    For me it is located in `$GOPATH/bin` – tom10271 May 06 '19 at 10:11
2

I would like to share my experience here too as it may be helpful for community, I made it works by doing the following:

  • Update Goland to 18.3
  • Also, in case if you have Mac, you should run xcode-select --install
  • In case if you had delv already installed inside GOPATH/bin, remove it and re-install it again by following instructions here
Muhammad Soliman
  • 21,644
  • 6
  • 109
  • 75
2

For my Mac the problem is related to the dlv package as installed by Golang plugin.

  • Install delv and,
  • check the path of dlv as executed by IntelliJ (in the console).

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).
    
piet.t
  • 11,718
  • 21
  • 43
  • 52
  • You should just upgrade the IDE and this will work. Adding the symlinks will break the updater functionality, as far as I remember. – dlsniper Mar 19 '19 at 04:31
1

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.

prashant
  • 2,808
  • 5
  • 26
  • 41