User`s guide
5
Chapter 2
2. Running dbx
This chapter explains how to run dbx—specifically, it covers:
• “Compiling a Program for Debugging Under dbx”
• “Compiling and Linking Programs With Dynamic Shared Objects”
• “Invoking dbx” from a shell
• “Running Your Program”
• “Automatically Executing Commands on Startup”
• “Using Online Help”
• “Entering Multiple Commands on a Single Line”
• “Spanning a Command Across Multiple Lines”
• “Invoking a Shell” from dbx
• “Quitting dbx”
Compiling a Program for Debugging Under
dbx
Before using dbx to debug a program, compile the program using the –g
option (for example, cc –g). The –g option includes additional debugging
information in your program object so that dbx can list local variables and
find source lines.
If you use dbx to debug code that was not compiled using the –g option, local
variables are invisible to dbx, and source lines may appear to jump around
oddly as a result of various optimizations. It is more difficult to debug code
without reliable references to lines of source code.