<<>> <> <> <> <> <> DIRECTORY Commander USING[CommandProc, Register], CommanderOps USING[ArgumentVector, Parse], IO, LocalCirio USING[AddSearchDirectory, Connection, GetConnection, GetStackForSelf, ReleaseConnection], RMTWTestSubject USING[ExamineSubjectStack, Subject], Rope USING[ActionType, ROPE], StackCirio USING[GetBannerForDotOofCurrentFrame, ResetStack, Stack, WalkStack, WalkStackToCProcedure]; LocalCirioTest: CEDAR PROGRAM IMPORTS Commander, CommanderOps, IO, LocalCirio, StackCirio, RMTWTestSubject = BEGIN <<>> <> LocalCirioTestDriver: Commander.CommandProc = BEGIN reports: IO.STREAM ¬ cmd.out; args: CommanderOps.ArgumentVector ¬ CommanderOps.Parse[cmd]; connection: LocalCirio.Connection ¬ LocalCirio.GetConnection[["PopUpDriver2", "BreakPointPopUp"], reports]; CleanUp: PROC = BEGIN LocalCirio.ReleaseConnection[connection, reports]; END; <> <<(note: we need not lock a monitor, since only one thread has access to the connection data.)>> BEGIN ENABLE UNWIND => CleanUp[]; LocalCirioTestInner: PROC[key: CARD32] = BEGIN stack: StackCirio.Stack ¬ LocalCirio.GetStackForSelf[connection, reports]; index: CARD ¬ StackCirio.ResetStack[stack, reports]; IO.PutF1[reports, "Cirio Of %g\N", IO.rope[StackCirio.GetBannerForDotOofCurrentFrame[stack, reports]]]; FOR I: INT IN [1..args.argc) DO LocalCirio.AddSearchDirectory[connection, args[I], reports]; ENDLOOP; IF StackCirio.WalkStackToCProcedure[stack, "_LocalCirioTestInner_", "LocalCirioTest", cmd.out] THEN BEGIN actualMovement: INT; newFrameIndex: CARD; [actualMovement, newFrameIndex] ¬ StackCirio.WalkStack[stack, 1, cmd.out]; -- get into position RMTWTestSubject.ExamineSubjectStack[stack, TRUE, reports] END ELSE IO.PutRope[reports, "\N\NFAILED TO FIND EXPECTED TEST SUBJECT FRAME\N\N"]; <> ERROR CloseDownLocalTest[]; END; RMTWTestSubject.Subject[TRUE, LocalCirioTestInner ! CloseDownLocalTest => CONTINUE]; END; CleanUp[] END; CloseDownLocalTest: ERROR = CODE; <<>> <<>> <> LocalCirioTestSubjectDriver: Commander.CommandProc = {RMTWTestSubject.Subject[TRUE, LocalDebuggeeTestFrame]}; LocalDebuggeeTestFrame: PROC[key: CARD32] = BEGIN inner: PROC[key: CARD32] RETURNS[INT32] = {ThisIsUncaught[]; RETURN[-1]}; result: INT ¬ inner[key]; SELECT result FROM -1 => RETURN; ENDCASE => ERROR ABORTED; END; ThisIsUncaught: SIGNAL = CODE; RemoteCirioTestSubjectDriver: Commander.CommandProc = {RMTWTestSubject.Subject[TRUE, CirioDebuggeeTestFrame]}; <> CirioDebuggeeTestFrame: PROC[key: CARD32] = BEGIN inner: PROC[key: CARD32] RETURNS[INT32] = TRUSTED MACHINE CODE {"XR_CallDebugger"}; result: INT ¬ inner[key]; SELECT result FROM -1 => RETURN; ENDCASE => ERROR ABORTED; END; <> <> <> <> <> <> <> <> <> <> <> <<>> <> <> <> <> <> <> <> <<>> <> <<(note: we need not lock a monitor, since only one thread has access to the connection data.)>> <> < CleanUp[];>> <<>> <> <> <> <> <> <> <> <<>> <> <> <> <> <> <<>> <> <<>> <> <<{ExamineStack[stack, reports]; threadFound _ TRUE; EXIT};>> <> <> <> <> <<>> <> <> <> <> <<>> <<>> <
> Commander.Register["TestLocalCirio", LocalCirioTestDriver]; Commander.Register["RemoteCirioTestSubject", RemoteCirioTestSubjectDriver]; Commander.Register["LocalCirioTestSubject", LocalCirioTestSubjectDriver]; END..