| OCR Text |
Show director was written, that dynamically constructs the control flow graph of the executor. The top part of Figure 3.4 displays the graph showing control flow. The screen is updated dynamically during the execution. At the beginning, the director reads the symbol table describing symbols in the executor's process. This provides function names and their corresponding addresses. Each procedure has a separate line of squares. A square represents a sequential block of statements in the code. Normally, the execution proceeds sequentially through blocks. Arcs denote conditional or unconditional jumps. Arcs above the squares are forward jumps, arcs below the squares are backward jumps. A marker, shown as a cross, is the current position of the program counter. Each procedure has its own marker, so that a place of a function call can be seen. The position of each marker is dynamically updated to reflect the executor's progress. The director recognizes four types of events: a function call, a function return, a conditional jump and an unconditional jump. These events are taken from the execution stream. When a function call is detected, a new line of squares is initialized for the new procedure. When a function return is detected, the bottom line of squares is deleted. When an jump is detected, the source and the destination addresses are added to the graph as well as the corresponding arc. The control flow graph is dynamically constructed. Therefore, it is possible to apply the director in the middle of execution. Figure 3.4 represents the control flow of the executor for managing a linear list. Currently active is function delete shown in Figure 3.5. Numbers on arcs show the line number of the corresponding statement in the source code. Numbers 4, 5, 11 and 14 correspond to if statements. Two copies of number 10 corresponds to the while statement. Number 10 on the top arc shows that the control was first transferred to the end of the while statement. This is a common technique in implementing while loops. Number 10 on the bottom arc is a jump back to 43 |