In This Book

Combining Debugger Commands Using Action Lists

An action list is a series of debugger commands associated with a speci￿c breakpoint, watchpoint, intercept, or tracing request. The debugger executes an action list after executing to the breakpoint location, detecting a change in the watched value, receiving an intercept, or encountering a tracing event. (See the breakpoint , watchpoint , intercept , or trace command description in the online command reference for more information.)

The following sections describe how to create action lists and how the debugger handles action lists in special situations.

Creating Action Lists

Use the -dooption to specify an action list for a breakpoint , watchpoint ,

 

intercept or trace command. For example, consider the following

5

breakpoint command:

 

 

 

breakpoint 30 -do [args; go]

 

Because of the -dooption in the preceding example, when execution reaches

 

line 30, the debugger ￿rst prints the value of the arguments to the current

 

routine (that is, the debugger executes the args command) and then resumes

 

execution (executes go). Now consider the following watchpoin t and trace

 

commands:

 

 

 

watchpoint p -do

[print

p/r]

 

trace -statement

-in sum

-do [print s]

 

In the preceding example, the -dooption to the watchpoint command causes the debugger to print the value of p divided by r whenever the value of p changes during program execution. The -dooption to the trace command, on the other hand, causes the debugger to print s at each statement (as speci￿ed by -statement) in the routine sum (as speci￿ed by -in sum).

Using Debugger Commands 5-15