简单地说:有没有人知道gdb的GUI可以与最新版本的Visual c++中的特性集相提并论或接近?

详细说明:作为一个在Windows上花了大量时间编程的人,每当我必须在Linux中编写c++代码时,我发现的一个较大的绊脚石是,使用命令行gdb调试任何东西所花费的时间比在Visual Studio中长几倍,而且随着练习,它似乎并没有变得更好。有些东西用图形表示更容易或更快。

具体地说,我正在寻找一个GUI:

Handles all the basics like stepping over & into code, watch variables and breakpoints Understands and can display the contents of complex & nested C++ data types Doesn't get confused by and preferably can intelligently step through templated code and data structures while displaying relevant information such as the parameter types Can handle threaded applications and switch between different threads to step through or view the state of Can handle attaching to an already-started process or reading a core dump, in addition to starting the program up in gdb

如果这样的程序不存在,那么我希望听到人们使用至少满足其中一些要点的程序的经验。 有人有什么建议吗?

编辑: 列出这些可能性很好,我也会尽我所能,但如果你能在回答中包括以下内容,那就更有帮助了: (a)你是否实际使用过这个图形用户界面,如果使用过,你对它有什么积极/消极的反馈。 (b)如果你知道,上述哪些功能是受支持的或不受支持的

列表很容易获得,像这样的网站很棒,因为你可以了解人们使用应用程序的个人体验。


当前回答

Qt Creator似乎是个好东西。一位同事向我展示了一种调试的方法:

Create a new project, "Import of Makefile-based Project". Point it to your root project folder (it will index sources under it, and it is impressively fast). Go to project settings and add a run configuration, then specify the executable you want to debug, and its arguments. Qt Creator seems to insist on building your project before debugging it. If you don't want that, or don't use make, just go to projects -> build (Left panel), then, on the right panel in "Build Steps", remove all the steps, including the step by default when you created the project.

对于调试一个我已经编译好的应用程序来说,这似乎有点多,但这是值得的。调试器以类似于Visual Studio的方式显示线程、堆栈和局部变量,甚至使用许多相同的键盘快捷键。它似乎可以很好地处理模板,至少std::string和std::map。附加到现有进程和核心转储似乎是受支持的,尽管我还没有测试它。

请记住,我现在使用它不到一个小时,但迄今为止我印象深刻。

其他回答

您将找不到任何可以与Visual Studio调试器的原始功能竞争的覆盖GDB的东西。它太强大了,而且在IDE中集成得太好了。

对于Linux的替代品,如果您喜欢自由软件,可以尝试DDD。

你没有提到你使用的是Windows还是UNIX。

在UNIX系统上,KDevelop很好,但我使用KDbg,因为它易于使用,也可以用于非KDevelop开发的应用程序。

Eclipse在这两个平台上都很好。

在Windows上,有一个叫做Wascana Desktop Developer的很棒的包,它是Eclipse CDT和MinGW,它们都经过了很好的打包和预配置,使痛苦最小化。这是我发现的在Windows上开发GNU代码最好的工具。

我已经使用了所有这些调试器,没有一个像MS Dev Studio一样好。Eclipse/Wascana可能是最接近的,但它确实有局限性,比如不能进入dll,而且它在检查变量方面做得不太好。

在很大程度上,可以进行的步骤将受到g++产生的调试信息的限制。Emacs为gdb提供了一个接口,允许您通过工具栏/菜单控制它,并在单独的窗口中显示数据,也可以直接键入gdb命令。Eclipse的CDT提供了类似的工具。我听说过Anjuta和Code::Blocks,但从未使用过。

我经常使用DDD,一旦你学会使用它,它就非常强大。我想说的一件事是,不要在X上通过WAN使用它,因为它似乎做了很多不必要的屏幕更新。

此外,如果你不是广发银行的合伙人,而且不介意支付一点钱,那么我会试试TotalView。它有一点陡峭的学习曲线(它绝对可以更直观),但它是我在任何平台上使用过的最好的c++调试器,并且可以扩展以自定义方式内测你的对象(因此允许你将STL列表视为一个实际的对象列表,而不是一堆令人困惑的内部数据成员,等等)。

In the last 15 months I use insight (came with FC6). It is not great, it is written in Tcl/Tk, but it is simple and useful. DDD is of similar quality / utility, but somewhat harder to use (various GUI gotchas and omissions). I also tried to integrate gdb with my IDE, SlickEdit. It worked OK (I played some 4 hours with it), but I did not like the GUI context switches. I like my IDE to remain unchanged while I am debugging; on Windows I use SlickEdit for IDE and Visual Studio Debugger for debugging. So from the 3: Insight, DDD and SlickEdit, Insight is my 1st choice, I use it >95% of the time, command-line gdb and DDD make up the other 5%. If I get the chance, I will eval Eclipse at some point, my work PC does not seem to have enough RAM (1GB only) to run Eclipse reasonably well.

我也听到了很多对TotalView的赞美,包括在一次工作面试中。我在2008年底获得了对我们公司的评估,但最终我们没有继续进行,因为gdb足够满足我们的需求;而且它是免费的,无处不在。