Debugging a Program With dbx

Compiling with the -g Option

To use dbx effectively, a program must have been compiled with the -g or -g0 option. The -g option instructs the compiler to generate debugging information during compilation.

For example, to compile using C++:


% CC -g example_source.cc

To compile optimized code for use with dbx, compile the source code with both the -O (uppercase letter O) and the -g options.