无法启动进程:在等待连接时,存根退出:在golang或vscode中的退出状态为0

huangapple go评论82阅读模式
英文:

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 

huangapple
  • 本文由 发表于 2022年8月16日 20:01:59
  • 转载请务必保留本文链接:https://go.coder-hub.com/73373686.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定