Go语言 调试delve在mac下无法使用

今天调试golang过程中发现无论是用哪个IDE都会出现一个提示:

1
could not launch process: EOF

然后无法调试。

Goland提示:
Goland

VS code提示
VSC

去Google了一下发现好多人都是这个状况,发现Github的delve Repo下有一个这样的issue,里面的讨论结论是说由于系统升级同时带着Xcode升级,升级后的CommandLineTools 的debug api有变化,目前暂时没法用兼容目前的delve。


4-10更新:
刚刚开发者在github放出了目前的fix方法:

如果有人在问题解决前想手动解决目前的问题。
在delve的目录:$GOPATH/src/github.com/derekparker/delve 中执行下面的命令:

1
2
3
git remote add aarzilli git@github.com:aarzilli/delve.git
git pull aarzilli debugserverfix
GO15VENDOREXPERIMENT=1 CERT=dlv-cert make install

之前的建议:

大家给出的建议都是目前先用

1
sudo rm -rf /Library/Developer/CommandLineTools

删除目前的新版CommandLineTools,然后去https://developer.apple.com/download/more/ 下个老版本CommandLineTools安上。

推荐版本:

Command Line Tools (macOS 10.13) for Xcode 9.1 - Dec 6, 2017

尝试了下,问题顺利解决。