|Skip Navigation Links|
|Exit Print View|
|Oracle Solaris Studio 12.3: Debugging a Program With dbx Oracle Solaris Studio 12.3 Information Library|
dbx can recognize macro definitions in two ways:
Definitions are provided by the compilers when you compile with the -g3 option if you use the default DWARF format for debugging information. They are not provided if you specify the -xdebugformat=stabs option when compiling.
dbx can recreate definitions by skimming the source file and its include files. Accurate recreation depends on access to the original sources and include files. It also depends on the availability of the pathname to the compiler used, and on compiler options like -D and -I. This information is available in both DWARF and stabs formats from Oracle Solaris Studio compiler, but not from GNU compilers. See Skimming Errors and Using the pathmap Command To Improve Skimming for information on ensuring successful skimming.
There are several factors to take into account in choosing which method you want dbx to use.
One factor is the availability of various types of information that depend on which compiler and compiler options you used to build your code. The following table shows which methods you can choose depending on the compiler and debugging information options.
Table C-1 Macro Definition Methods Available for Various Build Options
Another factor to take into account is the tradeoffs in functionality depending on which method you choose:
Size of executable. The main advantage of the skimming method is that it does not require compilation with the -g3 option because it works with the smaller executables produced by compiling with the -g option.
Debugging format. Skimming works with both DWARF and stabs. Compiling with the -g3 option to get the definitions from the compiler works only with DWARF.
Speed. Skimming takes up to one second the first time an expression is evaluation for a module for which dbx has not yet read the debugging information.
Accuracy. Information provided by the compilers when you compile with the -g3 option is more stable and accurate than information provided by skimming.
Availability of the build environment. Skimming requires that the compilers, source code files, and include files be available during debugging. dbx does not check for these items becoming out of date, so if they are likely to change, accuracy might deteriorate and it might be better to compile with the -g3 option than to depend on skimming.
Debugging on a different system from the one where the code was compiled. If you compiled the code on system A and are debugging it on system B, dbx accesses files on system A using NFS with some help from the pathmap command (see Using the pathmap Command To Improve Skimming.
The pathmap command also helps facilitate file access during skimming. It works for your program's source files and include files. But it might not work for system include files because /usr/include is not usually available through NFS, so macro definitions are extracted from /usr/include on the debugging system instead of on the build system.
You can choose to be aware of and tolerant of possible discrepancies between system include files, or choose to compile with the -g3 option.
Though Fortran compilers support macros through the cpp(1) function or the fpp(1) function, dbx does not support macro expansion for Fortran.
dbx ignores macro information generated by compiling with the -g3 option and the -xdebugformat=stabs option.
Skimming works with code compiled with the -g option and the -xdebugformat=stabs option.