could not launch process: decoding dwarf section info at offset 0x0: too short

原文:https://www.cnblogs.com/cnblogs-wangzhipeng/p/10209688.html

Fabric调试异常

作者在使用chaincode进行智能合约开发的过程中,使用Goland + Golang + win10_X64作为开发环境:

GoLand 2018.1.4
Build #GO-181.5087.39, built on May 24, 2018
Licensed to youBBS

JRE: 1.8.0_152-release-1136-b39 amd64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Windows 10 10.0

go1.11.4 windows/amd64

但在调试的时候会发生如下错误:

D:\golang\bin\go.exe test -c -tags nopkcs1 -o C:\Users\NewWang\AppData\Local\Temp\___TestBcoin_Init_in_github_com_utxo_chaincode.exe -gcflags "all=-N -l" github.com/utxo/chaincode #gosetup
"E:\GoLand 2018.1.4\bin\runnerw.exe" D:\golang\bin\go.exe tool test2json -t C:\Users\NewWang\.GoLand2018.1\config\plugins\intellij-go\lib\dlv\windows\dlv.exe --listen=localhost:58370 --headless=true --api-version=2 --backend=default exec C:\Users\NewWang\AppData\Local\Temp\___TestBcoin_Init_in_github_com_utxo_chaincode.exe -- -test.v -test.run ^TestBcoin_Init$ #gosetup

could not launch process: decoding dwarf section info at offset 0x0: too short 

总结网络上提出以下两种解决方案:

  1. 升级Goland 版本到2018.2以上的版本
  2. 使用 go get -u -v github.com/derekparker/delve/cmd/dlv 命令去编译新版本的dlv,然后在通过在 Help -- Edit Custom Properties 中添加: dlv.path=D:/gopath/bin/dlv.exe,来更新dlv到与go适配的版本。

但是第二种方式经过作者的实际测试是无效的,后经过多方检索找到了真正的原因:

在1.10以上的版本中,当应用工程引入plugin的包后debugframe会丢失,导致dlv无法使用。

解决方案:

  1. 等待 1.12 版本中修复这个问题
  2. 将go的版本降低到1.9

参考链接:

https://youtrack.jetbrains.com/issue/GO-5446
https://github.com/golang/go/issues/23733

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值