<<>> <> <> <> <> <> <> <> <> DIRECTORY BasicTime USING[GMT], CardTab, CirioNubAccess USING[Handle, RemoteAddress], CirioTypes, LoadStateAccess USING[BasicPCInfo, LoadedModuleInfo, LoadedSegmentInfo, LoadStateHandle], MobAccess USING[BodySE, BTH, CTXH, CTXR, MobCookie, SEH, SER, TypeInfoConsSE], MobObjectFiles, MobDefs USING[VersionStamp], NewRMTW USING[CedarModuleSet], PFS, PFSNames USING [PATH], Records USING[FieldCase], RefTab USING[Ref], Rope USING[ROPE], Symbols USING[SEIndex, SENull], SystemInterface USING[CirioFile]; RMTWPrivate: CEDAR DEFINITIONS = BEGIN OPEN LSA:LoadStateAccess; ROPE: TYPE ~ Rope.ROPE; PATH: TYPE = PFSNames.PATH; Nat: TYPE = CirioTypes.Nat; Node: TYPE = CirioTypes.Node; Type: TYPE = CirioTypes.Type; CC: TYPE = CirioTypes.CompilerContext; BitAddr: TYPE = CirioTypes.BitAddr; BitStretch: TYPE = CirioTypes.BitStretch; Mem: TYPE = CirioTypes.Mem; BasicTypeInfo: TYPE = CirioTypes.BasicTypeInfo; BasicTypeInfoPrivate: TYPE = CirioTypes.BasicTypeInfoPrivate; ModuleScope: TYPE = CirioTypes.ModuleScope; SEH: TYPE = MobAccess.SEH; SER: TYPE = MobAccess.SER; CTXH: TYPE = MobAccess.CTXH; CTXR: TYPE = MobAccess.CTXR; bitsPerAu: Nat = CirioTypes.bitsPerAu; bitsPerPtr: Nat = CirioTypes.bitsPerPtr; unspecdBA: BitAddr = CirioTypes.unspecdBA; zeroBA: BitAddr = CirioTypes.zeroBA; ptrSize: BitAddr = CirioTypes.ptrSize; noMem: Mem = CirioTypes.noMem; <> <<>> RemoteMimosaTargetWorld: TYPE = REF RemoteMimosaTargetWorldBody; RemoteMimosaTargetWorldBody: TYPE = RECORD[ sehHash: SehHashTable, bthHash: BthHashTable, ctxHash: CtxHashTable, tcHash: CardTab.Ref--type code -> Type--, unknownSymbolFlushTime: BasicTime.GMT, ropeStudyTime: BasicTime.GMT, atomSei: Symbols.SEIndex _ Symbols.SENull, atomRecSeh: SEH, atomRecRT: Type, serverName: ROPE, nub: CirioNubAccess.Handle, cc: CC, moduleScope: ModuleScope, cedarModules: NewRMTW.CedarModuleSet, lsh: LSA.LoadStateHandle, setCTC: BOOL]; CtxHashTable: TYPE = REF CtxHashTableBody; CtxHashTableBody: TYPE = RECORD[table: RefTab.Ref]; <> CreateCtxHashTable: PROC RETURNS[CtxHashTable]; StudyRopes: PROC [rmtw: RemoteMimosaTargetWorld]; FindHelpingSehs: PROC [ctxh: CTXH, rmtw: RemoteMimosaTargetWorld] RETURNS [atomRecSeh: SEH]; FindSeh: PROC [ctxh: CTXH, name: ROPE, rmtw: RemoteMimosaTargetWorld] RETURNS [n, t: SEH]; <> <<>> <> <<>> <> <> <<>> <> <<(1) nested blocks have record structures that are defined by the localCtx of a BTH>> <<(2) the outermost structure of a procedure frame (procedure, arguments record, results record, enclosing context) is defined by assorted symbol information reached from the outermost BTH>> <<(3) the set of nested blocks and outermost BTH of a procedure are defined by the BTH associated with the bracket pair that most tightly encloses a given pc.>> <<>> BthHashTable: TYPE = REF BthHashTableBody; BthHashTableBody: TYPE = RECORD[table: RefTab.Ref]; CreateBthHashTable: PROC RETURNS[BthHashTable]; <> <<>> <> SehHashTable: TYPE = REF SehHashTableBody; SehHashTableBody: TYPE = RECORD[table: RefTab.Ref]; CreateSehHashTable: PROC RETURNS[SehHashTable]; <> <<>> <<>> UnderTypeSEH: PROC[seh: SEH, rmtw: RemoteMimosaTargetWorld] RETURNS[SEH]; <> SehKnowledge: TYPE ~ {none, notSpecial, ROPE, RopeRep, ATOM}; <> AnalyzeSEH: PROC[seh: SEH, rmtw: RemoteMimosaTargetWorld, sk: SehKnowledge] RETURNS[Type]; <> FmtSeh: PROC [seh: SEH, name: ROPE] RETURNS [ROPE]; <> TsDict: TYPE ~ REF TsDictPrivate; TsDictPrivate: TYPE ~ RECORD [ tc: CARD, ts: ROPE, defs: ARRAY CHAR OF TsDef _ ALL[[]] ]; TsDef: TYPE ~ RECORD [ start: INT _ INT.FIRST, type: Type _ NIL]; AnalyzeTc: PROC [rmtw: RemoteMimosaTargetWorld, tc: CARD] RETURNS [Type]; AnalyzeTs: PROC [rmtw: RemoteMimosaTargetWorld, tsd: TsDict, i: INT, opts: TsOptions _ ALL[FALSE]] RETURNS [Type, INT]; TsOptions: TYPE ~ PACKED ARRAY TsOption OF BOOL _ ALL[FALSE]; TsOption: TYPE ~ {mds, ordered, packed, readOnly, safe}; TsoSet: PROC [old: TsOptions, opt: TsOption] RETURNS [TsOptions] ~ INLINE {old[opt] _ TRUE; RETURN [old]}; <> <<>> <> <<>> <> <<>> <> AnalyzedCTX: TYPE = REF AnalyzedCTXBody; AnalyzedCTXBody: TYPE = RECORD[ painted, blockRecord, hasNtConst: BOOLEAN, recordType: Type, --direct fieldListType: Type, --direct ampersandFields: LIST OF FieldInfo, typeFields: LIST OF FieldInfo, rmtw: RemoteMimosaTargetWorld, bitSize: BitAddr, AnalyzeField: PROC [ctxInfo: AnalyzedCTX, index: CARDINAL, fi: FieldInfo] RETURNS [FieldInfo], repData: MobCtxRep, <> fields: SEQUENCE nFields: CARDINAL OF FieldInfo]; MobCtxRep: TYPE ~ REF MobCtxRepPrivate; MobCtxRepPrivate: TYPE ~ RECORD [ mob: MobAccess.MobCookie, jmpi: MobObjectFiles.JointMobParsedInfo, bth: MobAccess.BTH --present iff blockRecord ]; FieldInfo: TYPE = RECORD[ name: ROPE, rmtw: RemoteMimosaTargetWorld, fieldCase: Records.FieldCase, analysisValid: BOOLEAN _ FALSE, fieldDirectType: Type, -- valid only if analysisValid unionAnalysis: Type _ NIL, <> fieldLoc: REF BitStretch _ NIL, <> varLoc: MobObjectFiles.VarLoc _ NIL, <> repData: MobFieldRep <> ]; MobFieldRep: TYPE ~ REF MobFieldRepPrivate; MobFieldRepPrivate: TYPE ~ RECORD [ seh: SEH, <> <> ser: SER, serBody: REF id MobAccess.BodySE, sk: SehKnowledge]; AnalyzeTsRecord: PROC [rmtw: RemoteMimosaTargetWorld, tsd: TsDict, i: INT] RETURNS [Type, INT]; AnalyzeCTX: PROC[ctxh: CTXH, bindSeh: SEH, painted, unpackedArgResultRecord, blockRecord, maybeVariant, variantCases, isHelper, defer: BOOL, rmtw: RemoteMimosaTargetWorld, bitSize: BitAddr _ unspecdBA, jmpi: MobObjectFiles.JointMobParsedInfo _ NIL, bth: MobAccess.BTH _ NIL] RETURNS[ctxInfo: AnalyzedCTX, recType: Type]; <> <> <> <> <> <> <> <> < last field may indicate sequence or variant record.>> < last field *will* indicate variant record; return the bound variant type described by bindSeh (which is, unfortunately, the constructor, not the name); nobody cares about the returned AnalyzedCTX.>> < this context describes the cases of a variant record.>> < We're working on CirioRopeHelper, so invent some SehKnowledge.>> < refrain from analyzing element types.>> <<>> GetCompleteContext: PROC[ctxh: CTXH, rmtw: RemoteMimosaTargetWorld] RETURNS[CTXH, CTXR]; <> <<>> <> CreateSimpleMem: PROC[addr: CirioNubAccess.RemoteAddress, size: BitAddr _ unspecdBA] RETURNS[Mem]; <> MakeDualMem: PROC [nub: CirioNubAccess.Handle, fp, sp: CARD, text, data, bss: LSA.LoadedSegmentInfo, fep, simple: BitStretch] RETURNS [mem: Mem]; <> SelectVarLoc: PROC [nub: CirioNubAccess.Handle, fm: Mem, vl: MobObjectFiles.VarLoc] RETURNS [Mem]; <> <> <<>> <<(implementation is in RMTWModules)>> <> <> GetDefinitionMob: PROC[modules: NewRMTW.CedarModuleSet, vs: MobDefs.VersionStamp, stem: PATH _ NIL] RETURNS[MobAccess.MobCookie]; <> <<(RMTWCompounds contains the code for handling records, sequences, arrays, and variant records.)>> AnalyzeArraySEH: PROC[seh: SEH, ser: SER, cons: REF cons MobAccess.BodySE, ti: REF array MobAccess.TypeInfoConsSE, rmtw: RemoteMimosaTargetWorld] RETURNS[Type]; AnalArrayTs: PROC [rmtw: RemoteMimosaTargetWorld, tsd: TsDict, i: INT, opts: TsOptions] RETURNS [Type, INT]; AnalyzeRecordSEH: PROC[seh: SEH, ser: SER, cons: REF cons MobAccess.BodySE, ti: REF record MobAccess.TypeInfoConsSE, rmtw: RemoteMimosaTargetWorld, isRopeRep: BOOL] RETURNS[Type]; EnumeratedTypeIndexToName: PROC [type: Type, index: INT, cc: CC] RETURNS [ROPE]; ConvertFromIndirectToPointer: PROC[indirect: CirioTypes.Node, mem: Mem, rmtw: RemoteMimosaTargetWorld] RETURNS[CirioTypes.Node]; AnalyzeRefSEH: PROC[dft: Type, seh: SEH, ser: SER, cons: REF cons MobAccess.BodySE, ti: REF ref MobAccess.TypeInfoConsSE, rmtw: RemoteMimosaTargetWorld, sk: SehKnowledge] RETURNS[Type]; AnalyzeProcedureSEH: PROC[ti: REF transfer MobAccess.TypeInfoConsSE, cons: REF cons MobAccess.BodySE, ser: SER, seh: SEH, rmtw: RemoteMimosaTargetWorld] RETURNS[Type]; AnalProcTs: PROC [rmtw: RemoteMimosaTargetWorld, tsd: TsDict, i: INT, opts: TsOptions] RETURNS [Type, INT]; AnalyzedUnknownSEH: PROC[seh: SEH, rmtw: RemoteMimosaTargetWorld, explanation: ROPE, bits: INT] RETURNS[Type]; <> MakeBrokenType: PROC [rmtw: RemoteMimosaTargetWorld, explanation: ROPE, bits: INT] RETURNS [Type]; <> UnimplementedTypeNode: PROC[targetType: Type, rmtw: RemoteMimosaTargetWorld, explanation: ROPE] RETURNS[Node]; <> CreateProcConstant: PROC [rmtw: RemoteMimosaTargetWorld, jmpi: MobObjectFiles.JointMobParsedInfo, searchMem: Mem, textBase: CARD, bth: MobAccess.BTH] RETURNS [Node]; <> <> <<>> <> GenRecordFields: PROC[type: Type, cc: CC, nFields: PROC[CARD], eachField: PROC[index: CARD, byteOffset: INT, bitOffset: INT, bitSize: CARD] ]; <> <<>> NameParts: TYPE = RECORD[ principalDirectory: PATH, <> <> nameStem: ROPE <> <> ]; <> GetNamePartsFromFullPathName: PROC [fullPathName: PATH] RETURNS [NameParts]; SeekCSource: PROC [cms: NewRMTW.CedarModuleSet, basicInfo: REF LSA.BasicPCInfo, ledo: REF LSA.LoadedModuleInfo] RETURNS [foundFile: SystemInterface.CirioFile]; END..