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 />

Computer Constraints<br />

Linux x86, You can create up to four watchpoints and each must be 1, 2, or 4<br />

bytes in length, and a memory address must be aligned for the<br />

byte length. That is, you must align a 4-byte watchpoint on a 4byte<br />

address boundary, and you must align 2-byte watchpoint on<br />

a 2-byte boundary, and so on.<br />

Linux x86-64 (AMD<br />

and Intel)<br />

HP-UX IA-64 and<br />

Linux IA-64<br />

Typically, a debugging session doesn’t use many watchpoints. In most cases,<br />

you are only monitoring one memory location at a time. Consequently,<br />

restrictions on the number of values you can watch seldom cause problems.<br />

Creating Watchpoints<br />

You can create up to four watchpoints and each must be 1, 2, 4,<br />

or 8 bytes in length, and a memory address must be aligned for<br />

the byte length. For example, you must align a 4-byte watchpoint<br />

on a 4-byte address boundary.<br />

You can create up to four watchpoints. The length of the memory<br />

being watched must be a power of 2 and the address must be<br />

aligned to that power of 2; that is, (address % length) == 0.<br />

Solaris SPARC <strong>TotalView</strong> supports watchpoints on Solaris 7 or later operating<br />

systems. These operating system let you create hundreds of<br />

watchpoints, and there are no alignment or size constraints.<br />

However, watchpoints can’t overlap.<br />

Watchpoints are created by using either the Action Points> Create<br />

Watchpoint command in the Process Window or the Tools > Create<br />

Watchpoint Dialog Box. (If your platform doesn’t support watchpoints,<br />

<strong>TotalView</strong> dims this menu item.) Here are some things you should know:<br />

� You can also set watchpoints by right-clicking within the Process and<br />

Variable Windows and then select Create Watchpoint from the context<br />

menu.<br />

� You can select an expression within the Source and Stack Frame panes<br />

and then use a context menu or select the Action Points > Create<br />

Watchpoint command. If you invoke either of these commands and<br />

<strong>TotalView</strong> cannot determine where to set the expression, it displays a dialog<br />

box into which you type the variable’s name.<br />

� If you select the Tools > Create Watchpoint command and a compound<br />

variable such an array or structure is being displayed, <strong>TotalView</strong> sets the<br />

watchpoint on the first element. However, it you select an element before<br />

invoking this command, <strong>TotalView</strong> sets the watchpoint on that element.<br />

If you set a watchpoint on a stack variable, <strong>TotalView</strong> that lets you know<br />

that you’re trying to set a watchpoint on “non-global” memory. For example,<br />

the variable is on the stack or in a block and the variable will no longer<br />

exist when the stack is popped or control leaves the block. In either of<br />

these cases, it is likely that your program will overwrite the memory and the<br />

watchpoint will no longer be meaningful. See “Watching Memory” on<br />

page 377for more information.<br />

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

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

Saved successfully!

Ooh no, something went wrong!