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.

The following is an expression that uses these values:<br />

Using Watchpoints<br />

if (iValue != 42 && iValue != 44) {<br />

iNewValue = $newval; iOldValue = $oldval; $stop;}<br />

When the value of the iValue global variable is neither 42 nor 44, <strong>TotalView</strong><br />

stores the new and old memory values in the iNewValue and iOldValue variables.<br />

These variables are defined in the program. (Storing the old and new<br />

values is a convenient way of letting you monitor the changes made by your<br />

program.)<br />

The following condition triggers a watchpoint when a memory location’s<br />

value becomes negative:<br />

if ($oldval >= 0 && $newval < 0) $stop<br />

And, here is a condition that triggers a watchpoint when the sign of the<br />

value in the memory location changes:<br />

if ($newval * $oldval

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

Saved successfully!

Ooh no, something went wrong!