-g

Description

Generates information used for debugging tools such as the IBM Debugger Version 3.1.

Syntax

Read syntax diagramSkip visual syntax diagram>>- -g---------------------------------------------------------><

Notes

Specifying -g will turn off all inlining unless you explicitly request it. For example:

Options Effect on inlining
-g No inlining.
-O Inline declared functions.
-O -Q Inline declared functions and auto inline others.
-g -O Inline declared functions.
-g -O -Q Inline declared functions and auto inline others.

The default with -g is not to include information about unreferenced symbols in the debugging information.

To include information about both referenced and unreferenced symbols, use the -qdbxextra option with -g.

To specify that source files used with -g are referred to by either their absolute or their relative path name, use -qfullpath.

You can also use the -qlinedebug option to produce abbreviated debugging information in a smaller object size.

Example

To compile myprogram.c to produce an executable program testing so you can debug it, enter:

xlc myprogram.c -o testing -g 

To compile myprogram.c to produce an executable program named testing_all, and containing additional information about unreferenced symbols so you can debug it, enter:

xlc myprogram.c -o testing_all -g -qdbxextra 

Related information