简体   繁体   中英

could not find __debug_line section in binary when runnig dlv debug test.go

Using macOS, installed dlv via brew install go-delve/delve/delve

then try to debug a program in test.go like this: dlv debug test.go

then got this error:

could not launch process: could not find __debug_line section in binary

Any suggestion?


updated on 9/4

I uninstalled the brew dlv and install like below, it still not work.

localhost:dlv lua$ go get github.com/derekparker/delve/cmd/dlv localhost:dlv lua$ cd $GOPATH/src/github.com/derekparker/delve/cmd/dlv localhost:dlv lua$ go build localhost:dlv lua$ go install localhost:dlv lua$ pwd /Users/lua/go/src/github.com/derekparker/delve/cmd/dlv localhost:dlv lua$ dlv -bash: /usr/local/bin/dlv: No such file or directory localhost:dlv lua$

You can install it from the source code instead of using brew.

go get github.com/derekparker/delve/cmd/dlv
cd $GOPATH/src/github.com/derekparker/delve/cmd/dlv
go build 
go install

This should fix this issue.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM