在Windows中调试Go(golang)代码

huangapple go评论89阅读模式
英文:

Debugging Go (golang) code in Windows

问题

在Windows中,调试Go代码的最佳方法是什么?

https://stackoverflow.com/a/5514122/201618 提到GBD不能用于
> Windows和ARM二进制文件不包含DWARF调试信息,因此无法使用GDB进行检查。

https://stackoverflow.com/a/3405768/201618 暗示最好的方法就是使用fmt.Println

是否有更好的当前选项?是否有更好的计划中的未来选项?

英文:

What is the best method of debugging go code in Windows?

https://stackoverflow.com/a/5514122/201618 states the GBD cannot be used as
> Windows and ARM binaries do not contain DWARF debugging information and, as such, cannot be inspected with GDB.

https://stackoverflow.com/a/3405768/201618 implies that the best thing to do is just use fmt.Println

Is there a better current option? Is there a better planned future option?

答案1

得分: 6

除了GDB,你还可以使用Zeus。另外,可以参考一下Google Go的IDE比较

英文:

In addition to GDB you can use Zeus. Also, take a look to comparison of IDEs for Google Go.

答案2

得分: 5

LiteIDE(https://github.com/visualfc/liteide)包含了一个在Windows上运行的GDB版本。当我尝试使用Goclipse时,我能够将其指向该GDB可执行文件并成功调试应用程序。

英文:

LiteIDE (https://github.com/visualfc/liteide) includes a build of GDB that works on Windows. When I experimented with Goclipse, I was able to point it to that GDB executable and debug applications just fine.

答案3

得分: 2

Delve支持Windows,并可以使用以下命令进行安装:

go get github.com/derekparker/delve/cmd/dlv

它与诸如VS code、Atom和IDEA等代码编辑器和集成开发环境有集成。但目前还不支持Sublime Text。

英文:

Delve supports windows and can be installed with the following command:

go get github.com/derekparker/delve/cmd/dlv

It has integration with code editors and IDEs such as VS code, Atom and IDEA. No Sublime Text support is available yet though!

1: https://github.com/derekparker/delve/blob/master/Documentation/installation/windows/install.md "Windows installation"
2: https://github.com/derekparker/delve/blob/master/Documentation/EditorIntegration.md "Editor Integration"

huangapple
  • 本文由 发表于 2013年8月1日 19:10:27
  • 转载请务必保留本文链接:https://go.coder-hub.com/17992425.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定