4.4.4 Tracing Program Execution
The SET TRACE command lets you select tracepoints ,
which are locations for tracing the execution of your program
without stopping its execution. After setting a tracepoint, you
can start execution with the GO command and then monitor
the PC's path, checking for unexpected behavior. By setting a
tracepoint on a routine, you can also monitor the number of
times the routine is called.
As with breakpoints, every time a tracepoint is reached, the
debugger issues a message and displays the source line. It
can also display other information that you have specified (as
shown in the last example in this section, in which the value
of a specified variable is displayed). However, at tracepoints,
unlike breakpoints, the program continues executing, and the
debugger prompt is not displayed. For example:
DBG> SET TRACE COUNTER
DBG> GO
.
.
.
trace at TEST\COUNTER
34: SUB COUNTER(LONG X,Y)
.
.
.
When using the SET TRACE command, you specify address
expressions, qualifiers, and optional clauses exactly as with
the SET BREAK command.
The /LINE qualifier instructs the SET TRACE command to
trace every line and is a convenient means of checking the
execution path. By default, lines are traced within all called
routines as well as the currently executing routine. If you
do not want to trace system routines or routines in shareable
images, use the /NOSYSTEM or /NOSHARE qualifiers. For
example:
DBG> SET TRACE/LINE/NOSYSTEM/NOSHARE
The /SILENT qualifier suppresses the trace message and
source code display. This is useful when you want to use the
SET TRACE command to execute a debugger command at
the tracepoint. For example:
DBG> SET TRACE\SILENT %LINE 83 DO (EXAMINE STATUS)
DBG> GO
.
.
.
SCREEN_IO\CLEAR\STATUS: 'OFF'
.
.
.