gm2-libs-coroutines/Debug#

DEFINITION MODULE Debug ;

(*
    Description: provides some simple debugging routines.
*)

EXPORT QUALIFIED Halt, DebugString, PushOutput ;

TYPE
WriteP (type)
   WriteP = PROCEDURE (CHAR) ;

(*
   Halt - writes a message in the format:
          Module:Line:Message

          It then terminates by calling HALT.
*)

Halt
PROCEDURE Halt (File    : ARRAY OF CHAR;
                LineNo  : CARDINAL;
                Function,
                Message : ARRAY OF CHAR) ;

(*
   DebugString - writes a string to the debugging device (Scn.Write).
                 It interprets \n as carriage return, linefeed.
*)

DebugString
PROCEDURE DebugString (a: ARRAY OF CHAR) ;

(*
   PushOutput - pushes the output procedure, p, which is used Debug.
*)

PushOutput
PROCEDURE PushOutput (p: WriteP) ;

(*
   PopOutput - pops the current output procedure from the stack.
*)

PopOutput
PROCEDURE PopOutput ;

END Debug.