我們正在嘗試調(diào)試 Go 代碼并收到此錯(cuò)誤:could not launch process: decoding dwarf section info at offset 0x0: too short我們的設(shè)置:WITSC02X6385JGH:orderer sjain68$ uname -aDarwin WITSC02X6385JGH 17.7.0 Darwin Kernel Version 17.7.0: Fri Jul? 6 19:54:51 PDT 2018; root:xnu-4570.71.3~2/RELEASE_X86_64 x86_64WITSC02X6385JGH:orderer sjain68$ go versiongo version go1.11 darwin/amd64WITSC02X6385JGH:orderer sjain68$ dlv versionDelve DebuggerVersion: 1.1.0Build: $Id: 1990ba12450cab9425a2ae62e6ab988725023d5c我們嘗試過(guò)的事情:使用 VS Code 更新 dlv -> Go: Install/Update Tools嘗試從命令行運(yùn)行:WITSC02X6385JGH:orderer sjain68$ /Users/sjain68/go/bin/dlv debug github.com/hyperledger/fabric/orderer --headless=true --listen=127.0.0.1:41305 --api-version=2 --log=true --API server listening at: 127.0.0.1:41305INFO[0002] launching process with args: [/Users/sjain68/go/src/github.com/hyperledger/fabric/orderer/debug]? layer=debuggerdebugserver-@(#)PROGRAM:debugserver? PROJECT:debugserver-902.0.79.7?for x86_64.Got a connection, launched process /Users/sjain68/go/src/github.com/hyperledger/fabric/orderer/debug (pid = 9278).Exiting.could not launch process: decoding dwarf section info at offset 0x0: too short請(qǐng)注意,我們嘗試調(diào)試的二進(jìn)制文件確實(shí)被執(zhí)行了。只是調(diào)試器沒(méi)有啟動(dòng)。我們通過(guò)此嘗試的另一件事:WITSC02X6385JGH:orderer sjain68$ export GOFLAGS="-ldflags=-compressdwarf=false"; dlv debugcould not launch process: decoding dwarf section info at offset 0x0: too short有人說(shuō)要運(yùn)行 GOCACHE=off go build ...?我們?nèi)绾谓鉀Q這個(gè)問(wèn)題?
3 回答

墨色風(fēng)雨
TA貢獻(xiàn)1853條經(jīng)驗(yàn) 獲得超6個(gè)贊
更新 Go 后我遇到了同樣的問(wèn)題。從控制臺(tái)更新 Delve 包有幫助:
go get -u github.com/go-delve/delve/cmd/dlv

夢(mèng)里花落0921
TA貢獻(xiàn)1772條經(jīng)驗(yàn) 獲得超6個(gè)贊
確保您沒(méi)有使用從構(gòu)建中刪除調(diào)試信息的標(biāo)志,即 -ldflags="-s -w" 。

牛魔王的故事
TA貢獻(xiàn)1830條經(jīng)驗(yàn) 獲得超3個(gè)贊
對(duì)我們有用的解決方案是升級(jí) Go 版本
$ go version
go version go1.13.3 darwin/amd64
所以 Go 1.11 是罪魁禍?zhǔn)住?/p>
- 3 回答
- 0 關(guān)注
- 439 瀏覽
添加回答
舉報(bào)
0/150
提交
取消