Intel® C++ Compiler Classic Developer Guide and Reference

ID 767249
Date 12/16/2022
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

debug (Linux* and macOS)

Enables or disables generation of debugging information.

Syntax

Linux:

-debug [keyword]

macOS:

-debug [keyword]

Windows:

None

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.

[no]emit_column

Determines whether the compiler generates column number information for debugging.

[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.

[no]pubnames

Determines whether the compiler generates a DWARF debug_pubnames section.

[no]semantic-stepping

Determines whether the compiler generates enhanced debug information useful for breakpoints and stepping.

[no]variable-locations

Determines whether the compiler generates enhanced debug information useful in finding scalar local variables.

extended

Generates complete debugging information and also sets keyword values semantic-stepping and variable-locations.

[no]parallel
(Linux only)

Determines whether the compiler generates parallel debug code instrumentations useful for thread data sharing and reentrant call detection.

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

Default

varies

Normally, the default is -debug none and no debugging information is generated. However, on Linux*, the -debug inline-debug-info option will be enabled by default if you compile with optimizations (option -O2 or higher) and debugging is enabled (option -g).

Description

This option enables or disables generation of debugging information.

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).

Keywords semantic-stepping, inline-debug-info, variable-locations, and extended can be used in combination with each other. 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 is the same as specifying -debug with no keyword.

-debug minimal

Generates line number information for debugging.

-debug emit_column

Generates column number information for debugging.

-debug expr-source-pos

Generates source position information at the statement level of granularity.

On Linux* systems, debuggers read debug information from executable images. As a result, information is written to object files and then added to the executable by the linker.

On macOS systems, debuggers read debug information from object files. As a result, the executables don't contain any debug information. Therefore, if you want to be able to debug on these systems, you must retain the object files.

IDE Equivalent

Visual Studio: None

Eclipse: Advanced Debugging > Enable Parallel Debug Checks (-debug parallel)

Debug > Enable Expanded Line Number Information (-debug expr-source-pos)

Xcode: None

Alternate Options

For -debug full, -debug all, or -debug

Linux and macOS: -g

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

For -debug variable-locations

Linux and macOS: -fvar-tracking

Windows: None

For -debug semantic-stepping

Linux and macOS: -fvar-tracking-assignments

Windows: None

See Also