Handle:
PUBLIC
TYPE ~
REF HandleRep ←
NIL;
HandleRep:
PUBLIC
TYPE ~
RECORD [
sameWorldNub: CirioNubAccess.Handle ← NIL,
fileSet: SystemInterface.FileSet ← NIL,
moduleSet: NewRMTW.CedarModuleSet ← NIL,
loadState: LoadStateAccess.LoadStateHandle ← NIL,
breakWorld: BreakWorldArchitecture.BreakWorld ←
BreakWorldArchitecture.nullBreakWorld
];
Create:
PUBLIC
PROCEDURE []
RETURNS [SameBreakWorld.Handle] ~ {
handle: Handle ←
NEW[HandleRep ← [
sameWorldNub: ,
fileSet: ,
moduleSet: NIL,
loadState: NIL,
breakWorld: BreakWorldArchitecture.nullBreakWorld]];
sameWorldServerName: Rope.
ROPE ~ "sameWorld";
cf. LocalCirioImpl.InstallNewConnectionComponents.
handle.sameWorldNub ← CirioNubAccess.CreateSameWorldNub[];
handle.fileSet ← SystemInterface.CreateFileSet[];
handle.moduleSet ← NewRMTW.CreateCedarModuleSet[fileSet: handle.fileSet];
handle.loadState ← LoadStateAccess.CreateLoadStateHandle[
serverName: sameWorldServerName,
nub: handle.sameWorldNub, fileSet: handle.fileSet];
{
breakSet: CirioBreakAccess.CirioBreakSet ← CirioBreakAccess.CreateCirioBreakSet[
nub: handle.sameWorldNub,
fileNameStem: "PopUpDriver2",
breakProcName: "BreakPointPopUp"];
cf. Cirio/LocalCirioImpl.mesa
handle.breakWorld ← CirioBreakAccess.BreakWorldFromBreakSet[breaks: breakSet];
};
RETURN [handle];
};
BreakWorld:
PUBLIC
PROCEDURE [handle: SameBreakWorld.Handle]
RETURNS [BreakWorldArchitecture.BreakWorld] ~ {
breakWorld: BreakWorldArchitecture.BreakWorld ←
BreakWorldArchitecture.nullBreakWorld;
IF handle # SameBreakWorld.nullHandle
THEN {
breakWorld ← handle.breakWorld
};
RETURN [breakWorld];
};
PCFromFileAndPosition:
PUBLIC
PROCEDURE [
handle: SameBreakWorld.Handle,
mesaFilename: Rope.
ROPE, position:
INT, report:
IO.
STREAM]
RETURNS [address:
CARD ← 0, correspondingPosition:
INT ← 0] ~ {
IF handle # SameBreakWorld.nullHandle
THEN {
ENABLE {
SystemInterface.ShowReport => {
report.PutRope[msgText];
report.PutChar['\n];
RESUME;
};
};
mesaFile: NewRMTW.CirioFile ← SystemInterface.GetCirioFile[
set: handle.fileSet, name: PFS.PathFromRope[rope: mesaFilename]];
addr:
REF NewRMTW.CedarBreakAddress ← NewRMTW.GetAbsAddressForBreak[
modules: handle.moduleSet,
mesa: mesaFile,
loadState: handle.loadState,
sourcePos: position];
IF addr = NIL THEN ERROR NotFound;
address ← addr.absPC;
correspondingPosition ← addr.correspondingMesaPosition;
};
RETURN [address: address, correspondingPosition: correspondingPosition];
};