TotalView provides multiple ways to see and edit your data, The primary window for working with data is the Variable Window. If your variable is an array, you can use the Array Viewer.
The Variable Window displays details about your variables. To launch the Variable Window,
Figure 4, just dive (by double-clicking) on a local variable (displayed in the Process Window’s Stack Frame Pane), or on a global variable (in the Source Pane).
The Variable Window is a powerful tool for analyzing your program’s data. You can control the display and cast your data in the Expression field, change the variable’s address in the Address field, or change the data type in the Type field. For parallel programs, you can view or update the value of a variable in all of the processes or threads at once or individually. For variables that contain substructures, use the “
+” or “
–” icons to view them.
If the displayed variable is a pointer, structure, or array, you can dive on the value. This new dive, called a nested dive, replaces the information in the Variable Window with information about the selected variable.
Figure 5 shows a Variable Window before and after diving into a pointer variable
sp with a type of
simple*. The
base window displays the value of
sp while the nested dive window shows the structure referenced by the
simple* pointer.
For an array, the Variable Window includes a Slice field that shows each of the array’s dimensions as a colon. You can display a section by editing the array specifier. Using the
Slice field lets you focus on a subset of the data. For example, to display items 101 through 125 of a one-dimensional Fortran array, change the
Slice field to
(101:125).
You can also enter an expression in the Filter field to limit the display. For example, if you’re looking for values greater than 300, type “
> 300”.
In Figure 6, the top window uses a slice to limit the amount of information displayed in a three-dimensional array, while the bottom window combines a filter with a slice.
TotalView provides another way to look at the data in a multi-dimensional array. The Variable Window’s
Tools > Array Viewer command opens a window that presents a slice of array data in a table format,
Figure 7.
When the Array Viewer opens, the initial slice of displayed data depends on the values entered into the Variable Window. You can change the displayed data by modifying the Expression, Type, or Slice controls. For example, you can cast the array to another array expression, modify the type to cast the array to a different array type, or control how the slice is viewed.