CirioThingsImpl.mesa
Copyright Ó 1989, 1990, 1991 by Xerox Corporation. All rights reserved.
Peter B. Kessler, September 21, 1989 2:51:19 pm PDT
Willie-s, April 7, 1992 1:40 pm PDT
These are things that Cirio needs in the target world that can be dynamically loaded.
That is, they don't have to be in the debug nub, and they don't have well-known addresses.
We also use this module, which lives in CedarCore, to start the DebugNub early, so that one can debug the startup of packaged worlds, and get a port number for cirio early.
Udagawa, March 19, 1991 11:47 am PST
DIRECTORY
CirioThings,
Rope,
UXProcs;
CirioThingsImpl: CEDAR PROGRAM
IMPORTS UXProcs EXPORTS CirioThings
~ {
Types
SymEntry: TYPE = REF SymEntryBody; -- copied from CirioNubAccess for temporary fix.
SymEntryBody: TYPE = RECORD[
name: Rope.ROPE,
type: CARD,
value: CARD,
size: CARD,
fileSeqNum: CARD];
Procedures.
DoIncludes: PROC = TRUSTED MACHINE CODE {
"*";
"#include <xr/BasicTypes.h>\n";
"#include <xr/IncrementalLoad.h>\n";
"."
};
CallDebugger: PUBLIC PROC [key: CARD32] ~ {
Calls XR�llDebugger with key and raises ABORTED if anything other than CirioThings.XRDBReply.proceed is returned.
XRCallDebugger: PROCEDURE [key: CARD32] RETURNS [CirioThings.XRDBReply] ~
TRUSTED MACHINE CODE {
"XR�llDebugger"
};
LookupCallDebugger3: PROCEDURE RETURNS [SymEntry] ~ TRUSTED MACHINE CODE {
"+static word LookupCallDebugger3 () {\n";
" return XR←ILGetMatchingSymEntryByName(0, \"←XR�llDebugger3\", 0xffffffff, 4, 1, 0);\n";
" };\n";
".LookupCallDebugger3";
};
result: CirioThings.XRDBReply;
proc: PROC[key: CARD32, msg: CirioThings.XRDBRequest, stopall: CARD32] RETURNS [CirioThings.XRDBReply];
entry: SymEntry ¬ LookupCallDebugger3[];
IF entry # NIL THEN
{
proc ¬ LOOPHOLE[UXProcs.ToCedarProc[entry.value]]; -- XR¬CallDebugger3
result ¬ proc[key: 0, msg: CirioThings.XRDBRequest.break, stopall: key];
}
ELSE
result ¬ XRCallDebugger[key: 0];
SELECT result FROM
CirioThings.XRDBReply.proceed => {
NULL;
};
ENDCASE => {
ERROR ABORTED;
};
RETURN;
};
DebugNubStart: PROC = TRUSTED MACHINE CODE {"XR←run𡤌irioNub"};
CedarCirioNubStart: PROC = TRUSTED MACHINE CODE {"XR←run�rCirioNub"};
DebugNubStart[];
CedarCirioNubStart[];
}.