debug (Linux* and Mac OS* X)

Specifies the type of debugging information generated by the compiler.

IDE Equivalent

None

Architectures

IA-32 architecture, Intel® 64 architecture, IA-64 architecture

Syntax

Linux and Mac OS X: -debug [keyword]
Windows:  None

Arguments

keyword Is the type of debugging information to be generated. Possible values are:
  full Generates complete debugging information.
  all Generates complete debugging information (same as full).
  minimal Generates line number information for debugging.
  none Disables generation of debugging information.
  [no]inline-debug-info Determines whether enhanced debug information is produced for inlined code.
  [no]semantic-stepping Determines whether enhanced debug information useful for breakpoints and stepping is produced.
  [no]variable-locations Determines whether enhanced debug information useful in finding scalar local variables is produced.
  extended Enables semantic-stepping and variable-locations.

Default

-debug none No debugging information is generated.

Description

This option specifies the type of debugging information generated by the compiler

Note that if you turn debugging on, optimization is turned off.

Option Description
-debug full or
-debug all
Generates complete debugging information. This is the default if -debug is specified with no keyword.
-debug minimal Generates line number information for debugging.
-debug none Disables generation of debugging information.
-debug inline-debug-info Produces enhanced debug information for inlined code.
It provides more information to debuggers for function call traceback. The Intel® Debugger (IDB) has been enhanced to use richer debug information to show simulated call frames for inlined functions.
-debug semantic-stepping Produces enhanced debug information useful for breakpoints and stepping.
It tells the debugger to stop only at machine instructions that achieve the final effect of a source statement. For example, in the case of an assignment statement, this might be a store instruction that assigns a value to a program variable; for a function call, it might be the machine instruction that executes the call. Other instructions generated for those source statements are not displayed during stepping.
-debug variable-locations Produces enhanced debug information useful in finding scalar local variables.
It uses a feature of the Dwarf object module known as "location lists". This feature allows the run-time locations of local scalar variables to be specified more accurately; that is, whether, at a given position in the code, a variable value is found in memory or a machine register. The Intel Debugger (IDB) is able to process location lists and display local variable values with greater accuracy at run-time.
-debug extended Sets the debug options semantic-stepping and variable-locations.

Alternate Options

-debug inline-debug-info Linux: -inline-debug-info
Mac OS X: None
Windows: None

See Also

debug (Windows*) compiler option

Building Applications: Debugging Overview