HP/DDE Debugger User's Guide: HP 9000 Series 700/800 Computers > Chapter 3 Using Monitors (Breakpoints,
Watchpoints, Traces, and Intercepts) Setting Traces |
|
Traces are useful for monitoring the flow of a program. After setting a trace, for example, you can see when a particular function is called or when certain statements are executed. By default, setting a trace will display every statement, as it is executed, in the debugger output area. However, you can also set traces that stop execution or that execute debugger commands. Several levels of trace granularity are available:
Traces can also be restricted to certain blocks. The debugger allows you to narrow traces to a particular file, C function or C++ object. See Chapter 7 “Identifying Program Objects ” for an explanation of blocks. Traces on procedure entry or exit can take a significant amount of time for the debugger to execute. Eliminating entry/exit granularity causes the debugger to run faster, but target program execution may be much slower. A variety of trace commands are available from the Trace menu. Choose the appropriate option under Trace:Trace Every to enable tracing. As Figure 3-6 “The Trace Menu ” shows, the Trace menu is a Tear-off Menu. When you click on the dashed line at the top of the Trace menu, the menu is displayed in its own window. The menu persists so that you can invoke commands from it without having to redisplay it. You can also move the menu to a convenient place in your workspace. The Trace Set/Change dialog box allows you to specify all aspects of a trace. Invoke it by selecting Trace:Set. The dialog box in Figure 3-7 “The Trace Set/Change Dialog Box ” appears. From the Trace Set/Change dialog box, you can:
To see a listing of traces, select Trace:Show. The following example shows the result of invoking default tracing on the sample program average:
In addition, you can use the trace command to:
See the online command reference for more information on the trace command and its options. |