delve: g command fails on most recent version of debugserver on darwin/arm64
Please answer the following before submitting your issue:
Note: Please include any substantial examples (debug session output, stacktraces, etc) as linked gists.
- What version of Delve are you using (
dlv version)? Version 1.6.0 - What version of Go are you using? (
go version)? Go1.16.2 - What operating system and processor architecture are you using? Macmini m1 chip
- What did you do?
-
cd /Documents && mkdir test && cd test && touch main.go
-
use vscode set main.go like
` package main import “fmt”
func main() { a := 1 fmt.Print(“123”) fmt.Println(a) } `
- add break point at line 6 and line 8
- go mod init test
- go mod tidy
- create default debug config ./vscode/launch.json
{ "version": "0.2.0", "configurations": [ { "name": "Launch Package", "type": "go", "request": "launch", "mode": "debug", "program": "${workspaceFolder}" } ] } - click Launch Package
- What did you expect to see? run debug success and go to breakpoint
- What did you see instead?

无法加载源“”。means can not load source
what should i do?
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 3
- Comments: 27 (6 by maintainers)
I add this code to delve and rebuild, copy dlv to a temp path, I am using
/Users/myName/go/bin.Open goland and run the
Edit Custom Propertiesaction (Help | Edit Custom Properties), add the path to Delve on a new line:dlv.path=/path/to/delve/macarm(e.g.dlv.path=/Users/myName/go/bin/dlv). Flowing this step Goland Edit Custom Properties.Had this problem as well. Installed via
go install github.com/go-delve/delve/cmd/dlv@latestIt installed 1.6.0
It seems this was fixed, just isn’t released yet. So when I installed it this way, the debugger is working.
Ok so I figured what happened on my end. I had installed
xcodevia the App Store on Mac. I had set the app store to update my apps automatically (big mistake). Yesterday,xcodewas automatically updated to 12.5 as you can see from the More Downloads for Apple Developers page. What I did to solve the issue was:Uninstall
xcodefollowing this tutorial.Reboot.
Install
xcodeversion 12.4 from the More Downloads for Apple Developers page.Reboot.
Make sure automatic updates are turned off on the app store AND on System Preferences as well.
After this, everything is working correctly. I would presume something is fishy about
xcode12.5. Hope this helpsReported to LLVM to https://bugs.llvm.org/show_bug.cgi?id=50169
No need to clone the repo, just install with
go install github.com/go-delve/delve/cmd/dlv@masterOnce the fix is released, switch back to
latest:go install github.com/go-delve/delve/cmd/dlv@latestThank you @mensurm, @ormissia
These are the steps that I took that worked for me with GoLand 2021.1 on Mac 11.2.3
I first took @mensurm’s advice (can be done in any directory)
This makes the new
dlvavailable in your$GOPATH/bin. One can get the path with:If no errors appear, then that’s the path you can use when you follow @ormissia 's advice, and paste the value in the
idea.propertiesfile.I’ve changed a local delve to have the option
and can confirm this works on the latest xcode Perhaps when you do a dlv version , then also show this version v[len(“version:”):] So people don’t need to change their source. (or perhaps make it >= 1200, instead of exact?)
just update my xcode to 12.5 and encounter the same issue
You should report this problem to apple/llvm, after all that’s what betas are for.
I did by going back to an older version of the xcode developers tools
Anyone experiencing this issue should:
--log --log-output=gdbwire.--log --log-output=gdbwireafter applying the workaroundin this order.
@jimcroft you could see if the same thing happens using lldb with a compiled binary. Also in pkg/proc/gdbserial/gdbserver.go there’s a version check that sets
p.gcmdok = false, you could try to enable it always, it could be that they broke thegcommand again.