Example of Setting a Watch Condition
In this example, you watch a variable SALARY in program MYLIB/PAYROLL. To set the watch condition, type:
WATCH SALARY
on
a debug line, accepting the default value for the watch-length.If the value of the variable SALARY changes subsequently, the application stops and the Display Module Source display is shown, as illustrated in Figure 1.
Figure 1. Example of Message Stating
WATCH was Successfully Set
Display Module Source
Program: PAYROL Library: MYLIB Module: PAYROLL
52 C eval cnt = 1
53 C dow (cnt < EMPMAX)
54 C eval Pay_exmpt(cnt) = eflag(cnt)
55 C eval cnt = cnt + 1
56 C enddo
57 C
58 C eval index = 1
59 C dow index <= cnt
60 C if Pay_exmpt(index) = 1
61 C eval SALARY = 40 * Pay_wage(index)
62 C eval numexmpt = numexmpt + 1
63 C else
64 C eval SALARY = Pay_hours(index)*Pay_wage(index)
65 C endif
66 C eval index = index + 1
67 C enddo
More...
Debug . . . _________________________________________________________________
_______________________________________________________________________________
F3=End program F6=Add/Clear breakpoint F10=Step F11=Display variable
F12=Resume F17=Watch variable F18=Work with watch F24=More keys
Watch number 1 at line 65, variable: SALARY
- The line number of the statement where the change to the watch variable was detected is highlighted. This is typically the first executable line following the statement that changed the variable.
- A message indicates that the watch condition was satisfied.
Note: If a text view is not available, a blank Display Module Source display is shown, with the same message as above in the message area.The following programs cannot be added to the ILE debug environment:
- ILE programs without debug data
- OPM programs with non-source debug data only
- OPM programs without debug data
In the first two cases, the stopped statement number is passed. In the third case, the stopped MI instruction is passed. The information is displayed at the bottom of a blank Display Module Source display as shown below. Instead of the line number, the statement or the instruction number is given.
Figure 2. Example of a Display Module
Source Panel
Display Module Source
(Source not available)
F3=End program F12=Resume F14=Work with module list F18=Work with watch
F21=Command entry F22=Step into F23=Display output
Watch number 1 at instruction 18, variable: SALARY