<> <> <<>> DIRECTORY AMTypes USING [nullType], IO USING [STREAM], PrincOps USING [GFTIndex, BytePC, PsbHandle]; SpyLog: DEFINITIONS = BEGIN <> <<************************************************************>> <<-- control>> <<************************************************************>> <<>> active: READONLY BOOLEAN; -- true iff the spy is open for writing. OpenForRead: PROC; <> <<>> OpenForWrite: PROC[spyOnSpyLog: BOOLEAN _ FALSE]; <> <<>> Close: PROC; <> <<>> Print: PROC[stream: IO.STREAM _ NIL]; <<************************************************************>> <<-- reading and writing>> <<************************************************************>> <<>> Entry: TYPE = MACHINE DEPENDENT RECORD[ SELECT type:{endOfLog, nullEntry, trace, data} FROM endOfLog => [fill: [0..16000)_0], -- marks the end of valid data nullEntry => [size: [0..16000)_0], -- indicates data to be skipped (used internally). trace => [ -- 5 words fill: [0..16)_0, gfi: PrincOps.GFTIndex, pc: PrincOps.BytePC, process: PrincOps.PsbHandle, timestamp: LONG CARDINAL], data => [ -- 4 words + size size: [0..16000), rttype: CARDINAL, timestamp: LONG CARDINAL, data: ARRAY [0..0) OF WORD], ENDCASE]; NextEntry: PROC RETURNS[LONG POINTER TO Entry]; <> WriteData: PROC [data: LONG POINTER, size: [0..8000], type: CARDINAL _ AMTypes.nullType]; <> WriteTrace: PROC [gfi: PrincOps.GFTIndex _ 0, pc: PrincOps.BytePC _ [0]]; <> Here: PROC = INLINE {IF active THEN WriteTrace[]}; <> Error: ERROR; END.