DIRECTORY AMModel USING [Section], IO USING [STREAM], PrincOps USING [PsbNull, PsbIndex], Rope USING [ROPE]; SpyClient: DEFINITIONS = BEGIN OPEN Rope; StackType: TYPE = CARDINAL [0..7); DataType: TYPE = {CPU, process, breakProcess, pagefaults, allocations, wordsAllocated, userDefined}; -- common procedures -- InitializeSpy: PROC[ dataType: DataType _ CPU, process: PrincOps.PsbIndex _ PrincOps.PsbNull, -- only used if dataType = process spyOnSpyLog: BOOL _ FALSE] -- used by DisplayData RETURNS[errorMsg: ROPE]; -- errorMsg = NIL indicates success StandardSpy: PROC = INLINE {IF InitializeSpy[].errorMsg # NIL THEN ERROR}; StartSpy: PROC; -- the spy records data whenever # starts exceeds # stops StopSpy: PROC; -- you must StartSpy to enable breaks DisplayData: PROC[ -- automatically stops Spy cutoff: CARDINAL _ 3, -- cutoff of printing (in percentage points) herald: ROPE _ NIL, -- client supplied herald (follows Cedar Spy of xxx) stream: IO.STREAM _ NIL, -- a typescript is opened if stream = NIL spyOnSpyLog: BOOL _ FALSE]; -- break procedures -- SetStartBreak: PROC[-- spy will be started whenever this break is encountered section: AMModel.Section _ NIL, procedure: ROPE _ NIL, -- of form "ModuleIMPL.Proc"; only used if section = NIL sourceIndex: INT _ 0] -- if sourceIndex # 0, then treat `procedure' as a filename. RETURNS[ok: BOOLEAN, msg: ROPE]; SetStopBreak: PROC[ -- spy will be stopped whenever this break is encountered section: AMModel.Section _ NIL, procedure: ROPE _ NIL,-- sets a break at the EXIT of the procedure sourceIndex: INT _ 0] -- if sourceIndex # 0, then treat `procedure' as a filename. RETURNS[ok: BOOLEAN, msg: ROPE]; ClearBreaks: PROC; -- clears stop and start breaks SetUserBreak: PROC[ -- log a count whenever this break is encountered section: AMModel.Section _ NIL, type: StackType _ 0, -- allows the user to distinguish breaks procedure: ROPE _ NIL, -- of form "ModuleImpl.Proc"; only used if section = NIL sourceIndex: INT _ 0] -- if sourceIndex # 0, then treat `procedure' as a filename. RETURNS[ok: BOOLEAN, msg: ROPE]; SetTrace: PROC[ -- write a trace on the spy log whenever this break is encountered section: AMModel.Section _ NIL, procedure: ROPE _ NIL, -- of form "ModuleImpl.Proc"; only used if section = NIL sourceIndex: INT _ 0] -- if sourceIndex # 0, then treat `procedure' as a filename. RETURNS[ok: BOOLEAN, msg: ROPE]; ClearUserBreaks: PROC; -- clears the traces, too. END. . „SpyClient.mesa edited by: Maxwell November 29, 1983 11:27 am see SpyDoc.tioga for instructions on how to use this interface ʘJšœ™Jšœ.™.Jšœ>™>J˜šÏk ˜ Jšœœ ˜Jšœœœ˜Jšœ œ˜#Jšœœœ˜J˜—šœ œ˜J˜—Jšœ˜ J˜Jšœ œœ˜"Jšœ œœO˜dJ˜JšÏc˜J˜šÏn œœ˜Jšœœ˜Jšœ.ž#˜QJšœ œœž˜1Jšœ œž#˜<—JšŸ œœœœœœœ˜JJ˜JšŸœœž;˜KJšŸœœž&˜5J˜šŸ œœž˜-Jšœœž,˜BJšœœœž4˜HJšœœœž)˜BJšœ œœž˜—J˜Jšž˜J˜šŸ œœž9˜MJšœœ˜ Jšœ œœž8˜OJšœ œ ž9˜RJšœœœ˜!—šŸ œœž9˜MJšœœž˜!Jšœ œœž,˜BJšœ œž<˜RJšœœœ˜ —JšŸ œœž˜2J˜šŸ œœž1˜EJšœœ˜ Jšœž(˜=Jš œ œœž(ÐciÏi ˜OJšœ œž<˜RJšœœœ˜ —šŸœœžB˜RJšœœ˜Jšœ œž' ¡ ˜OJšœ œž<˜SJšœœœ˜ —JšŸœœž˜1J˜šœ˜J˜——…— œ 4