Debugging

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.

Comments:

Post a Comment:
Comments are closed for this entry.
About


Deep thoughts on compiling C, C++, and Fortran codes with Oracle Solaris Studio compilers, especially optimization and parallelization, from the Solaris Studio documentation lead, Richard Friedman. Email him at
Richard dot Friedman at Oracle dot com

When Run Was A Compiler

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today