FastBreak.mesa
Copyright © 1985 by Xerox Corporation. All rights reserved.
Russ Atkinson, February 11, 1985 11:29:00 pm PST
The FastBreak facility allows advanced clients to set breakpoints that must be processed quickly. The client may specify a routine to be called at the occurrence of a FastBreak. The FastBreak handler will take no page faults and perform no allocations, so if the user's routine takes no faults, breakpoints may be placed even on code that handles page faults.
DIRECTORY
PrincOps USING [BytePC, FrameHandle, SVPointer];
FastBreak: DEFINITIONS = BEGIN OPEN PrincOps;
Data types
FastBreakProc: TYPE = PROC [data: FastBreakData, frame: FrameHandle, sv: SVPointer] RETURNS [useOldBreak: BOOLFALSE];
The type of callback procedure supplied by the user. If useOldBreak, then we call the breakpoint handler in use at the time the first fast break was set.
FastBreakData: TYPE = LONG POINTER;
The type of data passed to/from the user's routines.
FastBreakId: TYPE = LONG POINTER TO INT;
Points at the event counter for the breakpoint.
Client level operations
FastBreaksLeft: PUBLIC PROC RETURNS [NAT];
FastBreaksLeft[] returns the number of fast break slots remaining in the table.
SetFastBreak: PROC [code: LONG POINTER, pc: BytePC, proc: FastBreakProc ← NIL, data: FastBreakData ← NIL] RETURNS [id: FastBreakId];
SetFastBreak[code, pc, proc, data] adds a fast break at the specified location. The pointer returned is used to distinguish which break to clear when clearing the break. If NIL is returned, then the breakpoint could not be set (due to the table being full). The use of proc = NIL is for fast event counters.
ClearFastBreak: PROC [id: FastBreakId, proc: FastBreakProc ← NIL, data: FastBreakData ← NIL] RETURNS [found: BOOL];
ClearFastBreak[id, proc, data] clears the specified fast break, provided that the parameters agree with an active fast break. TRUE is returned iff such a break was found.
ClearAllFastBreaks: PROC [releaseResources: BOOLTRUE] RETURNS [cleared: NAT];
ClearAllFastBreaks[] clears all fast breaks. It also releases system resources used by fast breaks if releaseResources = TRUE. It returns the number of fast breaks removed.
AMEvents level operations
FastBreakHandler: PROC;
This is the breakpoint handler to be called for fast breaks. It must be externally installed as the breakpoint handler (presumably by AMEvents initialization).
SpecifyDefaultBreakHandler: PROC [old: PROC];
SpecifyDefaultBreakHandler[old] specifies the old breakpoint handler to be used when a non-fast break is encountered. It should be called before FastBreakHandler is installed.
END.