Totalview® User Guide : PART II Debugging Tools and Tasks : Chapter 9 Examining and Editing Data and Program Elements
Chapter 9 Examining and Editing Data and Program Elements
This chapter explains how to examine and edit data and view the various elements of your program, with the following sections:
"Changing How Data is Displayed"
"Displaying Variables"
"Diving in Variable Windows"
"Viewing a List of Variables"
"Changing the Values of Variables"
"Changing a Variable’s Data Type"
"Changing the Address of Variables"
"Displaying C++ Types"
"C++View"
"Displaying Fortran TypesTotalView lets you display FORTRAN 77 and Fortran 90 data types."
"Displaying Thread Objects"
"Scoping and Symbol Names"
This chapter does not discuss array data. For that information, see Chapter 10, "Examining Arrays".
Changing How Data is Displayed
When a debugger displays a variable, it relies on the definitions of the data used by your compiler. The following two sections show how you can change the way TotalView displays this information:
"Displaying STL Variables"
"Changing Size and Precision"
Displaying STL Variables
The C++ STL (Standard Template Library) greatly simplifies access to data. Since it offers standard and prepackaged ways to organize data, you do not have to be concerned with the mechanics of the access method. The disadvantage to using the STL while debugging is that the information debuggers display is organized according to the compiler’s view of the data, rather than the STL’s logical view. For example, here is how your compiler sees a map compiled using the GNU C++ compiler (gcc):
Figure 107 – An Untransformed Map
Most of the information is generated by the STL template and, in most cases, is not interesting. In addition, the STL does not aggregate the information in a useful way.
STLView solves these problems by rearranging (that is, transforming) the data so that you can easily examine it. For example, here is the transformed map.
Figure 108 – A Transformed Map
Figure 109 shows an untransformed and transformed list and vector.
Figure 109 – List and Vector Transformations
NOTE >> By default, TotalView transforms STL strings, vectors, lists, maps, multimaps, sets, and multisets. You can create transformations for other STL containers. See "Creating Type Transformations" in the TotalView Reference Guide for more information.
By default, TotalView transforms STL types. If you need to look at the untransformed data structures, clear the View simplified STL containers (and user-defined transformations) checkbox on the Options Page of the File > Preference Dialog Box.
Following pointers in an STL data structure to retrieve values can be time-consuming. By default, TotalView only follows 500 pointers. You can change this by altering the value of the TV::ttf_ max_length variable.
 
RELATED TOPICS 
 
General information on creating custom type transformations
"Creating Type Transformations" in the TotalView Reference Guide
Transforming C++ types