« Dead lined | Main | Blaming the victims »

Debugger

The concept of a debugger isn’t quite as simple as it sounds. (“Wow, a program that removes bugs?” thinks the neophyte, “Cool!”) Actually, a debugger is a sort of wrapper program that lets a programmer load their program from within it, then designate arbitrary points within the program (“break points”) where the debugger pauses execution of the program and lets the programmer check out its state. A debugger also tends to make it easy to see where a program failed, even though it won’t always tell you why. These two qualities make debuggers exceptionally useful for figuring out where the problems in your program are, even if it won’t tell you exactly what they are.

As a relative neophyte in C, I’ve become a great fan of gdb, the GNU Debugger, which is pretty useful for nearly anything compiled with gcc (the GNU Compiler Collection.) Debuggers are particularly useful for finding segfaults in C, which is my favorite way of making a program crash. A segmentation fault, put baldly, is a program trying to read data from out of bounds; trying to access the eleventh element of a ten-element array would be a good example. However, gdb can’t help with my current problems.

  • A project for MPOW, written in Perl, and not just Perl but ActiveState Perl, a Windows variant. I’ve always been bewildered by the standard Perl debugger; ActiveState’s debugger itself I’ve never touched.

  • Parallel programming, this MPI stuff I keep yakking about, is beyond the reach of gdb. How do you debug a program running on two different systems? How about one running on twelve? How about forty? Did they all crash? If not, which ones? Did they crash for the same reason? Which memory, exactly, were they accessing? LAM/MPI ships a debugger called “TotalView,” but it breaks in so many different environments (for example, if shared libraries are not enabled, which is often,) that I’ve yet to actually find it installed and working anywhere.

All of this, of course, is in the grad school spirit of opening doors to new and wonderful worlds which I have absolutely no time to explore. I wonder how many hackers out there are devoting their coding hours to building better debuggers?

Now Playing: Luther’s Got The Blues from I’m a Mountain by Sarah Harmer

Post a comment