views:

1723

answers:

8

I am developing c on linux using vim and debugging using ddd. However I find that ddd performs very poorly at scrolling on this machine so its sometimes very frustrating to use.

I like the way that ddd maps fairly closely to the gdb command set as this means I am free to use gdb commands when I choose, but using gdb itself is not an option as it does not do a great job of displaying the source.

Can anybody suggest a decent alternative to ddd? I am not looking for an IDE, merely a reasonably well implemented gui facade to gdb that is free software.

+5  A: 

KDbg (http://www.kdbg.org/)

Adrian Panasiuk
First impressions: The opensuse11 package is buggy and the icon it installs doesn't launch the app, but I can launch it myself from /opt/kde3/bin/kdbg. Attaching to a process forces you to type the process number instead of searching the process list for a process with the same name as the binary you just loaded
frankster
The variable display in KDbg is nice.
frankster
though on the other hand, it seems like a bit of a pain to view the values of expressions such as "Array[Index].Struct.Member"
frankster
its a bit annoying having to break execution in order to disable a breakpoint
frankster
and if you want to detach from a process it seems you have to force it by loading a different file
frankster
double clicking on a breakpoint in the breakpoint list doesn't take you to the corresponding line of code
frankster
+3  A: 

You might like: insight - Redhat's debugger based on gdb

These tools also have gui's:

Sun Studio Debugger

I haven't used the Sun Studio Debugger in a while, but it used to have it's own version of gvim and emacs where you could actually set breakpoints by clicking next to the source code.

Intel Debugger

And I think Eclipse has debugger integration.

And I think that most of these tools are still free, but not necessarily open source.

Juan
as an additional note, the old version of Sun Studio on Linux used the gcc compiler with gdb. I don't know if it is still compatible as they now ported their compilers to Linux.
Juan
Insight's attach to process window is buggy - the filter box does nothing. However at least it puts up a process list which is a slight improvement on kdbg.
frankster
The drop down box with a list of functions to browse to in the source is a nice touch.
frankster
twice brought down my x server when I attached to a process, continued the process then attempted to pause the process.I can rule Insight out.
frankster
From what I can see, the Intel Debugger is available with the Intel Compiler but you can only get a zero-cost license for non-commercial use.
frankster
Sun Studio debugger (dbxtool) is based on java so its startup is rather slow.
frankster
Stun Studio debugger successfully pops up a tooltip with the value when you mouseover variables of the form Array[Index].Struct.Member, which none of the other GUIs have been able to. (of course GDB can always do this with a print command but for some reason none of the GUIs have implemented support for this).
frankster
Overall, I like a lot of things about dbxtool but the java-lagginess is such a shame.
frankster
having problems with dbxtool on a 64-bit environment - dbx itself will load a 64-bit executable, but when I load the executable via dbxtool, it gives an unsupported architecture error, presumably because its trying to load it into the 32-bit version of dbx
frankster
+2  A: 

you could try xxgdb but it's very old, i don't even know if it's still mantained

tr3
+1  A: 

Unfortunately I haven't tried anything but GDB and DDD, but there's a list of GDB front-ends on Wikipedia, including KDbg and xxgdb as recommended by others, but several more. Perhaps one of those will work for you while still giving you the ability to use GDB commands when you want to. In particular, it lists Clewn (I keep meaning to try that out), which uses GVim as a front-end as well as cgdb, which runs in the terminal (using ncurses), has vi-style keys and shows syntax-highlighted source.

Jefromi
+2  A: 

Have you looked at the Emacs GDB integration? It's quite good, once you work out how to use it. Here's a screenshot: http://p.blog.csdn.net/images/p_blog_csdn_net/ariesjzj/pic3.jpg.

Alternatively, there's Eclipse. It's very pretty, and seems pretty comprehensive but I haven't used it much.

Failing that, I just use GDB in TUI mode (type 'layout next' lots of times until the display looks 'prettier').

I actually really miss Visual Studio now that I'm stuck developing for Linux and embedded systems.

DaveS
aha I didn't know about this TUI mode of gdb. Its not great but it certainly addresses to some extent my gripe about gdb not displaying the source very well.
frankster
I just type layout - it gives an error but ends up with the layout most useful to me :D
frankster
+2  A: 

I use Eclipse CDT in my daily basis as well as Visual Studio and it is very good tool, as good as Visual Studio. It uses all the Eclipse infrastructure to create a very good gdb graphical interface. Is like debugging Java but with C++.

If you don't want to generate eclipse projects just for debugging because you still want to use vim as an editor you might want to know that Cmake has eclipse project generator. Some links that might help you regarding this issue: 1, 2, 3

fco.javier.sanz
+2  A: 

Well I tend to use either cgdb, kgdb or ddd. (and since you can't use ddd...)

cgdb is almost like the normal gdb but it shows the code in a split window above.

Johan
+2  A: 

Don't give up on DDD completely. I agree that the interface needs a major overhaul, but there were some rumblings back in 2007 for a GTK overhaul.

Also, keep an eye on this as well.

supercheetah
This is kind of not useful today (even thou I give you +1 for the fact that there is hope for ddd ;)
Johan