In the previous debugging session, you set breakpoints and monitored values using the CodeWatch GUI. You can also carry out those commands in the Command window as well as more complex debugging tasks: for example, the
Watch command enables you to pause execution of the program whenever the value of a particular variable changes, and the
Step command enables you to configure a set number of statements to execute before stopping.
- In PL/I Explorer, submit the JCL file to the PLIDEMO server again.
- When CodeWatch starts, click
View > Command window.
- Set the same watchpoints as before: in the text entry box at the bottom of the
Command window, type the following.
Tip: The text entry box is the white space at the bottom of the window.
WATCH SYSIN_NUM_RECS
press
Enter, then type
WATCH SYSPRINT_BUFF
and press
Enter again.
You can view a list of all watchpoints by entering
LWATCH /ALL.
- Set the same breakpoints as before. To do this in the
Command window, enter these commands:
BREAKPOINT 77
BREAKPOINT 96
You can view a list of all watchpoints by entering:
LBREAKPOINT /ALL
- Type
CONTINUE and press
Enter. The program starts executing and stops when it reaches a conditional statement or the value of a variable changes. When it stops, the Command Window displays the current values of all watched variables.
- Type
STEP IN and press
Enter. The next line of code executes, and the Command window displays the resulting values of all watched variables.
- Use
Continue and
Step commands a few more times to monitor changes in the values of the watched variables, then type
NWATCH /ALL and press
Enter to remove all watchpoints.
- Set a breakpoint on the last line of the program by entering
BREAKPOINT 176.
- Type
CONTINUE and press
Enter.
When the debugger reaches the
END statement, you can find the final values of any variables using the
Evaluate command. For example type
EVALUATE SYSIN_NUM_RECS and press
Enter to confirm that the program has processed five records. This command can be shortened to
Ev. For example:
EV EOF_SYSIN
- Type
CONTINUE and press
Enter to complete the program, close CodeWatch, and return to Eclipse.