Scope plug-in
This plug-in computes information about dependencies of a user-specified l-value D at a user-specified program point L. It provides the following three features, which are presented in greater details below.
- ShowDefs
- gives information about the statements that may contribute to the value of D at L;
- DataScope
- shows the statements where D is guaranteed to have the same value than at L;
- Zones
- shows which data is needed in the previous statements to compute D at L.
Show Defs
ShowDefs selects
the statements that contribute to define the value of D at L,
and print a message if a part of D might be undefined.
Notice that 'undefined' only means here
that it has not been defined on some path from
the beginning of the function.
DataScope
DataScope selects
sets of statements around a user-specified program point L
where a user-specified l-value D is guaranteed to have
the same value than at L.
- backward selected statements are colored in green :
if a statement
sbelongs to this selection, then for all executions of the function, the value of D is not modified between the execution of s and the next timeLis reached. - forward selected statements are colored in blue :
if a statement
sbelongs to this selection, then for all executions of the function, the value of D is not modified between the last timeLis reached and the time s is reached. - statements that are in both selections are colored in purple.
- the starting statement is underlined and is always part of the forward set.
Zones
Zones computes,
for each point Li of the function,
the data Di needed to know the value of D at L.
After this computation,
the result Di will be printed in the information window
each time a statement Li is selected.
Of course, the only interesting program points Li
are the one that are reached before L...
The statements that contribute to the computation are highlighted so that you should get the same result Di for successive statements that are not highlighted.
How to use them
Those features are available through the graphical user interface
once the value analysis has been done.
They can be called from the menu Dependencies
in the pop-up menu that appears when clicking the right button on a statement :
- The program point L is the one before the selected statement;
- the l-value D for which computations are done is either the one that is currently selected if any, or an l-value entered by the user in a pop-up window.
Results are presented by coloring the statements in the graphical interface as explained above. In addition, when something has been selected through these dependency features, a message in the information window serves as a reminder of where it comes from.
Note that all the variables that appear in the user-provided l-value
are taken into account, so that selecting
T[0] and T[i]
might lead to different results, even if the analysis is performed
at a point where i=0.
Dependencies on other plug-in
Note that the Scope plug-in only takes into account the executions that have been considered by the value analysis. In particular, the alarms emitted by the value analysis may correspond to executions that the value analysis ceased to consider. The alarms emitted by the value analysis should therefore be examined carefully by the user.