开发者

How can you reach the same level of efficiency using gdb as you do with a visual debugger?

开发者 https://www.devze.com 2023-03-12 15:15 出处:网络
I know this is like heresy, but I simply can\'t see how using gdb can be more efficient, in daily debug use (not advanced dumping and logging debug), than a visual debugger.

I know this is like heresy, but I simply can't see how using gdb can be more efficient, in daily debug use (not advanced dumping and logging debug), than a visual debugger.

I come from a background of .Net (Love the environment hate the mentality) and over the past coupld of ye开发者_如何学运维ars moved to PHP & C++. I am now developing a project in C++, using Eclipse, and hate how heavy the editor is, so I've moved to Textmate. But debugging is so uncomfortable. I'm using gdb, but miss visual debug, which is so much easier and efficient.

And yet, every one says - Learn to use gdb properly! So I'm asking- how do I use gdb properly & efficiently?


You could use gdb with an IDE like KDevelop. It has an visual interface so that helps.
Or GDB with Emacs, It does nearly everything fancy graphical debuggers can do and with ease.

Just to add, You can have a look at this article. It tells about some nice tricks.


You could try qt-creatror, which has also nice and easy GDB visual interface.


What about DDD ?


As for me, I always use gdb's TUI mode. From gdb manual:

The gdb Text User Interface (TUI) is a terminal interface which uses the curses library to show the source file, the assembly output, the program registers and gdb commands in separate text windows. The TUI mode is supported only on platforms where a suitable version of the curses library is available.

It brings some visual debugging to gdb and it's enough for me. I usually start gdb in regular command line mode, watch backtraces and set breakpoints in it. When I want to look at source code I swith to TUI mode with key binding C-x C-a and switch back to look backtraces for example. This is built-in ready to use feature of gdb. You need not any additional software like KDevelop or Emacs to use it.


I use netbeans for C++. It integrates with gdb and gives you visual debugging. It's not as nice as Visual Studio but it's close. It's cleaner and lighter than Eclipse. It wasn't easy to get everything set up on Windows though. I can provide some pointers there if you need them


Perhaps gdb is even more efficient. It can make use of core dumps when debugging hard to reproduce bugs like peculiar dead locks. It can also debug running processes. Other features like conditional breakpoints, and more recently developed reverse execution also make gdb stand out.

Disclaimer: I don't use a visual debugger, and I am not very sure if they support the above.

0

精彩评论

暂无评论...
验证码 换一张
取 消