在我使用mac 由 Mojava 升级到 Catalina 之后使用Idea Debug go project 一直报如下错误
- (could not launch process: decoding dwarf section info at offset 0x0: too short)
后来在如下文章找到了解析链接地址
大致解析如下:
步骤
- 更新xcode工具
xcode-select --install
- 安装最新的dlv工具
go get -u github.com/go-delve/delve/cmd/dlv
但是我在安装完上述步骤后还是有以上问题。网上有些教程说需要设置 idea到custom.properties
#加入如下语句
dlv.path=/Users/mac/GoPath/bin/dlv
但是这个在我的idea 上还是没有生效。
最后我找到了源头
这里大致解析入下:
上述步骤并不能使用dlv 的 native backend。需要使用的话可以在每次执行前执行
sudo /usr/sbin/DevToolsSecurity -enable
or enable Developer Mode using XCode . 当然这个我没有找到办法,所以我决定采用前者。
在idea 的EditConfiguration 可以设置启动前执行一个shell script

这个shell script 需要在左上角先添加。
执行这句话大致意思是需要获得管理员的授权,所以我们也可以勾选
Run with sudo
同样也可以解决该问题。
网友评论