C++ User's Guide

-g

Instructs both the compiler and the linker to prepare the file or program for debugging.

The tasks include:

Interactions

You can use this option with -xO to get the optimization level that you desire.

If you use this option with -xO, you will get limited debugging information.

When you specify this option, the +d option is specified automatically.

This option makes -xildon the default incremental linker option in order to speed up the compile-edit-debug cycle.

This option invokes ild in place of ld unless any of the following are true:

See also

+d, -g0, -xildoff, -xildon, -xs, ld(1) man page, Debugging a Program With dbx (for details about stabs)