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.

Figure 200: Three Casts<br />

Changing a Variable’s Data Type<br />

the data type was changed from int to $char. In the first cast, <strong>TotalView</strong><br />

changed the Type for you. In the second, it did not alter the Expression field.<br />

The Expression List Window contains two casting examples. The first casts a<br />

function’s returned value to long long. The second is the same cast as was<br />

made in the two Variable Windows.<br />

<strong>TotalView</strong> also lets you cast a variable into an array. In the GUI, add an array<br />

specifier to the Type declaration. For example, adding [3] to a variable<br />

declared as an int changes it into an array of three ints.<br />

When <strong>TotalView</strong> displays some complex arrays and structures, it displays<br />

the compound object or array types in the Variable Window.<br />

Editing a compound object or array data type can produce undesirable results.<br />

<strong>TotalView</strong> tries to give you what you ask for, so if you get it wrong, the results are unpredictable.<br />

Fortunately, the remedy is quite simple: close the Variable Window and start<br />

over again.<br />

The following sections discuss the following more complex data types.<br />

� “Viewing Pointers to Arrays” on page 314<br />

� “Viewing Arrays” on page 314<br />

� “Viewing typedef Types” on page 315<br />

� “Viewing Structures” on page 315<br />

� “Viewing Unions” on page 315<br />

<strong>TotalView</strong> <strong>Users</strong> <strong>Guide</strong>: version 8.7 313

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

Saved successfully!

Ooh no, something went wrong!