with friends like these

A big part of every programmer’s life is debugging. Easily the majority, in my experience, and I like to think that I’m not a lot worse than average at this programming thing. Given that so much time is spent on it, the tools used can have a material impact on the quality of life of a debugging programmer.

On Linux, the debugger of record is “gdb”:http://sources.redhat.com/gdb/, which is often to the practice of debugging as a gasoline aquarium is to fire prevention. I’ve been playing with “some C++ software”:http://www.zeroc.com/ice.html over the weekend, and this has given me occasion to experience the “joys of gdb”:http://www.google.com/search?q=%22joys+of+gdb%22 anew:

(gdb) p *this
Segmentation fault

[...time passes, work is repeated, hopes build again...]

(gdb) p _server
Segmentation fault

Maybe “6.0″:http://sources.redhat.com/gdb/download/ANNOUNCEMENT will be better, but then maybe not:

Specifically, if you set a breakpoint in a constructor or a destructor, gdb will put a breakpoint in one of the versions, but your program may execute the other version. This makes it impossible to set breakpoints reliably in constructors or destructors.

I wonder how much MSVC costs around here.

3 comments to “with friends like these”

  1. entered 1 December 2003 @ 12:23 am

    I’ve been saying since, oh, 1994, that the last time gdb actually worked right was in 1991 on SunOS 4.1.3.

    I guess that means that some combination of C++ support and shared libraries are to blame. Both being the Purest of Evil, of course.

  2. entered 1 December 2003 @ 9:46 am

    That I was trying to debug a shared-library symbol lookup problem in a C++ app makes that ring all the more true in my sad, sad heart. You forgot threads, though.

  3. mom
    entered 1 December 2003 @ 11:48 am

    It is called MSDeveloper Studio .NET now. And worth every penny IMO. I have successfully debugged threaded services on NT with it. Actually, on the MSVC precursor, but good enough. (Of course, it was my code, too. :P)

    Just this weekend I was remarking to myself that tools make the job while slogging at my blogging page ‘design’. Make that experimentation. ‘Design’ implies some prediction of results based on knowledge of component behaviour, none of which were available to me because: I had no decent tools.