你在Vim中调试C ++代码吗?怎么样? [英] Do you debug C++ code in Vim? How?

查看:125
本文介绍了你在Vim中调试C ++代码吗?怎么样?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

问题在于你所有使用Vim开发C ++应用程序的人。



我的人生有一段时期,可以被描述为
'我讨厌Vim !!!'''Vim很好!'

然而,在微软开发集成开发环境中,我已经习惯了那些调试代码,观察窗口,调用堆栈和主代码时的快捷方式 - 全部可见,无需键入任何GDB命令。

所以,这里有个问题:

您是否也使用Vim进行调试?或者你为此目的切换到某个IDE吗?哪一个?



对于那些使用Vim来调试代码的人:是否有插件可以在编辑器中设置断点,突出显示我们当前正在调试的行,auto - 步入,步入,导出?



请不要告诉我你使用GDB作为命令行,只能看到一行被调试的行等。

解决方案

与其他答案相比,至少有三个选项可以满足您的要求: clewn pyclewn vimgdb



这三个项目都是相关的。 vimgdb 是针对Vim的补丁,需要重新编译Vim。 clewn 是一个通过Netbeans套接字接口与Vim进行通信的独立程序。这需要使用 + netbeans 选项构建Vim(最近的Linux发行版就是这种情况,所以它不应该是个问题)。



引用clewn的网站:


Clewn在vim编辑器中实现了完整的gdb支持:breakpoints,watch变量,gdb命令完成,程序集窗口等。


我认为你应该放弃它。



pyclewn网站的主页显示了这三个项目之间的对比。几个月前,我尝试了Pyclewn。建立起来有点困难,但看起来很好,但看起来很好。我只是做了一些测试,并且可以设置书签等等,这些都是图形调试器所期望的。我最终因为偶然的原因而没有使用它,但我很想再次尝试。


The question is to all you people, who use Vim to develop C++ applications.

There was a period in my life, which can be described as 'I hate Vim!!!'..'Vim is nice!'

However, having grown up mostly on Microsoft development IDEs, I've got used to those F5-F11 shortcuts when debugging code, watch window, call stack and the main code - all visible without need to type any GDB commands.

So, here is the question:

Do you use Vim as well for debugging? Or do you switch to some IDE for this purpose? Which one?

For those who use Vim to debug code: are there plugins to set breakpoints in editor, highlight the line we're currently debugging, auto-navigation during step, step into, step out?

Please, don't tell me you use GDB as command line, see only one line which is debugged, etc.

解决方案

In contrast with the other answers, there are at least three options that do just what you require: clewn, pyclewn and vimgdb.

All three projects are related. vimgdb is a patch against Vim and requires Vim to be recompiled. clewn is a standalone program that communicates with Vim through the Netbeans socket interface. This requires Vim to be built with the +netbeans option (this is the case in recent Linux distributions so it shouldn't be a problem).

To quote from the clewn's website:

Clewn implements full gdb support in the vim editor: breakpoints, watch variables, gdb command completion, assembly windows, etc.

I think you should definitely give it a go.

The homepage of the pyclewn website shows a comparison between the three projects.

A few months ago I tried pyclewn. It was a bit difficult to set up, but it looks well though out and promising. I just did some tests and you could set bookmarks, etc., the usual stuff you would expect from a graphical debugger. I ended up not using it for contingent reasons but I am keen to give it another try.

这篇关于你在Vim中调试C ++代码吗?怎么样?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆