4.6.5.2 G: Produce Debugging Information Option

The -gformat option instructs the compiler to produce additional information, which can be used by hardware tools to debug your program.

The support formats are tabulated below.

Table 4-23. Supported Debugging File Formats
Format Debugging file format
-gcoff COFF
-gdwarf-3 ELF/DWARF release 3.
-ginhx32 Intel HEX with extended linear address records, allowing use of addresses beyond 64 KB.
-ginhx032 INHX32 with initialization of upper address to zero.

By default, the compiler produces DWARF release 3 files.

The compiler supports the use of this option with the optimizers enabled, making it possible to debug optimized code; however, the shortcuts taken by optimized code may occasionally produce surprising results, such as variables that do not exist and flow control that changes unexpectedly.