views:

2747

answers:

8

All the work I've done in C++ have either been to small to require a good debugger or been on windows so I've used Visual Studio at work.

Now I'm faced with a situation where I need to write some C++ while being on Ubuntu, so after looking over some of the alternatives I have when picking between the IDEs I can honestly say I don't have the foggiest on which one to choose (good debugger > all other features for me, but any recommendations are welcome)

So, to sum it up: Which is the "best" (I assume a lot of people will have a lot of opinion on which one is the "best") C++ IDE/debugger for Linux?


Good question, of course, but its been done before:

+3  A: 

Eclipse

Chris Ballance
+1  A: 

I like the zero-bugs debugger. It's commercial, but you can download a trial version (while limited beta versions are free) and it's got a fair price.

Anyway, I'm using emacs+gdb personally. I put screenshots of it in action on this answer. By the way, next gdb version will support scripting it with python too.

Johannes Schaub - litb
A: 

Most (if not all) Linux debuggers are actually gdb wrapped up somewhat. If you just want a debugger, about the best is DDD. For a simple yet workable IDE, I recommend Code::Blocks at http://www.codeblocks.org.

anon
+3  A: 

vim + terminal + gdb + frontend

jimi hendrix
+1  A: 

I found Code::Blocks to be the best IDE to work with for C++ on Linux. Its easy to set up (apt-get install ...) , debugging is a breeze, and it has all the mod-cons you'd expect from a modern IDE.

Il-Bhima
A: 

Just for balance, I'll put in a word for KDevelop - maybe not the most polished IDE, but it works (and it has pretty decent debugger integration with gdb)

David Zaslavsky
+3  A: 

I've recently discovered that emacs is great at this (and I've been using it for a decade!)...

Before you dismiss this, check this image out:

Emacs/GDB

It does nearly everything fancy graphical debuggers can do, and I suspect some things they can't, like hardware read watches.

Then check out this article:

gdb in emacs

dicroce
+2  A: 

Unfortunately, debugging C++ on Linux is difficult and not too much fun... GDB is the standard debugger and it does not handle c++ well. Just try displaying STL collections and you'll see what I mean -- you get to see the internal structure of the class ... and it is not a pretty sight.

There is some hope, however. You can take a look at Project Archer which attempts to marry a python interpreter to gdb and can pretty print STL collections (and with some python scripts -- your own classes as well). It's not part of any official gdb release but you can download and compile a version from the developer git repository if you like living on the edge :)

ZeroBugs (mentioned in another answer) is a commerical debugger which takes a similar approach. I have never used it as they supply binary packages for a limited number of distributions.

As for IDEs... I'm using DDD as a gdb frontend but you might be better off with plain old emacs. DDD hasn't been updated in years (except perhaps minor fixes) and it shows.

nimrodm
It's a sad statement that gdb is the best debugger for Linux. Maybe it was just unfamiliarity, but I used it after years of windbg and ntsd debugging on Windows and it fell way short. Commands were longer. Nothing to dump a whole object or struct.
Steve Rowe