简体   繁体   English

在Windows中调试Go(golang)代码

[英]Debugging Go (golang) code in Windows

What is the best method of debugging go code in Windows? 在Windows中调试代码的最佳方法是什么?

https://stackoverflow.com/a/5514122/201618 states the GBD cannot be used as https://stackoverflow.com/a/5514122/201618声明GBD不能用作

Windows and ARM binaries do not contain DWARF debugging information and, as such, cannot be inspected with GDB. Windows和ARM二进制文件不包含DWARF调试信息,因此无法使用GDB进行检查。

https://stackoverflow.com/a/3405768/201618 implies that the best thing to do is just use fmt.Println https://stackoverflow.com/a/3405768/201618暗示最好的办法就是使用fmt.Println

Is there a better current option? 有更好的当前选择吗? Is there a better planned future option? 是否有更好的未来计划选择?

In addition to GDB you can use Zeus . 除了GDB,您还可以使用Zeus Also, take a look to comparison of IDEs for Google Go . 另外,请查看Google Go的IDE比较

LiteIDE ( https://github.com/visualfc/liteide ) includes a build of GDB that works on Windows. LiteIDE( https://github.com/visualfc/liteide )包含一个适用于Windows的GDB版本。 When I experimented with Goclipse, I was able to point it to that GDB executable and debug applications just fine. 当我尝试使用Goclipse时,我能够将它指向GDB可执行文件并调试应用程序就好了。

Delve supports windows and can be installed with the following command: Delve支持windows,可以使用以下命令安装:

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

It has integration with code editors and IDEs such as VS code, Atom and IDEA. 集成了代码编辑器和IDE,如VS代码,Atom和IDEA。 No Sublime Text support is available yet though! 虽然没有Sublime Text支持!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM