30.01.2013 Views

TotalView Users Guide - CI Wiki

TotalView Users Guide - CI Wiki

TotalView Users Guide - CI Wiki

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

c<br />

h<br />

a<br />

p<br />

t<br />

e<br />

r<br />

Evaluating<br />

Expressions<br />

17<br />

Whether you realize it or not, you’ve been telling <strong>TotalView</strong> to evaluate<br />

expressions and you’ve even been entering them. In every programming<br />

language, variables are actually expressions—actually<br />

they are lvalues—whose evaluation ends with the interpretation of<br />

memory locations into a displayable value. Structure, pointer and<br />

array variables, particularly arrays where the index is also a variable,<br />

are slightly more complicated.<br />

While debugging, you also need to evaluate expressions that contain<br />

function calls and programming language elements such as for and<br />

while loops.<br />

This chapter discusses what you can do evaluating expressions<br />

within <strong>TotalView</strong>. The topics discussed are:<br />

� “Why is There an Expression System?” on page 381<br />

� “Using Programming Language Elements” on page 385<br />

� “Using the Evaluate Window” on page 389<br />

� “Using Built-in Variables and Statements” on page 394<br />

Why is There an Expression System?<br />

Either directly or indirectly, accessing and manipulating data requires an<br />

evaluation system. When your program (and <strong>TotalView</strong>, of course) accesses<br />

data, it must determine where this data resides. The simplest data lookups<br />

involves two operations: looking up an address in your program’s symbol<br />

table and interpreting the information located at this address based on a<br />

variable’s datatype. For simple variables such as an integer or a floating<br />

point number, this is all pretty straightforward.<br />

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

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

Saved successfully!

Ooh no, something went wrong!