dlv errors out
$ ~/go/bin/dlv debug ./fdbgrok
could not launch process: stub exited while waiting for connection: exit status 0
go env
GO111MODULE=""
GOARCH="arm64"
GOBIN=""
GOCACHE="/Users/amitava/Library/Caches/go-build"
GOENV="/Users/amitava/Library/Application Support/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="arm64"
GOHOSTOS="darwin"
GOINSECURE=""
GOMODCACHE="/Users/amitava/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/amitava/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/opt/homebrew/Cellar/go/1.17.2/libexec"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/opt/homebrew/Cellar/go/1.17.2/libexec/pkg/tool/darwin_arm64"
GOVCS=""
GOVERSION="go1.17.2"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/Users/amitava/prj/fdb-cli/fdbgrok/go.mod"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -arch arm64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/sc/dh7gj5050sn5knyx3pgr6xrr0000gn/T/go-build1666671882=/tmp/go-build -gno-record-gcc-switches -fno-common"
The solution was posted by my friend @StevenACoffman - worked like a charm
What's stopping dlv from working is Apple's debugserver not working. It seems like the debugserver installed by Apple's standalone CommandLineTools package isn't properly signed in some way. There are more details that may be relevant in this issue. I found that all the people for whom debugserver had stopped working shared the following feature:
$ xcode-select -p
/Library/Developer/CommandLineTools
whereas those for whom it kept working had
$ xcode-select -p
/Applications/Xcode.app/Contents/Developer
So I did the following: Uninstall CommandLineTools:
sudo rm -rf /Library/Developer/CommandLineTools
Install Xcode from the App Store Run
xcode-select --install
Open Xcode and accept the prompts to install additional tools And debugging in GoLand works again! (
Works afterwards
$ ~/go/bin/dlv debug main.go
Type 'help' for list of commands.