The variable or expression that you enter is evaluated in the context of the current PC in the thread listed in the
Threads box. For example, if you typed
my_var into the window shown here, the value for it that TotalView displays is the value of
my_var in process 1, thread 1 and its scope is defined by the current PC. This means, for example, if you have two variables named
my_var, TotalView will not change the context when the other
my_var is in scope.
When sending something to the Expression List Window, the cursor and your selection matter. If you click on a variable or select a row in the Variable Window, TotalView sends the variable to the
Expression List Window. If you instead select some text with the Source or Stack Frame Panes, TotalView sends only that text. What’s the difference? In the figure at the beginning of this topic, notice that there are three different
d1_array expressions.
The scope that TotalView uses when looking up a variable when execution stops is the scope that existed when the variable was entered. If you want the scope to float so that a variable can be evaluated in different scopes, right-click within the variable’s row and select the
Compilation Scope > Floating command. Selecting
Compilation Scope > Fixed tells TotalView that it should only evaluate the variable in its original scope. For more information, see: