Inspecting variables in the Variables view

You can inspect variables in the Variables view if you are debugging C or C++ or if you are debugging ILE COBOL or ILE RPG at a V5R3 or higher level. The Variables view always shows the variables of the currently selected call stack entry.

About this task

When a thread suspends, the top call stack entry of the thread is automatically selected. When a call stack entry is selected, the visible variables in that call stack entry are displayed in the Variables view. Complex variables can be expanded to show the elements that make up the variable.

You can turn filters on for either predefined or user-defined variables for ILE COBOL or ILE RPG programs. This is useful if you have performance problems when debugging ILE COBOL or ILE RPG, because there are so many variables displayed in the Variables view.

To set filters for local variables:

Procedure

  1. Right-click on any variable shown in the view.
  2. Select Filter locals > User-defined variables or Predefined variables.
    • Select User-defined variables if you want the view to show only those variables you have defined in your program.
    • Select Predefined variables if you want the view to show only those variables designated as reserved expressions by the language you are debugging.
    A check mark appears next to the selection. By default, both options are selected. If you clear both options, no filtering takes place and both predefined and User-defined variables are displayed.

What to do next

The Variables view displays all variables for a selected call stack entry. To view and inspect one or multiple variables during the whole debug session, use the Monitors view. You can also add variables from the Variables view to the Monitor view. Right-click on a variable in the Variables view, then select Monitor local variable.

Feedback