What Good Linux Debuggers Are There?
David Weekly asks: "I'm programming for a small software company that's got a fair bit of C++ code; we've been using gdb whilst on Linux, but have been a little frustrated by its shortcomings with multithreaded applications and its fumbling multiple inheritance issues. I poked around on the Net and, other than gdb, I was only able to find Etnus' TotalView as a modern, actively-developed Linux debugger. Are there really only two Linux debuggers (that one can take seriously)? How, for instance, do folks who code up Apache modules test them in multithreaded mode? (i.e., not just using '-X'.) I'd love to hear answers more substantive than 'use printf()' and/or 'just use ____, my favorite gdb frontend'."
[article author] A number of people have thoughtfully suggested trying out Intel's debugger (aka LDB). Unfortunately, from what I found, it looks like LDB has only a subset of gdb functions, and can't even do simple things, like attach to processes. It seems that Intel has given up making their own Linux debugger and has decided to join up with GDB development. That's why I didn't include it. Thanks anyhow to those who did suggest it and thanks to those of you who suggested some other debuggers; I'll take a look at them.
David E. Weekly
Code / Think / Teach / Learn
h4x0r for
Slightly off topic, but the apache project's log4j is the most elegent evolution of the "printk" school of debugging I have seen to date.
You can log against any backend source you feel like, flat files, syslog, databases, etc. You can remove the logging module entirely at runtime, without paying a performance hit for the debug statements. This saves a lot of jumping back and forth when you're trying to package up a release. If you're stuck without the fund$ for a top-end debugger it's the next best thing. It's for java, but I don't see any reason why the concept couldn't be ported to C++.