Watching Memory
A watchpoint tracks a memory location: it does not track a variable. This means that a watchpoint may not perform as you would expect it to when watching stack or automatic variables. For example, assume that you create a watchpoint to watch a variable in a subroutine. When control exits from the subroutine, the memory allocated on the stack for this subroutine is deallocated. At this time, TotalView is watching unallocated stack memory. And, when the stack memory is reallocated to a new stack frame, TotalView is still watching this same position. This means that TotalView triggers the watchpoint when something changes this newly allocated memory.
Also, if your program reinvokes a subroutine, it usually executes at a different part of the stack. So, if the subroutine changes, this change may not be seen because the variable is at a different memory location.
All of this means that in most circumstances, you cannot place a watchpoint on a stack variable. If you need to watch a stack variable, you will need to create and delete the watchpoint each time your program invokes the subroutine.
Note: In some circumstances, a subroutine will always be called from the same location. This means that its local variables will probably be in the same location, so it may be worth trying.
If you place a watchpoint on a global or static variable that is always invoked by reference (that is, the value of a variable is always accessed using a pointer to the variable), you can set a watchpoint on it because the memory locations used by the variable are not changing.