CirioNub.mesa
Demers, September 19, 1989 5:33:51 pm PDT
DIRECTORY
Rope USING [ROPE]
;
CirioNub: CEDAR DEFINITIONS ~ {
Copied Types
ROPE: TYPE ~ Rope.ROPE;
Types
Debugger session
Handle: TYPE ~ REF Object;
Object: TYPE;
Remote procedure arguments and results
ProcID: TYPE ~ CARD32;
Block8: TYPE ~ REF TEXT;
Block16: TYPE ~ REF Block16Record;
Block16Record: TYPE ~ RECORD [
count: CARDINAL,
val: SEQUENCE maxCount: CARDINAL OF CARD16
];
Block32: TYPE ~ REF Block32Record;
Block32Record: TYPE ~ RECORD [
count: CARDINAL,
val: SEQUENCE maxCount: CARDINAL OF CARD32
];
CallResult: TYPE ~ REF CallResultRecord;
CallResultRecord: TYPE ~ RECORD [
count: CARDINAL ← 0,
val: SEQUENCE maxCount: CARDINAL OF REF -- CARD32 | INT32 | TEXT | Block16 | Block32
];
ReturnCode: TYPE ~ MACHINE DEPENDENT {
ok (0),
noProc (1),
badArgs(2),
The remaining return codes won't be seen on client side ...
failure(128),
commError(129),
protocolError(130),
spaceError(131),
last (CARDINAL.LAST)
};
Session management
Create: PROC [protocolFamily: ATOM ← $ARPA, debuggee: ROPENIL, timeoutMsec: CARDCARD.LAST] RETURNS [h: Handle];
Create a handle for talking to specified debuggee.
Default debuggee is local host at well-known PCR debugging port.
! Error[$connectError, $debuggeeLookupError, $timeout]
Destroy: PROC [h: Handle];
Destroy a handle.
No ERRORs.
Procedure call
StartCall: PROC [h: Handle, procID: ProcID];
Prepare to call given proc.
! Error[$noConnection]
The following procs are are used after StartCall to send arguments. The CirioNub package takes care of byte/word-order considerations.
PutCard32: PROC [h: Handle, card32: CARD32];
PutInt32: PROC [h: Handle, int32: INT32];
PutRope: PROC [h: Handle, rope: ROPE];
PutBlock8: PROC [h: Handle, block8: REF TEXT];
PutBlock8Cnt: PROC [h: Handle, cnt: CARDINAL];
PutBlock8Next: PROC [h: Handle, byte: BYTE];
Low level implementation of PutBlock8.
PutBlock16: PROC [h: Handle, block16: Block16];
PutBlock16Cnt: PROC [h: Handle, cnt: CARDINAL];
PutBlock16Next: PROC [h: Handle, card16: CARD16];
Low level implementation of PutBlock16.
PutBlock32: PROC [h: Handle, block32: Block32];
PutBlock32Cnt: PROC [h: Handle, cnt: CARDINAL];
PutBlock32Next: PROC [h: Handle, card32: CARD32];
Low level implementation of PutBlock32.
Call: PROC [h: Handle] RETURNS [rc: ReturnCode, result: CallResult ← NIL];
Send call message, wait for result and return it.
If (rc # ok), then result will be NIL.
! Error[$noConnection]
Error
Error: ERROR [code: ATOM];
$failure  -- generic failure, may result from any proc that raises Error.
$debuggeeNameLookupError
$connectError
$noConnection -- handle has no connection, or can't connect.
$timeout
$communicationFailure
$putBlockError -- client put more than was promised
$protocol  -- the other end screwed up
}.