Home

Examining Local Variables

While debugging, local variables in the current scope can be examined when the debugging panel is in Variables mode. The panel will display the values of all local variables currently visible in the current stack frame in the current thread. The local variables will update whenever the debugger reaches a breakpoint or as the user steps through the program; variables do not update live as the program runs if execution hasn’t been paused.

A sample of the Variables mode debugging panel is shown below:

When the user steps through the program or a breakpoint is reached, any variables that have changed are highlighted in yellow.

Expanding Arrays and Derived Types

Next to applicable variables in the debugging panel, a small “plus” sign will be visible if the variable can be expanded. If the variable is a derived type (Fortran) or a struct/union/class (C/C++), the individual components or members can be examined.

Likewise, with arrays, the individual members of the arrays can be examined by expanding the variable. Two caveats exist when examining arrays:

  • Multidimensional arrays are expanded according to the storage settings at compile time
  • Only the first 64 elements are shown when looking at an array

The multidimensional expansion hierarchy defaults on x86 and x64 architectures for GNU Fortran to last dimension first.

The first 64 elements are always loaded for any array for speed considerations. To obtain more results, the user can right-click on the selected variable or element and select “Load Additional Elements.” Another 64 elements will immediately be loaded and shown.

See Also

Debugging in Simply Fortran
Stack
Threads