DIRECTORY FakeCirio, TargetArchitecture, BreakWorldArchitecture, PCRMonitorDefs; FakeRemoteCirioImpl: CEDAR PROGRAM IMPORTS FakeCirio, BreakWorldArchitecture EXPORTS FakeCirio ~ { MonitoredCall: PUBLIC BreakWorldArchitecture.MonitoredCallProc ~ { IF address.IsNullAddress[] THEN { ERROR FakeCirio.Cant[message: "MonitoredCall[nullAddress]"]; }; IF proc = NIL THEN { ERROR FakeCirio.Cant[message: "MonitoredCall[nullProc]"]; }; { HolderOffset: PROCEDURE [] RETURNS [TargetArchitecture.Displacement] ~ TRUSTED { sampleMonitorLock: PCRMonitorDefs.MonitorLock; sampleAddress: LONG POINTER TO PCRMonitorDefs.MonitorLock ~ @sampleMonitorLock; sampleAddressCard: CARD32 ~ LOOPHOLE[sampleAddress]; holderAddress: LONG POINTER TO TargetArchitecture.Contents ~ @sampleMonitorLock.holder; holderAddressCard: CARD32 ~ LOOPHOLE[holderAddress]; offset: TargetArchitecture.Displacement ~ (holderAddressCard - sampleAddressCard) * BYTES[UNIT]; RETURN [offset]; }; holder: TargetArchitecture.Contents ~ BreakWorldArchitecture.PeekContents[ address: address, displacement: HolderOffset[]]; IF holder = PCRMonitorDefs.nullHolder THEN { proc[]; } ELSE { ERROR BreakWorldArchitecture.WouldBlock["Monitor lock already held"]; }; }; }; }. 4 FakeRemoteCirioImpl.mesa Copyright Σ 1990 by Xerox Corporation. All rights reserved. Peter B. Kessler, April 18, 1990 10:12:45 pm PDT PROCEDURE [address: Address, proc: PROCEDURE [] RETURNS []] RETURNS [] Watch this! We compute target field offsets using structures we've defined over here! I think this is about the grottiest code I've written, but Russ says it's the most straightforward way of doing it. We don't have to acquire the monitor lock, since the remote debuggee is frozen. We can't acquire the monitor lock, and the remote world is frozen. Κύ– "cedar" style•NewlineDelimiter ™codešœ™K™