2.3.11. Generating debug information

These options enable you to specify whether debug tables are generated for the current compilation. If debug tables are generated, these options also enable you to specify the format of the debug tables. See Pragmas for more information on controlling debug information.

Note

Optimization criteria can limit the debug information generated by the compiler. See Defining optimization criteria for more information.

Compilation tools are restricted to the permitted endianness of the target microcontroller unit (MCU).

Debug table generation options

The following options specify how debug tables are generated:

-g --debug

This option switches on the generation of debug tables for the current compilation. The compiler produces the same code whether or not -g is used. The only difference is the existence of debug tables. --debug is a synonym for -g.

Using -g does not affect optimization settings. These options are specified by -O (for more details, see Multi-optimization options). By default, using the -g option alone is equivalent to:


-g -dwarf2 --debug_macros

Note

Do not rely on the implementation details of this default behavior, because it might change in future releases. The compiler issues a warning if you use the -g option without an optimization option.

--no_debug

This option switches off the generation of debug tables for the current compilation. This is the default option.

--no_debug_macros

This option, when used with -g, switches off the generation of debug table entries for preprocessor macro definitions. This can reduce the size of the debug image.

--debug_macros

This option, when used with -g, enables the generation of debug table entries for preprocessor macro definitions. This is the default. If your debugger ignores preprocessor entries, you can use --no_debug_macros to reduce the size of the debug image.

Debug table format options

The following options specify the format of debug tables generated by the compiler:

--dwarf2

This option specifies DWARF2 debug table format. This is the default.

--dwarf3

This option specifies DWARF3 debug table format.

Copyright © 2005 ARM Limited. All rights reserved.ARM DUI 0282B
Non-Confidential