英文:
Can't debug Golang in vscode apple m1
问题
开始调试,我得到了以下信息:
API 服务器监听地址:127.0.0.1:23350
但是调试器卡住了,我无法进入、跳过或者跳出。只能停止并重新启动。
Go 版本是:
go version go1.16.4 darwin/arm64
launch.json 文件内容如下:
{
"version": "0.2.0",
"configurations": [
{
"name": "Launch file",
"type": "go",
"request": "launch",
"mode": "debug",
"program": "${file}"
}
],
}
英文:
Starting debugging, I get:
API server listening at: 127.0.0.1:23350
And debugger hangs, I cannot step into, step over, step out. Only can stop and restart.
go version is
go version go1.16.4 darwin/arm64
launch.json is
{
"version": "0.2.0",
"configurations": [
{
"name": "Launch file",
"type": "go",
"request": "launch",
"mode": "debug",
"program": "${file}"
}
],
}
答案1
得分: 1
TL;DR:这不是VS Code或Delve的问题。使用版本1.6.1来解决。
这个问题是LLVM的一个错误。请查看错误报告。不过,GoLand的错误跟踪器上有一个更有趣的相关错误:相关的GoLand错误。
解决方案:
使用Delve的版本1.6.1
。
参见:https://github.com/go-delve/delve/releases/tag/v1.6.1
从更新日志中可以看到:
在linux/arm64上正确读取G地址
这就是解决该问题的方法。
英文:
TL;DR: This is not an issue with VS Code or Delve. Use version 1.6.1 for a fix.
This problem was a bug in LLVM. Checkout the bug report. There is a bug in the GoLand bug tracker that is a bit more interesting to read though: related GoLand bug.
Solution:
Use version 1.6.1
of Delve.
See: https://github.com/go-delve/delve/releases/tag/v1.6.1
From the Changelog:
Correctly read G address on linux/arm64
That's the fix for the issue.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论