Oracle® Solaris Studio 12.4: Debugging a Program With dbx

Exit Print View

Updated: January 2015
 
 

Object File Loading

When the object (.o) files are linked together, the linker can optionally store only summary information into the resulting load object. This summary information can be used by dbx at runtime to load the rest of the debug information from the object files themselves instead of from the executable file. The resulting executable has a smaller disk-footprint, but requires that the object files be available when dbx runs.

You can override this requirement by compiling object files with the -xs option to cause all the debugging information for those object files to be put into the executable at link time.

If you create archive libraries (.a files) with your object files and use the archive libraries in your program, then dbx extracts the object files from the archive library as needed. The original object files are not needed at that point.

The only drawback to putting all the debugging information into the executable file is using additional disk space. The program does not run more slowly, because the debugging information is not loaded into the process image at runtime.

The default behavior when using stabs is for the compiler to put only summary information into the executable.

Object files can be created with DWARF using the –xs option. For more information, see Index DWARF (-xs[={yes|no}]).


Note -  The DWARF format is significantly more compact than recording the same information in stabs format. However, because all the information is copied into the executable, DWARF information can appear to be larger than stabs information.

For more information about the stabs index, see the Stabs Interface guide found with the path install-dir/solarisstudio12.4/READMEs/stabs.pdf.