Oracle® Solaris Studio 12.4: Debugging a Program With dbx

Exit Print View

Updated: January 2015
 
 

Setting Breakpoints

    In dbx, you can use three commands to set breakpoints:

  • stop – If the program arrives at a breakpoint created with a stop command, the program halts. The program cannot resume until you issue another debugging command, such as cont, step, or next.

  • when – If the program arrives at a breakpoint created with a when command, the program halts and dbx executes one or more debugging commands, then the program continues unless one of the executed commands is stop.

  • trace – A trace displays information about an event in your program, such as a change in the value of a variable. Although a trace’s behavior is different from that of a breakpoint, traces and breakpoints share similar event handlers. If a program arrives at a breakpoint created with a trace command, the program halts and an event-specific trace information line is emitted, then the program continues.

The stop, when, and trace commands all take as an argument an event specification, which describes the event on which the breakpoint is based. Event specifications are discussed in detail in Setting Event Specifications.

To set machine-level breakpoints, use the stopi, wheni, and tracei commands. For more information, see Chapter 18, Debugging at the Machine-Instruction Level.


Note -  When debugging an application that is a mixture of Java code and C JNI (Java Native Interface) code or C++ JNI code, you might want to set breakpoints in code that has not yet been loaded. For information on setting breakpoints on such code, see Setting Breakpoints in Native (JNI) Code.