|
|
||
|
Control Flow Mode |
![]() |
![]() |
![]() |
|
|
||||
|
Often, if you're interested in the calling hierarchy of your software, you may find all the information that you need in a standard call graph. However, there will times when it's important to understand the sequence and conditionality of the function calls and variable usage in your code. For this more detailed control flow analysis, Imagix 4D provides the Control Flow mode.
In Control Flow graph, the notations used for functions and variables are expanded. This enables the relevent portions of a function's internal program logic to be displayed; you might think of a function's notation as being an abstraction of the function's Flow Chart. The resulting graph is able to display where within a function's program logic function calls and variable sets and reads are made. For example, consider main. Below main's blue titlebar are four snippets from the source code. These are the lines of source code necessary to understand for understanding the order and conditionality of the calls to the functions strcpy, Program::Program and yyparse. Yellow text indicates that the source code snippet is part of a decision; white indicates that the text comes from a block of code. The horizontal position of the source code snippets is also significant. The white text representing the call to strcpy is indented, indicating that strcpy is only called when the initial if condition is met. By comparison, the call to Program::Program is not indented, lining up with the two if lines. This indicates that the call is unconditional, that it occurs whenever main is called. The call to yyparse represents a third case; yyparse is called as part of the if program control statement. For another example, look at the white source code snippet at the bottom of the yyparse symbol. This call to Identifier::Identifier is below and to the right of the case 33 text. This signifies that that particular call occurs if that case condition is meet. Through the Control Flow graph, you're able to quickly gain an understanding of the dependencies in the complex, sequence critical areas of your code. This understanding makes you more productive and less error-prone as you work with your code. |