The Monitors view shows variables and expressions that
you have selected to monitor. You can enter the variables or expressions
in a dialog box or select them from the Debugger Editor. Use the Monitors
view to monitor global variables or variables you want to see at all
times during your debugging session. From the Monitors view, you can
also modify the content of variables or change the representation
of values.
Procedure
- To add a new Program Monitor for an expression from the
Monitors view:
- In the Debug view, select the thread that contains the
expression that you want to monitor.
- Click the Monitors view Monitor Expression button
(
).
- In the Monitor Expression dialog box, enter the expression
in the field.
- Click OK.
- To add a new Program Monitor for an expression from the
editor:
- In the editor, highlight and right-click the expression
that you want to monitor.
- Select Monitor Expression from
the pop-up menu.
- To add a new Program Monitor for a variable from the Variables
view:
- In the Variables view, right-click the variable that
you want to monitor.
- Select Monitor Local Variable from
the pop-up menu.
- To automatically add the variables on each line to the
Monitor view as you step through each line, do the following steps:
- Stop your program at the first line you want to start
monitoring.
- In the Debug Console view, enter the SET AUTOMONITOR
ON command.
- To add multiple monitors from the Variables view, select
multiple variables using the keyboard Ctrl or Shift keys, and then
follow the above steps.
- To change the contents of a variable or expression in the
Monitors view:
- Select the expression whose value you want to modify.
- If the expression is a struct or array, expand it to
show its individual elements.
- Scroll down to the expression you want to change and
do one of the following:
- Double-click the expression.
- Right-click the expression and choose Change value from
the pop-up menu.
Note: If you double-click on a variable and its value field cannot
be edited, the variable is a type that cannot be modified.
- Enter a new value for the expression and press Enter. To indicate that the expression value has changed, its
indicator will have a delta symbol next to it. All expressions affected
by the change will also have a delta symbol next to their indicators.
- If you are monitoring a variable in an optimized COBOL
program, you might see the following error message whenever you run
a statement that changes the value of that variable: Error
occurred: EQA2421E The assignment was not performed because the assigned
value might not be used by the program, due to optimization. The
debugger does not run the statement. To run that statement, do the
following steps:
- Add the variable to the Monitors view using any method
described earlier. The debugger displays the variable's name and current
value in the Monitor view.
- Step through your program until you reach a statement
that alters the value of that variable.
- Enter the SET WARNING OFF command
in the Debug Console view. The Debug Console view displays a message
that the SET WARNING OFF command was received.
- Step through the statement. The new value of the variable
you are monitoring is displayed in the Monitors window.