Before you begin, you must complete Exercise 5.3: Setting breakpoints.
You can monitor variables in the Monitors view. Now you will monitor the variable &count.
To monitor a variable:
The Monitors view opens.
The variable appears in the Monitors view. Its current value is zero.
Tip: If you quickly want to see the value of a variable without adding it to the Monitor, leaving the mouse pointer on a variable for a second or so will display its value in a pop-up window.
Now that some breakpoints are set, you can start to run the
application.
The program starts running and stops at the breakpoint at line 8. (Be patient, the Debugger has to stop 98 times but because of the condition continues to run until the 99th time.) Notice in the Monitors view, that &count now has the value 99.
The program stops at the breakpoint at line 8 again and &count now has the value 100.
If you do not see the error message below, go to Exercise 5.5: Stepping into a program.
Error Handling
If you forget to add the parameter to the CALL program command when you
debug the program, you will see this error message.
The debug session terminates on the workstation but the exception waits for input from the 5250 emulation session.
If you closed the Debug view by mistake, you will need to re-open the Debug
view and then terminate the debug session on the workstation.
Click Window > Show View > Debug.
Remember to terminate the Debug view if you haven't done so
already.
The Debug Launch Configurations window opens.
The How To Start page opens.
By default, the page contains a call for the program selected in the Remote Systems view.
The Call Program (CALL) window opens.
The parameter value will appear in the lower list.
If you did not terminate the debug session, you will see this error
message.
Complete the steps shown earlier in the section called Error Handling to terminate the debug session then start the debug session again by clicking the arrow beside the Debug icon on the workbench toolbar and selecting CLR1 from the list. Breakpoints and monitors are restored.
You have monitored the variable &count and now you are ready to begin Exercise 5.5: Stepping into a program.
(C) Copyright IBM Corporation 1992, 2005. All Rights Reserved.