Getting Started with Debugging

The Intel® Debugger (idb) is a source-level, symbolic debugger that lets you:

The idb debugger has two modes:

All examples in this guide are shown in dbx mode.

Note

For complete information about idb, see the idb man page or the online Intel® Debugger (IDB) Manual.

Debugging Options

To use the debugger, you should specify the ifort command and the -g command-line option. Traceback information and symbol table information are both necessary for debugging. If you specify -g, the compiler provides the symbol table and traceback information needed for symbolic debugging. (The -notraceback option cancels the traceback information.)

Likely uses of these options at the various stages of program development are as follows:

During early stages of program development, use the -g option to create unoptimized code (optimization level -O0). This option also might be chosen later to debug reported problems from later stages.

Traceback and symbol table information result in a larger object file. During the later stages of program development, use -g0 or -g1 to minimize the object file size and, as a result, the memory needed for program execution, usually with optimized code. (The -g0 option eliminates the traceback information.)

When you have finished debugging your program, you can recompile and relink to create an optimized executable program or remove traceback and symbol table information with the strip command. (See strip(1).)

See the -debug keyword option to learn more about settings that enhance debugging.

Note

Debugging of optimized code is not fully supported on Intel platforms.