Imagix 4D User Guide

Control Flow Views

Typically, if you're interested in the calling hierarchy of your software, you'll find all the information that you need in one of the Function Calls views from the Structure views. You see all the calls between the functions you're examining. And if you're also interested in variable usage, the Function Calls with Variables shows which functions are setting and reading the variables you're studying.

However, there may be times when you want to understand the sequence and conditionality of the function calls and variable usage in your code. Visualization of this more detailed control flow analysis is available through the Control Flow Graphs.

In the Control Flow views, the displays are limited to functions and variables. The simple Structure view shapes for functions (rectangles / squares) and variables (tetrahedrons / triangles) are replaced by larger, more complex representations. These show where, in each visible non-library function, the other visible functions are called, and where the visible variables are read and set.

The layout used in the Control Flow Graph is equivilent to the 2D Graph, with a normal / roots horizontal layout. The flow is always from left to right. The left-most column contains the roots among the symbols visible in the diagram, the next column has the roots of the remaining symbols, etc.

Within a column, the symbols are ordered top to bottom according to the order they are used among symbols in that column. Thus, the sequence of the control flow is generally from the upper left to the lower-right of the diagram. However, this is an over simplification, because a symbol might be called multiple times and/or its use might be conditional.

To communicate this, the Control Flow Graph shows each separate use of a symbol, and the conditions that lead to that use. To support this, the function representations show the lines of source code where symbol usage (in black) occurs and the relevent decisions (in blue) that control whether a function call or variable set /read is actually reached. Each level of decision is indented, so you can quickly see any decisions leading up to the usage.

As you modify the diagram and the set of functions and variables displayed, the internal contents displayed for each visible non-library function automatically changes. You're able to quickly, accurately examine the flow of control among the specific functions and variables you choose to view.