A Tour of the Sort Program: Static Analysis



next up previous
Next: Compiling and Executing Up: Program Analysis and Tuning Previous: The pC++ Program

A Tour of the Sort Program: Static Analysis

The pC++ implementation of the Sort program is easily derived from the class object defined above. A pC++ collection of Pvector objects is created. The member functions of the Pvector class are divided into two categories: those functions that describe operations that are purely local to the object, and those functions that involve global operations on the collection or interaction with other elements of the collection. The second category of functions are moved to the collection structure and are called MethodOfElement members. Our collection is derived from the library collection DistributedArray.

Currently, provides three tools to enable the user to quickly get an overview of a large pC++ program and to navigate through it: the global function and method browser fancy (File ANd Class displaY), the static callgraph display cagey (CAll Graph Extended displaY), and the class hierarchy display classy (CLASS hierarchY browser). The tools are integrated with the dynamic analysis utilities through the global features of , allowing the user to easily find execution information about language objects. For instance, to locate the corresponding dynamic results (after a measurement has been made), the user only has to click on the object of interest (e.g., a function name in the callgraph display).

Figure 4 illustrates the view of our SortedList collection. From this fancy panel view, we can select any member function (with a mouse click) and get a text display of that function (e.g., SortedList). In addition to examining the code, the user can examine many other static properties of the program. For example, the inheritance graph for the classes and collections in the pC++ application are illustrated in Figure 3. Another display is the static call graph of our program. It is automatically generated and displayed with the cagey tool as illustrated in Figure 5. This view of the program is completely adjustable: the use can select the detail and depth of the displayed information by unfolding and folding selected function calls.

  
Figure 3: Class Inheritance Hierarchy Graph Display

  
Figure 4: Class Browser and Code View Tool

  
Figure 5: Static Call Graph Window



next up previous
Next: Compiling and Executing Up: Program Analysis and Tuning Previous: The pC++ Program



Bernd W. Mohr
Thu Jan 5 14:01:02 PST 1995