30.01.2013 Views

TotalView Users Guide - CI Wiki

TotalView Users Guide - CI Wiki

TotalView Users Guide - CI Wiki

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Displaying Variables<br />

Figure 170: Variable Window<br />

for a Global Variable<br />

Although a Variable Window is the best way to see all of an array’s elements<br />

or all elements in a structure, using the Expression List Window is easier for<br />

variables with one value. Using it also cuts down on the number of windows<br />

that are open at any one time. For more information, see “Viewing a List of<br />

Variables” on page 303.<br />

The following sections discuss how you can display variable information:<br />

� “Displaying Program Variables” on page 284<br />

� “Seeing Value Changes” on page 285<br />

� “Displaying Variables in the Current Block” on page 287<br />

� “Viewing Variables in Different Scopes as Program Executes” on page 288<br />

� “Scoping Issues” on page 289<br />

� “Browsing for Variables” on page 291<br />

� “Displaying Local Variables and Registers” on page 292<br />

� “Dereferencing Variables Automatically” on page 293<br />

� “Displaying Areas of Memory” on page 296<br />

� “Displaying Machine Instructions” on page 297<br />

� “Rebinding the Variable Window” on page 298<br />

� “Closing Variable Windows” on page 298<br />

Displaying Program Variables<br />

You can display local and global variables by:<br />

� Diving into the variable in the Source or Stack Panes.<br />

� Selecting the View > Lookup Variable command. When prompted, enter<br />

the name of the variable.<br />

CLI: dprint variable<br />

� Using the Tools > Program Browser command.<br />

After using one of these methods, <strong>TotalView</strong> displays a Variable Window<br />

that contains the information you want. The Variable Window can display<br />

simple variables, such as ints, sets of like elements such as arrays, or more<br />

complicated variables defined as structures and arrays of structures.<br />

If you keep a Variable Window open while a process or thread is running,<br />

the information being displayed might not be accurate. <strong>TotalView</strong> updates<br />

the window when the process or thread stops. If <strong>TotalView</strong> can’t find a<br />

stack frame for a displayed local variable, the variable’s status is sparse,<br />

284 Chapter 14: Examining and Changing Data

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!