英文:
could not launch process: stub exited while waiting for connection: exit status 0 in golang or vscode
问题
我在MacBook Pro M1 Pro上使用调试器时遇到了问题。
当我尝试调试我的代码时,出现了以下错误:
"could not launch process: stub exited while waiting for connection: exit status 0"
我在通过VSCode、Goland和"dlv debug"命令启动调试器时都遇到了这个错误。
我想知道是否有人对我的问题有解决方案。
以下是关于我的配置的一些信息:
go version go1.18.5 darwin/arm64
Delve Debugger
Version: 1.9.0
Build: $Id: 69310c2f438e492f892d6af22e8e62c8ea1e9d8d $
英文:
I have problems with my debugger go on a MacBook Pro M1 Pro.
When I try to debug my code I have this error:
"could not launch process: stub exited while waiting for connection: exit status 0"
I got this error when launching the debugger via VSCode, Goland and via the "dlv debug" command.
I wanted to know if someone had a solution to my problem.
Here is some information about my configuration:
go version go1.18.5 darwin/arm64
Delve Debugger
Version: 1.9.0
Build: $Id: 69310c2f438e492f892d6af22e8e62c8ea1e9d8d $
答案1
得分: 10
以上的回答对我都没有用。然后,在经过两天的研究后,我看到有人说我应该安装 M1 版本的 VSCode(而不是通用版本!)。
我之前安装的是“通用”版本,但是当我检查了活动监视器后,发现它是以Intel
运行的。所以我卸载了它,并从这里下载了 M1 版本(具体来说):
https://code.visualstudio.com/download#(选择Apple Silicon
)。
现在在 VSCode 中进行调试工作正常了(我还没有在 Goland 中尝试)。
英文:
None of the responses above worked for me. Then, after two days of research I saw someone saying that I should install the M1 version of VSCode (not the universal version!)
I had the "Universal" version, but when I checked Activity Monitor I found out that it was running as Intel
. So I uninstalled it and downloaded the M1 version (specifically) from here:
https://code.visualstudio.com/download# (choose Apple Silicon
).
Now debugging in VSCode works fine (I haven't tried in Goland).
答案2
得分: 4
重新安装XCode命令行工具应该会有帮助。
- 删除之前的XCode工具版本:
sudo rm -rf /Library/Developer/CommandLineTools
- 从头开始安装:
xcode-select --install
英文:
Re-installing XCode Command Line Tools should help.
- Delete a previous version of XCode Tools:
sudo rm -rf /Library/Developer/CommandLineTools
- Install it from scratch:
xcode-select --install
答案3
得分: 3
检查是否正在运行
sudo /usr/sbin/DevToolsSecurity -enable
英文:
Check if running
sudo /usr/sbin/DevToolsSecurity -enable
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论