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.

Changing a Variable’s Data Type<br />

Type String Language Size Description<br />

$wchar_u16 C 16 bits wide character whose storage is<br />

unsigned 16 bits<br />

$wchar_s32 C 32 bits wide character whose storage is<br />

signed 32 bits<br />

$wchar_u32 C 32 bits wide character whose storage is<br />

unsigned 32 bits<br />

$wstring C platform-specific Platform-specific string<br />

composed of $wchar characters<br />

$wstring_s16 C 16 bits String composed of $wchar_s16<br />

characters (not currently used<br />

by any platform)<br />

$wstring_u16 C 16 bits String composed of<br />

$wchar_u16 characters<br />

$wstring_s32 C 32 bits String composed of $wchar_s32<br />

characters<br />

$wstring_u32 C 32 bits String composed of<br />

$wchar_u32 characters<br />

Viewing Character Arrays ($string Data Type)<br />

If you declare a character array as char vbl[n], <strong>TotalView</strong> automatically<br />

changes the type to $string[n]; that is, a null-terminated, quoted string with<br />

a maximum length of n. This means that <strong>TotalView</strong> displays an array as a<br />

quoted string of n characters, terminated by a null character. Similarly,<br />

<strong>TotalView</strong> changes char* declarations to $string* (a pointer to a null-terminated<br />

string).<br />

Since most character arrays represent strings, the <strong>TotalView</strong> $string type<br />

can be very convenient. But if this isn’t what you want, you can edit the<br />

$string and change it back to a char (or char[n]), to display the variable as<br />

you declared it.<br />

Viewing Wide Character Arrays ($wchar Data Types)<br />

If you create an array of wchar_t wide characters, <strong>TotalView</strong> automatically<br />

changes the type to $wstring[n]; that is, it is displayed as a null-terminated,<br />

quoted string with a maximum length of n. For an array of wide characters,<br />

the null terminator is L’0’. Similarly, <strong>TotalView</strong> changes wchar_t* declarations<br />

to $wstring* (a pointer to a null-terminated string). (See Figure 202<br />

on page 319.)<br />

This figure shows the declaration of two wide characters in the Process<br />

Window. The Expression List Window shows how <strong>TotalView</strong> displays their<br />

data. The L in the data indicates that <strong>TotalView</strong> is displaying a wide literal.<br />

Since most wide character arrays represent strings, the $wstring type can<br />

be very convenient. But if this isn’t what you want, you can edit the<br />

$wstring and change it back to a wchar_t (or wchar[n] or $wchar or<br />

$wchar[n]), to display the variable as you declared it.<br />

318 Chapter 14: Examining and Changing Data

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

Saved successfully!

Ooh no, something went wrong!