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.

Using Watchpoints<br />

location. This can occur when your watchpoints are monitoring adjacent<br />

memory locations and a single store instruction modifies these locations.<br />

For example, suppose that you have two 1-byte watchpoints, one on location<br />

0x10000 and the other on location 0x10001. Also suppose that your<br />

program uses a single instruction to store a 2-byte value at locations<br />

0x10000 and 0x10001. If the 2-byte storage operation modifies both bytes,<br />

the watchpoint for location 0x10000 triggers. The watchpoint for location<br />

0x10001 does not trigger.<br />

Here’s a second example. Suppose that you have a 4-byte integer that uses<br />

storage locations 0x10000 through 0x10003, and you set a watchpoint on<br />

this integer. If a process modifies location 0x10002, <strong>TotalView</strong> triggers the<br />

watchpoint. Now suppose that you’re watching two adjacent 4-byte integers<br />

that are stored in locations 0x10000 through 0x10007. If a process<br />

writes to locations 0x10003 and 0x10004 (that is, one byte in each),<br />

<strong>TotalView</strong> triggers the watchpoint associated with location 0x10003. The<br />

watchpoint associated with location 0x10004 does not trigger.<br />

Copying Previous Data Values<br />

<strong>TotalView</strong> keeps an internal copy of data in the watched memory locations<br />

for each process that shares the watchpoint. If you create watchpoints that<br />

cover a large area of memory or if your program has a large number or processes,<br />

you increase <strong>TotalView</strong>’s virtual memory requirements. Furthermore,<br />

<strong>TotalView</strong> refetches data for each memory location whenever it continues<br />

the process or thread. This can affect performance.<br />

Using Conditional Watchpoints<br />

If you associate an expression with a watchpoint (by selecting the<br />

Conditional button in the Watchpoint Properties dialog box entering an<br />

expression), <strong>TotalView</strong> evaluates the expression after the watchpoint triggers.<br />

The programming statements that you can use are identical to those<br />

used when you create an eval point, except that you can’t call functions<br />

from a watchpoint expression.<br />

The variables used in watchpoint expressions must be global. This is<br />

because the watchpoint can be triggered from any procedure or scope in<br />

your program.<br />

Fortran does not have global variables. Consequently, you can’t directly refer to your<br />

program’s variables.<br />

<strong>TotalView</strong> has two variables that are used exclusively with conditional<br />

watchpoint expressions:<br />

$oldval The value of the memory locations before a change is<br />

made.<br />

$newval The value of the memory locations after a change is<br />

made.<br />

378 Chapter 16: Setting Action Points

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

Saved successfully!

Ooh no, something went wrong!