To suppress expansion of inline functions, use the +d option.

-g1

Like the -goption, the -g1option causes the compiler to generate minimal information for the debugger. It uses an algorithm that attempts to reduce duplication of debug information. To suppress expansion of inline functions, use the +d option.

Differences Between -g, -g0, and -g1 Options

The -g, -g0, and -g1options generate debug information. The difference is that the -g0option emits full debug information about every class referenced in a file, which can result in some redundant information.

The -gand -g1options emit a subset of this debug information, thereby decreasing the size of your object file. If you compile your entire application with -gor -g1,no debugger functionality is lost.

NOTE: If you compile part of an application with -gor -g1and part with debug off, (that is, with neither the -g, the -g0, nor the -g1option) the resulting executable may not contain complete debug information. You will still be able to run the executable, but in the debugger, some classes may appear to have no members.

When to use -g, -g0, and -g1

Use -gor -g1when you are compiling your entire application with debug on and your application is large, for example, greater than 1 MB.

Use -g0when either of the following is true:

You are compiling only a portion of your application with debug on, for example, a subset of the files in your application.

You are compiling your entire application with debug on and your application is not very large, for example, less than 1 MB.

-g, -g1 Algorithm

In general, the compiler looks for the first non-inline, non-pure (non-zero) virtual function in order to emit debug information for a class.If there are no virtual member functions, the compiler looks for the first non-inline member function.

If there are no non-inline member functions, debug information is always generated.

A problem occurs if all functions are inline; in this case, no debug information is generated.

+macro_debug

This option controls the emission of macro debug information into the object file.

Set +macro_debug to one of the following required options:

ref Emits debug information only for referenced macros. This is the default for -g,-g1,or -g0.

all Emits debug information for all macros. This option can cause a significant increase in object file size.

none Does not emit any macro debug information.

One of the -goptions (-g, -g0, or -g1) must be used to enable the +macro_debug option.

36 Command-Line Options