Setting Up a Trace

Related Topics:

Breakpoints Window Dbx Commands Window
Breaking On Value Change Setting the Trace Speed

You can set a trace that 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, you use the Breakpoint window to set up a trace since traces and breakpoints share similar event handlers. The output appears in the Dbx Commands window.

To set up a trace:

1. In the Debugging Window, choose Windows Breakpoints.

2. If the Details pane is not displayed, click the Add/Change Breakpoint button (the Add/Change Breakpoint button toggles to Hide Details).

3. From the Event list box, choose the type of event you want to trace.

4. Type any event information in the Event text box.

5. Choose Action Trace.

6. Click Add.

You set options on a trace in the same way you set options on breakpoints. For instructions, see Setting Breakpoint Options.

To open the Dbx Commands window to view the trace output:
   Choose Windows Dbx Commands from the Debugging window.


Note - Set the On Value Change event to print a trace when the value of a variable changes. Set the If option to restrict the trace to print only when a particular condition evaluates to true. For line tracing, set Event at Custom Step. For line tracing within a function, set Event at Custom next and Option at In Function.