1.golang采用dlv 時提示 “could not launch process: could not open debug info ”
在用dlv 遠程debug 代碼時候,提示我“could not launch process: could not open debug info ”
經過一番搜索,參考:https://github.com/go-delve/delve/issues/1698 發現代碼中的Makefile 文件中的build 帶有 -s -w 參數。
https://www.jianshu.com/p/b564a46d6267
win 編譯到mac,windowns
CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build test.go CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build test.go
3 本機命令行調試
本機只要輸入:
dlv connect www.example.com:8181 連接到服務器上的dlv進程,就可以在本機遠程調試了。
4. 安裝dlv
一句話ok: go install github.com/go-delve/delve/cmd/dlv
5.遠端一句話
dlv debug --headless --listen=:2345 --api-version=2 hello.go
