October 26, 2009, 5:32 PM — GNU released gdb 7.0 at the beginning of the month. This is an important milestone for all of us.
It's important for several reasons, even if you rarely use debuggers (as I do, on current projects), work mostly in high-level languages (as I do) and/or Java, are so unfamiliar with gdb that you don't know where to begin with it, or use gdb so much and so instinctively that you don't need for it to change. As we'll see over the next few installments of "Smart Development", Version 7.0 is a great time to learn gdb.
Even if you don't touch gdb directly, it affects your world. Just as you benefit from open-source even without reading the source (through the social guarantees of security, for example), your development environment is a healthier one when you know you can put your hands on a reliable, highly-portable, very powerful debugger if you get into trouble.
"How did I get here?"
'Ever been in a debugging session, and realized, "Uh-oh: I needed to pause ten steps earlier; how am I going to find out what the variables were?" You're not alone. With 7.0, gdb fully supports "reverse execution" or "reverse debugging"): you can back your program up. gdb gives all the usual control over reverse execution: you can single-step, you can step either into subroutines or over them--backwards--you can back up until you reach a breakpoint, and so on.
That's not all. 7.0 also makes it easy to record and playback a session. This gives you both the opportunity to read the log, to learn what you did to arrive at your location, and also to retrace some or all of your path.
Moreover, you can script gdb's capabilities with Python, now. If you need to look at the contents of a complicated data structure through time, during the execution of your application, you now can code in high-level Python a little report that understands how to display the content usefully, then invoke that function during your session. Script it once, and you never again have to slow down to figure out the keystrokes to look at the contents of the location addressed by the third element of the content of ...
This is only a fraction of what 7.0 provides. I'll follow up throughout the week with more examples of how slick gdb has become.















