DIRECTORY BasicTime, Commander, CommanderSys, EnvironmentVariables, IO, PreDebug, Process, Rope, SafeStorage, Termination; CommanderSysPImpl: CEDAR PROGRAM IMPORTS BasicTime, Commander, EnvironmentVariables, IO, PreDebug, Process, SafeStorage, Termination EXPORTS CommanderSys ~ BEGIN OPEN CommanderSys, Rope; ExtendedNow: PUBLIC PROC RETURNS [EGMT] = { now: BasicTime.ExtendedGMT = BasicTime.ExtendedNow[]; RETURN [[now.gmt, now.usecs]] }; GetEnv: PUBLIC PROC [key: ROPE] RETURNS [ROPE] = { RETURN [EnvironmentVariables.Get[key]] }; CurrentProcess: PUBLIC PROC RETURNS [PROCESS] = { RETURN [Process.GetCurrent[]]; }; AbortProcess: PUBLIC PROC [process: PROCESS] = TRUSTED { Process.Abort[process]; }; UNCAUGHTProtect: PUBLIC PROC [inner: PROC, rejectP: PROC [ROPE] RETURNS [BOOL]] RETURNS [ok: BOOL ¬ TRUE] = { RETURN [PreDebug.Protect[inner, rejectP]] }; ExitWorldCommand: Commander.CommandProc = { Termination.QuitWorld[userMsg: cmd.commandLine, interceptable: FALSE]; RETURN[NIL, NIL]; }; InterceptTerminationCommand: Commander.CommandProc = { Termination.SetDebuggingMode[]; RETURN[NIL, NIL]; }; GCollect: Commander.CommandProc = { SafeStorage.ReclaimCollectibleObjects[]; RETURN[NIL, NIL]; }; ShowCirioPortCommand: Commander.CommandProc = { GetPortNum: PROC RETURNS[CARD] = TRUSTED MACHINE CODE {"CirioNubLocalGetPort"}; IO.PutF1[cmd.out, "%g\N", [cardinal[GetPortNum[]]]]; }; Commander.Register[key: "ExitWorld", proc: ExitWorldCommand, doc: "Exit the PCR world", clientData: NIL]; Commander.Register[key: "ExitWorld!", proc: ExitWorldCommand, doc: "Same as ExitWorld, defeats command abbreviation danger", clientData: NIL]; Commander.Register[key: "InterceptTermination", proc: InterceptTerminationCommand, doc: "From now on interceptable termination will enter debugger instead of exiting the PCR world", clientData: NIL]; Commander.Register[key: "GCollect", proc: GCollect, doc: "force a garbage collect", clientData: NIL]; Commander.Register["ShowCirioPort", ShowCirioPortCommand, "shows current Cirio Port, so long as exactly one DebugNub has been loaded and it has been started"]; END. € CommanderSysPImpl.mesa Copyright Σ 1990, 1991, 1992, 1993 by Xerox Corporation. All rights reserved. Michael Plass, February 18, 1992 4:44 pm PST JKF, March 2, 1990 3:51:36 pm PST Christian Jacobi, March 25, 1993 2:49 pm PST To allow packaged worlds to quit pcr cleanly To allow interception of interceptable termination to help packaged world performance to help debugging ΚΒ•NewlineDelimiter –(cedarcode) style™codešœ™Kšœ ΟeœC™NK™,K™!K™,K™—KšΟk œ;žœ4˜zK˜KšΟnœžœž˜ Kšžœ]˜dKšžœ ˜šœžœžœ˜ K˜K˜š Ÿ œžœžœžœžœ˜+Kšœ5˜5Kšžœ˜Kšœ˜K˜—š Ÿœžœžœžœžœžœ˜2Kšžœ ˜&Kšœ˜K˜—š Ÿœžœžœžœžœ˜1Kšžœ˜Kšœ˜K˜—š Ÿ œžœžœ žœžœ˜8Kšœ˜Kšœ˜K˜—šŸœžœžœ žœ žœžœžœžœžœžœžœ˜mKšžœ#˜)Kšœ˜K˜—™,šŸœ˜+Kšœ?žœ˜FKšžœžœžœ˜K˜——™2šŸœ˜6Kšœ˜Kšžœžœžœ˜K˜——K™šœ"™"šŸœ˜#Kšœ(˜(Kšžœžœžœ˜K˜——K˜™šŸœ˜/š Ÿ œžœžœžœžœžœž˜5K˜—Kšžœ2˜4šœ˜K˜———Kšœdžœ˜iKšœ‰žœ˜ŽKšœΒžœ˜ΗKšœ`žœ˜eK˜Ÿ—K˜Kšžœ˜K˜—…—@ ‚