GoLand launch x86_64 debugger on Apple Silicon
Hello,
I Just installer GoLand with go 1.20.6 and created a basic HelloWorld. I've created a Go Build configuration an ran the debugger.
And it does not work : it seems to try launching the x86_64 debugger as I am running on Apple M1 Silicon :
/Applications/GoLand.app/Contents/plugins/go-plugin/lib/dlv/macarm/dlv --listen=127.0.0.1:51285 --headless=true --api-version=2 --check-go-version=false --only-same-user=false exec /Users/dscreve/Library/Caches/JetBrains/GoLand2023.2/tmp/GoLand/___go_build_awesomeProject --
API server listening at: 127.0.0.1:51285
debugserver-@(#)PROGRAM:LLDB PROJECT:lldb-1100.0.30..6
for x86_64.
error: failed to launch process /Library/Developer/CommandLineTools/Library/PrivateFrameworks/LLDB.framework/Versions/A/Resources/debugserver: (os/kern) invalid argument
Exiting.
could not launch process: stub exited while waiting for connection: exit status 0
Did I missed something ?
Regards,
David
Please sign in to leave a comment.
Hi David,
What's the output of go version? Is it installed for arm64 machine?
Hi,
go version go1.20.6 darwin/arm64
Can you also share the output of go env? Does GOARCH set to arm64?
% go version
go version go1.20.6 darwin/arm64
% echo $GOARCH
%
It'll not show the output with echo $GOARCH, please execute go env instead.
% go env
GO111MODULE="on"
GOARCH="arm64"
GOBIN=""
GOCACHE="/Users/myself/Library/Caches/go-build"
GOENV="/Users/myself/Library/Application Support/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="arm64"
GOHOSTOS="darwin"
GOINSECURE=""
GOMODCACHE="/Users/myself/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/myself/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/Users/myself/sdk/go1.20.6"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/Users/sdk/go1.20.6/pkg/tool/darwin_arm64"
GOVCS=""
GOVERSION="go1.20.6"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/Users/myself/GolandProjects/awesomeProject/go.mod"
GOWORK=""
CGO_CFLAGS="-O2 -g"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-O2 -g"
CGO_FFLAGS="-O2 -g"
CGO_LDFLAGS="-O2 -g"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -arch arm64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/5g/66jfcrrd1875s200dh2spk540000gn/T/go-build3806681590=/tmp/go-build -gno-record-gcc-switches -fno-common"
Please re-install XCode Command Line tools to see if it helps: https://apple.stackexchange.com/q/93573
xcode-select: error: command line tools are already installed
Did you remove the previous installation? sudo rm -rf `xcode-select -p` && sudo xcode-select -r && xcode-select --install
No. I have the latest command-line tools with latest Xcode version which I used every day.
It's a common problem with XCode installation and re-installing it should help (usually it happens after macOS update), please see the related issue:
I executed your command line : It completely destroyed my Xcode and CommandLineTools installation....
Does it work after re-installation?
Yes !
Thanks for your help.