By rchrd on Jan 12, 2009
Debugging your code is a necessary evil. Things never seem to work the way you expect them. Programs crash or get the wrong results, leaving you wondering why. So the next step is to invoke a debugger on the code.
Most compilers, like the Sun Studio compilers, have a -g option or equivalent, which adds debugging information, like symbol tables, to the object code. The Sun Studio debugging tool, dbx, reads the object code, symbol tables, and a core dump if available, and tries to locate the spot in the program where it died. Now you can look at what was happening when the code crashed and try to determine the cause.
But debugging code is an art. There's no good book on the subject of debugging code that I know of. Programmers learn by accumulating experience.
Debuggers have typically been command-line tools, like dbx. But it helps to use a GUI debugger that can reference the source code.
A new standalone lightweight GUI debugger,
dbxtool, is part of the Sun Studio Express 11/08 release and is fully
integrated into the Sun Studio NetBeans-based IDE.
There's a new screencast
you can watch to learn about
dbxtool and the features of the
dbx debugger, and it's run by Dave Ford from the Sun Studio dbx engineering team. Click on the image to start the screencast.
UPDATE: dbxtool is now part of the current Sun Studio 12 Update 1 release.