| OCR Text |
Show Routine Read_Next-Event, called by Check_Register_Allocation, reads the next event from the execution stream. Its implementation is shown in Figure 4.8. The routine runs the executor in the synchronous mode and retrieves one event from the execution stream. Since the filter reports every instruction, the executor is run in a single step mode one instruction at the time. The Error routine, called by Check_Register_Allocation, implements a primitive debugger. The debugger offers elementary debugging constructs and reversible execution. 4.5.2 Using Filters Monitoring includes analyzing the execution stream and examining the executor's state. This section concentrates on the monitoring of events in the execution stream. Simple Filter The use of a simple filter is demonstrated on the tracing of control flow explained in Section 3.2.4. Four constructs can change control flow of a process: procedure call, procedure return, conditional jump, and unconditional jump. The filter to detect these events in the execution stream is shown in Figure 4.9. Macro op returns the opcode of struct event *Read_Next_Event() { /* run the executor in the synchronous mode */ dsrunsyncO; /* get next event from the execution stream */ return(dsgetevent()); } 85 Figure 4.8. Read Next Event from the Execution Stream |