Sun WorkShop Compiler C 5.0 User's Guide

-g

Produces additional symbol table information for the debugger.

This option invokes the incremental linker; see "-xildon" and "-xildoff". Invoke ild instead of ld unless you are using the -G or -xildoff options, or you are naming source files on the command line.

When used with the -O option, a limited amount of debugging is available. The combination, -xO4 -g, turns off the inlining that you usually get with -xO4.