<> <> <> <> <> <> DIRECTORY AMModel USING [Section], IO USING [STREAM], PrincOps USING [PsbNull, PsbIndex], Rope USING [ROPE]; SpyClient: DEFINITIONS = BEGIN OPEN Rope; StackType: TYPE = MACHINE DEPENDENT { ready (0), pageFault (1), waitingML (2), waitingCV (3), preempted (4), waitingSV (5), unknown (6), pageFaultData (7), pageFaultCode (8), pageFaultXfer (9), allocSafe (10), allocPerm (11), allocUnsafe (12), userBreak (13)}; DataType: TYPE = MACHINE DEPENDENT { CPU (0), process, breakProcess, pagefaults, allocations, wordsAllocated, userDefined}; <> InitializeSpy: PROC [dataType: DataType _ CPU, process: PrincOps.PsbIndex _ PrincOps.PsbNull, spyOnSpyLog: BOOL _ FALSE, frequencyDivisor: NAT _ 1] RETURNS [errorMsg: ROPE]; <> <> <> <> <<>> StandardSpy: PROC = INLINE {IF InitializeSpy[].errorMsg # NIL THEN ERROR}; StartSpy: PROC; <> StopSpy: PROC; <> DisplayData: PROC [cutoff: CARDINAL _ 3, herald: ROPE _ NIL, stream: IO.STREAM _ NIL, spyOnSpyLog: BOOL _ FALSE]; <<... displays data (automatically stops Spy); cutoff gives cutoff of printing (in percentage points); herald is the client supplied herald (follows Cedar Spy of xxx); a typescript is opened if stream = NIL>> <> SetStartBreak: PROC [section: AMModel.Section _ NIL, procedure: ROPE _ NIL, sourceIndex: INT _ 0] RETURNS [ok: BOOL, msg: ROPE]; <<... sets a breakpoint that will start Spying whenever the breakpoint is encountered. procedure is of form "ModuleIMPL.Proc" & is only used if section = NIL; if sourceIndex # 0, then treat `procedure' as a filename.>> SetStopBreak: PROC [section: AMModel.Section _ NIL, procedure: ROPE _ NIL, sourceIndex: INT _ 0] RETURNS [ok: BOOL, msg: ROPE]; <<... sets a breakpoint that will stop Spying whenever the breakpoint is encountered. procedure is of form "ModuleIMPL.Proc" & is only used if section = NIL (breakpoint is set at the RETURN); if sourceIndex # 0, then treat `procedure' as a filename.>> ClearBreaks: PROC; <> SetUserBreak: PROC [section: AMModel.Section _ NIL, type: StackType _ ready, procedure: ROPE _ NIL, sourceIndex: INT _ 0] RETURNS [ok: BOOL, msg: ROPE]; <> SetTrace: PROC [section: AMModel.Section _ NIL, procedure: ROPE _ NIL, sourceIndex: INT _ 0] RETURNS [ok: BOOL, msg: ROPE]; <> <<>> ClearUserBreaks: PROC; <> END. .