使用Vim(非gvim)通过GDB调试Go代码

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

Debugging Go via GDB with Vim (not gvim)

问题

我开始学习Go语言,因为它似乎是一个适合Web服务开发的有趣语言。过去,我为每个语言组创建了一个新的Ubuntu Server 14.04实例,并且对于Go语言也保持了相同的原则。

我已经安装了所有常用的工具(如Syntastic、YCM、NERDTree、ctags等),并且在vim-go的帮助下,已经建立了一个非常好的编写环境。

现在,我希望能够以类似的方式设置调试环境,使用GDB,但是我在选择最佳工具时遇到了困难。

Clewn似乎是一个很好的工具,但是由于我是通过SSH连接到开发环境的,所以不能使用gvim。

我基本上只需要一个与vim(而不是gvim)集成的GDB工具。我使用的是通过apt-get安装的vim 7.4,如果某些兼容性问题没有包含在内,我也可以从源代码构建。

英文:

I am starting to get into Go, as it seems like an interesting language for web service development. I have historically created a new Ubuntu Server 14.04 instance for each of my language groups, and have kept the same principle for Go.

I have installed all the usual tools (Syntastic, YCM, NERDTree, ctags, you get the idea) and have got a great writing environment set up with some help from vim-go.

Now, I want to be able to get debugging set up in a similar way, using GDB, and am getting stuck on what the best tooling to use here is.

It seems as if Clewn is a great tool, but as I am using SSH to the development environment, I can't necessarily use gvim.

I basically just need a GDB tie-in to vim (not gvim). I am using vim 7.4 as per apt-get via ubuntu universe, and will be more than happy to build from source if some compatibility has not included.

答案1

得分: 1

你可以使用dbg.vim

安装插件后,你可以设置断点,并使用快捷键显示光标下变量的值等。

英文:

You can use dbg.vim.

Once the plugin installed, you can setup your breakpoints and use shortcuts to show value of variable under the cursor, etc.

1: https://github.com/yuratomo/dbg.vim "dbg.vim"

huangapple
  • 本文由 发表于 2014年10月25日 16:50:03
  • 转载请务必保留本文链接:https://go.coder-hub.com/26560723.html
匿名

发表评论

匿名网友

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

确定