NextGen TotalView for HPC User Guide : PART II Debugging Tools and Tasks : Chapter 6 Examining and Editing Data : The Data View : Displaying Arrays
Displaying Arrays
The declaration of an array can include a lower and upper bound separated by a colon (:).
For C or C++, the default lower bound is 0; for Fortran, it is 1. Further, C and C++ use brackets to define an array, while Fortran uses parentheses. In the following example, an array of ten integers is declared in C and then in Fortran:
int a[10];
integer a(10)
The elements of the array range from a[0] to a[9] in C, while the elements of the equivalent Fortran array range from a(1) to a(10).
When an array’s lower bound is the default, the UI displays only the extent (that is, the number of elements in the dimension). Consider the following Fortran array declaration:
integer a(1:7,1:8)
Since both dimensions of this array use Fortran’s default 1 lower bound, NextGen TotalView for HPC displays the data type using only the extent of each dimension, as follows:
integer(7,8)
If an array declaration doesn’t use the default lower bound, NextGen TotalView for HPC displays both the lower and upper bound for each dimension. For example, this Fortran array is displayed in NextGen TotalView for HPC the same way it is declared:
integer a(-1:5,2:10)
RELATED TOPICS 
 
Cast a variable to an array
Controlling STL Data Transformation
When a debugger displays a variable, it usually relies on the definitions of the data used by your compiler. NextGen TotalView for HPC’s Data View, however, automatically transforms your data in an aggregated list or array view that makes it easier to examine.
This is particularly important for C++ STL (Standard Template Library) types that use abstractions such as structures, classes, and data types, including lists, maps, and vectors.
By default, NextGen TotalView for HPC transforms STL types, including strings, vectors, lists, maps, multimaps, sets, and multisets. This behavior is part of the NextGen TotalView for HPC Type Transformation Facility (TTF) that provides tools for customizing how you view data.
Viewing untransformed data
If you do need to look at the untransformed data structures, use the CLI’s dset command to set the TV::ttf variable to false:
For example, here is how your compiler sees a vector compiled using the GNU C++ compiler (g++):
Figure 71 – An Untransformed Vector
Most of the information is generated by the STL template and, in most cases, provides little value for analysis. In addition, the STL does not aggregate the information in a useful way.
NextGen TotalView for HPC solves this problem by transforming the data so that you can easily examine it. For example, here is the transformed vector, using TotalView’ default TTF settings:
Figure 72 – A Transformed Vector
You can also create transformations for other STL containers.
RELATED TOPICS 
 
General information on creating custom type transformations
Transforming C++ types
“Transforming C++ Types” in the TotalView for HPC User Guide, available on the Rogue Wave web site.