IDEA 编译 1.11版本以上时不能使用DEBUG功能

昨天在windows 机器上安装了 IDEA 2017.3.1 编译了第一个hello.go,但是发现不能使用IDEA的DEBUG功能,查了资料发现是 GO版本到1.11以后会有这个问题。现将我自己的解决方案列出来,供大家参考。

1 安装最新的dlv

Debug 视出现could not launch process: decoding dwarf section info at offset 0x0: too short,是因为IDEA安装的dlv不是最新的,需要在github上下载最新的dlv,替换掉IDEA原来的dlv
打开IDEA的控制台窗口,
IDEA Denug Go 报 could not launch process: decoding dwarf section info at offset 0x0: too short
在控制台输入 go get -u github.com/derekparker/delve/cmd/dlv,执行后要等待一段时间,执行完成后如下图。
IDEA Denug Go 报 could not launch process: decoding dwarf section info at offset 0x0: too short

2替换IDEA原有的dlv.exe

下载完成后的dlv 位置在C:\Users\你的用户名\go\bin下,用此路径下的
dlv.exe 替换IDEA插件里的dlv。我插件的路径在(C:\Users\你的用户名.IntelliJIdea2017.3\config\plugins\intellij-go\lib\dlv\windows)
替换后,就可以使用IDEA 的DEBUG 模式来调试。

3 使用Debug 验证

IDEA Denug Go 报 could not launch process: decoding dwarf section info at offset 0x0: too short

相关文章:

  • 2021-09-15
  • 2021-05-06
  • 2021-10-02
  • 2021-08-02
  • 2021-06-01
  • 2021-06-28
  • 2021-11-15
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-11
  • 2021-12-09
相关资源
相似解决方案