debug (Windows*)

Enables or disables generation of debugging information.

Syntax

Linux:

None

Windows:

/debug[:keyword]

Arguments

keyword

Is the type of debugging information to be generated. Possible values are:

none

Disables generation of debugging information.

full or all

Generates complete debugging information.

minimal

Generates line number information for debugging.

partial

Deprecated. Generates global symbol table information needed for linking.

[no]expr-source-pos

Determines whether the compiler generates source position information at the expression level of granularity.

[no]inline-debug-info

Determines whether the compiler generates enhanced debug information for inlined code.

For information on the non-default settings for these keywords, see the Description section.

Default

/debug:none

This is the default on the command line and for a release configuration in the IDE.

/debug:all

This is the default for a debug configuration in the IDE.

Description

This option enables or disables generation of debugging information. It is passed to the linker.

By default, enabling debugging, will disable optimization. To enable both debugging and optimization use the /debug option together with one of the optimization level options (/O3, /O2 or /O3).

If conflicting keywords are used in combination, the last one specified on the command line has precedence.

Option

Description

/debug:none

Disables generation of debugging information.

/debug:full or /debug:all

Generates complete debugging information. It produces symbol table information needed for full symbolic debugging of unoptimized code and global symbol information needed for linking. It is the same as specifying /debug with no keyword.

/debug:minimal

Generates line number information for debugging.

/debug:partial

Generates global symbol table information needed for linking, but not local symbol table information needed for debugging. This option is deprecated and is not available in the IDE.

/debug:expr-source-pos

Generates source position information at the statement level of granularity.

/debug:inline-debug-info

Generates enhanced debug information for inlined code.

On inlined functions, symbols are (by default) associated with the caller. This option causes symbols for inlined functions to be associated with the source of the called function.

IDE Equivalent

Visual Studio: Debugging > Enable Expanded Line Number Information (/debug:expr-source-pos)

Eclipse: None

Alternate Options

For /debug:all or
/debug

Linux: None
Windows: /Zi

See Also

Para obtener información más completa sobre las optimizaciones del compilador, consulte nuestro Aviso de optimización.