DIRECTORY BasicTime, Commander, IO, Rope, StackSummary, RuntimeError, UXStrings ; StackSummaryNoViewers: CEDAR PROGRAM IMPORTS Commander, IO, StackSummary, Rope, RuntimeError, UXStrings = BEGIN originalUCS: RuntimeError.UCSProc ¬ NIL; RegisterQuickStack: Commander.CommandProc = BEGIN Inner: PROC[] = BEGIN IF originalUCS = NIL THEN originalUCS ¬ RuntimeError.RegisterUncaughtSignalHandler[UncaughtSignalPopUp]; END; Inner[]; END; DeRegisterQuickStack: Commander.CommandProc = BEGIN Inner: PROC[] = BEGIN IF originalUCS # NIL THEN BEGIN [] ¬ RuntimeError.RegisterUncaughtSignalHandler[originalUCS]; originalUCS ¬ NIL; END; END; Inner[]; END; UncaughtSignalPopUp: RuntimeError.UCSProc = BEGIN errorMessage: Rope.ROPE ¬ NIL; self: CARD32 ~ 0; printProc: StackSummary.PrintSummary ~ { rope: Rope.ROPE ¬ StackSummary.GetRopeForBasicPCInfo[basicPCInfo, frame.absPC]; PutMsg[IO.PutFR["%g: %g\N", IO.card[frame.frameIndex], IO.rope[rope]]]; }; { -- extra scope for EXITS IF signal = LOOPHOLE[RuntimeError.Aborted] THEN BlowAwayThread[] ELSE BEGIN BEGIN ENABLE { StackSummary.NoStack => { errorMessage ¬ message; GOTO fatal}; UNWIND => {NULL}}; StackSummary.Summary[self, printProc]; END; PutMsg[IO.PutFR["This is the end of the stack\N"]]; ERROR ABORTED; END; EXITS fatal => { IF Rope.Length[errorMessage] # 0 THEN originalUCS[0, NIL, NIL]; }; }; END; BlowAwayThread: PROC ~ TRUSTED MACHINE CODE { "XR_Exit" }; PutMsg: PROCEDURE [msg: Rope.ROPE] = { MsgInner: PROC [buf: UXStrings.UnixString] = TRUSTED MACHINE CODE { """ThreadsMsgPrivate.h"".XR_ConsoleMsg" }; buf: UXStrings.UnixString ¬ UXStrings.Create[msg]; MsgInner[buf: buf]; }; Commander.Register["RegisterQuickStack", RegisterQuickStack]; Commander.Register["DeRegisterQuickStack", DeRegisterQuickStack]; END..  StackSummaryNoViewers.mesa Copyright Σ 1991 by Xerox Corporation. All rights reserved. Linda Howe, February 9, 1990 4:53:41 pm PST PopUp will be called by Carl (and friends) when the debuggee wants to contact the debugger, i.e. when a breakpoint is reached. [msg: WORD, signal: SIGNAL ANY RETURNS ANY, frame: POINTER] (except that at January 9, 1990 11:19:53 am PST the implementation calls with frame = NIL) I belive the following test will eventually go away, when Carl arranges to turn ABORTED into a proper UNWIND. But for the moment, we have to blow the thread away when we are called for ABORTED. This logic is adapted from /pcedar2.0/Debugger/Debugger.mesa. open a block to so that unwind catches can close the connection ".XR_ConsoleMsg" Main code Κ‚•NewlineDelimiter –(cedarcode) style™šœ™Jšœ Οeœ1™