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.

Displaying Variables<br />

Figure 174: Displaying<br />

Scoped Variables<br />

Viewing Variables in Different Scopes as Program<br />

Executes<br />

When <strong>TotalView</strong> displays a Variable Window, it understands the scope in<br />

which the variable exists. As your program executes, this scope doesn’t<br />

change. In other words, if you’re looking at variable my_var in one routine,<br />

and you then execute your program until it is within a second subroutine<br />

that also has a my_var variable, <strong>TotalView</strong> does not change the scope so<br />

that you are seeing the in scope variable.<br />

If you would like <strong>TotalView</strong> to update a variable’s scope as your program<br />

executes, select the View > Compilation Scope > Floating command. This<br />

tells <strong>TotalView</strong> that, when execution stops, it should look for the variable in<br />

the current scope. If it finds the variable, it displays the variable contained<br />

within the current scope.<br />

Select the View > Compilation Scope > Fixed command to return <strong>TotalView</strong><br />

to its default behavior, which is not to change the scope.<br />

Selecting floating scope can be very handy when you are debugging recursive<br />

routines or have routines with identical names. For example, i, j, and k<br />

are popular names for counter variables.<br />

288 Chapter 14: Examining and Changing Data

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

Saved successfully!

Ooh no, something went wrong!