14

I'm looking for the perfect Linux C++ debugger. I don't expect success, but the search should be informative.

I am a quite capable gdb user but STL and Boost easily crush my debugging skills. It not that I can't get into the internals of a data structure, it's that it takes so long I usually find another way( "when in doubt, print it out" ).

The macro language for gdb is weird and not very adaptive. Just look at the code for the stanford gdb utils to print out stl structures.

In short I'm unhappy with what I've got.

I recently stumbled upon Zero Bugs. It looks like a silver bullet. What do the current Zero Bugs users think of it?

Has anyone found other good solutions to the Linux C++ Debugger problem?

deft_code
  • 57,255
  • 29
  • 141
  • 224

10 Answers10

11

A development branch of gdb (part of gdb's Project Archer) adds Python support to gdb (to replace gdb's macros). There's a series of blog postings starting here that extensively covers getting started with Python-enabled gdb and offers several tutorials on using Python for defining new gdb commands and pretty printing of C++ data structures.

Josh Kelley
  • 56,064
  • 19
  • 146
  • 246
  • does the python interface support reflection? That would make inspection scripts much more robust/powerful? – deft_code Jan 12 '09 at 18:55
  • I'm pretty inexperienced at Python, and I haven't yet tried out python-gdb, but if I understand the blog articles correctly, yes, the interface supports reflection. – Josh Kelley Jan 12 '09 at 19:29
4

UndoDB is amazing if you don't mind paying for it. The reversible capability is much much faster than GDB's. http://www.undo-software.com/

tombritt
  • 41
  • 1
2

There are simple scripts which let you dump STL structures from GDB.

Take a look here

Kristof Provost
  • 26,018
  • 2
  • 26
  • 28
1

You can try NetBeans IDE 6.5 with gdb 6.8, it is quite powerful! http://www.netbeans.org/downloads/index.html

1

ddd (data display debugger)is quite good.....it is basically a visual gdb....

1

I use the following environment:

http://ec-lang.org/

It is a complete development environment for the eC language.

However, you can have a project with just c or c++ files without any eC specific files and build and debug them using the IDE.

This is the closest you will ever come to a "Borland C" like experience under linux.

It can be installed on Ubuntu/Debian with the following command:

sudo apt-get install ecere-sdk

Paul Schutte
  • 189
  • 1
  • 8
1

Recentg gdb (e.g. version 8.1) and g++ (e.g. GCC 7, in february 2018) are able to debug standard C++ containers thru Python scripts.

Basile Starynkevitch
  • 223,805
  • 18
  • 296
  • 547
0

I haven't done C++ development in Linux for a while now but when I did I had good luck when KDevelop's debugger. Nothing revolutionary but it let you quickly explore object properties like you are looking for.

alxp
  • 6,153
  • 1
  • 22
  • 19
0

Try ddd.

Brian Clapper
  • 25,705
  • 7
  • 65
  • 65
  • I used to use DDD. The UI is awful, but it's still very useful as I can drop down to straight GDB when DDD is lacking. How does DDD improve on the C++ problem? I seems less useful for inspecting STL than GDB with the stanford scripts. – deft_code Jan 12 '09 at 18:58
0

You can use Eclipse to step through C and C++ code if you are looking for an IDE type of debugger instead of a command-line debugger. It isn't perfect, but I've found it to work well for people already familiar with IDE debugging tools.

I am also partial to Valgrind for detecting memory errors.

Paul Vincent Craven
  • 2,027
  • 3
  • 19
  • 24