问题:
Mac电脑上安装了Go 的基本环境,安装了Delve,使用 $dlv debug main.go 调试程序时报错:
could not launch process: exec: "lldb-server": executable file not found in $PATH
解决办法:
前提:我是通过brewhome安装的文件。brewhome 是一个mac端的程序管理利器,brewhome的安装命令如下:
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brewhome安装完毕后,调用命令:
$ brew install go-delve/delve/delve
安装delve完毕。
在终端对应目录下调用命令: dlv debug main.go 终端报错:
could not launch process: exec: "lldb-server": executable file not found in $PATH
解决方案:
升级xcode,命令为:
$ xcode-select --install
升级完毕后即可用dlv命令调试程序了。$为终端的提示符,不在输入的命令中。