delve: could not launch process: decoding dwarf section info at offset 0x0: too short
When I brew install go
,and go get -u -v github.com/derekparker/delve/cmd/dlv
, I debug the program, it throw Exception as following (while it is ok when I run the program, ):
GOROOT=/usr/local/Cellar/go/1.10/libexec #gosetup
GOPATH=/Users/friends/Documents/VirtualMachine/share/gopath #gosetup
/usr/local/Cellar/go/1.10/libexec/bin/go build -gcflags “-N -l” -tags nopkcs11 “-ldflags=-linkmode internal” -o /private/var/folders/cg/mwzlhrjs5y55ny553g6xz9tr0000gn/T/___peer_server -gcflags “all=-N -l” /Users/friends/Documents/VirtualMachine/share/gopath/src/github.com/hyperledger/fabric/peer/main.go #gosetup
“/Applications/GoLand 1.0 EAP.app/Contents/plugins/intellij-go-plugin/lib/dlv/mac/dlv” --listen=localhost:50170 --headless=true --api-version=2 --backend=native exec /private/var/folders/cg/mwzlhrjs5y55ny553g6xz9tr0000gn/T/___peer_server – node start --peer-chaincodedev=true -orderer 192.168.120.189:7050 #gosetup
could not launch process: decoding dwarf section info at offset 0x0: too short
Delve Debugger Version: 1.0.0 Build: $Id: c98a142125d0b17bb11ec0513bde346229b5f533 $
go version go1.10 darwin/amd64
MacOS Darwin
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 61 (13 by maintainers)
Encountering the same issue in latest Mac OS X in go 1.11
@smoya I solved my problem. The main reason is that I upgraded the go to v1.11, but the debuging tool
dlv
not updated. when use vscode for debuging report this error, only need to updatedlv
and other related tools, the specific method can refer to this or direct use of the command panel of vscodeGo: Install/Update Tools
Still get the same issue
could not launch process: decoding dwarf section info at offset 0x0: too short
after update to Mac OS 10.14, GO 1.11Hi @exlimit, Thanks, now it works 😄 The problem is that in
GOLAND
IDE doesn’t. I did this workaround and now works: https://stackoverflow.com/questions/43014884/mac-osx-jetbrains-gogland-delve-debugging-meet-could-not-launch-process-could/43014980#43014980I also encountering this issue in Windows 10 using latest vscode AND go version is also the latest 1.11,update
Still getting this for Go 1.11 on Mac OS.
@smoya update GoLand to 2018.2.2 and this should solve the issue. The bundled version is compiled with Go 1.11
The
-w
removes the DWARF debugging information from the binary, so essentially you are trying to debug a binary that’s not built to be debugable. Don’t add the-w
flag, or strip the binary, when debugging, and Delve will work as expected.thanks, solved problem!!!
my condition: remove go build arg:
-ldflags "-w"
I tried everything on the internet and they didnt work , finally, remove the arg, It works I add the arg for some condition in mac,I dont know why but It works…Nope: $ export GOFLAGS=“-ldflags=-compressdwarf=false”; dlv debug could not launch process: decoding dwarf section info at offset 0x0: too short $ go version go version go1.11.2 darwin/amd64 $ uname -a Darwin Arnauds-MBP.lan 18.0.0 Darwin Kernel Version 18.0.0: Wed Aug 22 20:13:40 PDT 2018; root:xnu-4903.201.2~1/RELEASE_X86_64 x86_64
Not in the official release. My understanding is that it will be in 1.12 when it gets released. But as I indicated above, it works with a build of the latest unreleased version.
export GOFLAGS="-ldflags=-compressdwarf=false"; dlv debug
official-doc
This doesn’t appear to be user error: the
dlv debug
command should never strip the output executable.What workaround worked? We should fix this in the IDE but it’s unclear how you run into these issues or “fix” them. Thank you.
But when I downupgrade the go version to 1.9.4 , it could debug normally.