g, Zi, Z7

Tells the compiler to generate full debugging information in the object file or a project database (PDB) file.

IDE Equivalent

Windows: General > Debug Information Format

Linux: General > Include Debug Information

Mac OS X: General > Generate Debug Information

Architectures

IA-32, Intel® 64 architectures

Syntax

Linux and Mac OS X:

-g

Windows:

/Zi

/Z7

Arguments

None

Default

OFF

No debugging information is produced in the object file or in a PDB file.

Description

Options -g (Linux* OS and Mac OS* X) and /Z7 (Windows*) tell the compiler to generate symbolic debugging information in the object file, which increases the size of the object file. The /Zi option (Windows) tells the compiler to generate symbolic debugging information in a PDB file.

If you want to name the file, use option /Fd; otherwise, the PDB file used by the compilation step will be named vc90.pdb in Microsoft Visual Studio* 2008, and vc100.pdb in Microsoft Visual Studio* 2010. Note that Microsoft Visual Studio users do not normally need to specify this option because the environment sets it correctly.

The compiler does not support the generation of debugging information in assemblable files. If you specify these options, the resulting object file will contain debugging information, but the assemblable file will not.

These options turn off O2 and make O0 (Linux OS and Mac OS X) or Od (Windows) the default unless O2 (or higher) is explicitly specified in the same command line.

On Linux* OS using Intel® 64 architecture and Linux OS and Mac OS* X systems using IA-32 architecture, specifying the -g or -O0 option sets the -fno-omit-frame-pointer option.

When compiling under Microsoft Visual Studio* 2005 or when option /Qvc8 is used, the /Zd option is treated as equivalent to the /Z7 option. That is, the debug information is emitted to the object file by either option. There is no way to emit debug information to the pdb file. This is to maintain compatibility with previous versions of the Intel compiler's behavior when performing parallel builds.

Alternate Options

/Zi

Linux and Mac OS X: None

Windows: /debug:full, /debug:all, /debug, or /ZI

See Also


Submit feedback on this help topic

Copyright © 1996-2011, Intel Corporation. All rights reserved.