Download Bound-T User Manual - Bound
Transcript
Stack Final height Pstack 1 The table shows that the final local height of the stack “Pstack”, on return from TempCon, is 1, which means that the TempCon subprogram pops one element more than it pushes. Perhaps this popped element is the return address. Input and output cells (show cells) The option show cells adds to the detailed output information about how each subprogram uses “storage cells” in its computation. Here a storage cell means any memory location or register in the target processor that can hold an arithmetic value and that BoundT models in its analysis. The set of storage cells and the names of storage cells are targetspecific. The information is output as three lists of cells: • Input cells. These are the cells that the subrogram reads (uses) before it writes a new value in the cell. Such cells may be input parameters or global variables on which the subprogram depends. • Basis cells. These are all the cells included in the Presburgerarithmetic model of the subprogram's computation. • Output cells. These are the cells that the subprogram can write new values to. However, only statically identified cells are listed; if the subprogram writes via dynamic pointers, it can modify any storage cell that the pointer can reference. There is a fourth list that shows the initial bounds (value ranges) that are known for some cells at the start of the subprogram. Such a bound can be derived from the calling context, from an assertion or from the calling protocol. All cells in the output are named from the point of view of the current subprogram. This means that the output may include cells that are private (local) to the subprogram, such as local variables in the subprogram's callframe in the stack. Here is an example of the detailed show cells output for the subprogram ReadTemp that is called from the root subprogram Calibrate: 2 . Calibrate@261=>ReadTemp Input cells: k Basis cells for arithmetic analysis: k r Initial cell bounds on entry: 9<=k<=11 SH=0 ZSH=0 Output cells: p r SH The list of input cells shows that ReadTemp uses the initial value of the cell k in some way that is important to the analysis (for example, as a loop bound). The list of basis cells shows that also the cell r is used in such a way, but the fact that r is not an input cell means that ReadTemp always assigns a value to r before using r, so the initial value of r is not relevant. The Presburger arithmetic model tracks the basis cells k and r. 70 Understanding BoundT Outputs BoundT Reference Manual