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'."
Something that might be helpful, but not exactly what you are looking for is profiling and performance tools. Intel released their compiler and vtune (a performance analysis tool) recently for Linux:
:-(
http://www.intel.com/software/products/index.htm
I can't speak for the debugger, but when we switched our simulator from gcc to icc with profiling, we gained 25-30% performance. Needless to say, that was way cool. The other threading and vtune items might provide some useful insights to your code.
I hate to say it, but all the stuff I work on is generally so small, it's not worth the overhead to attach a debugger to it, so I'm not much of an expert in this area
- Mike
[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
1.) valgrind (recently covered on slashdot)
2.) printf()
3.) gdb
4.) lint
5.) the proprietary debugger you mentioned.
6.) modify the thread library. (a niceties of open source/free software)
7.) modify your OS. (look into UML
Generally some combination of these should allow you to solve any programming problem on linux.
I find it amusing that a poster above calls everyone else illiterate for not reading the original post and then provides a link to a Transition System Analyzer for JAVA (the original poster is using C++)
UPS is the only debugger I use anymore! I've never used it in the situations you asked about (multithreaded code etc), but I have generally found it's a very fast and lean debugger. It's also cross-platform, which is nice.
(The only real downside is its user interface, which isn't too great.)
You may want to take a look at Borland's Kylix, the linux-native port of Borland's respocted IDE's for C, C++, and Delphi (they claim it supports the same features as windows versions). It comes with a high quality debugger/profiler, and, while not free, a trial version is available.
GVD is the GNU Visual Debugger, developed by ACT. It is entirily written in Ada using GTK+. It can debug programs generated with any of the GCC compilers in a variety of OSs. Check it out here
Andrei's chapter on smart pointers is available here:
http://www.moderncppdesign.com/
but you have to give an e-mail address to read it.