LoadStateAccess.mesa
Copyright Ó 1990, 1991, 1992, 1993 by Xerox Corporation. All rights reserved.
Sturgis, March 14, 1990 9:53 am PST
Last tweaked by Mike Spreitzer on April 10, 1992 4:00 pm PDT
Coolidge, July 18, 1990 9:55 am PDT
Laurie Horton, August 26, 1991 3:24 pm PDT
Katsuyuki Komatsu December 23, 1992 6:16 pm PST
DIRECTORY
BasicTime USING[GMT],
CirioNubAccess USING[Handle],
ObjectFiles USING[Module, Parsed, SimpleSeg],
PFSNames USING [PATH],
Rope USING[ROPE],
SystemInterface USING[CirioFile, FileSet];
This module is intended to replace part of the old SymbolFinding.
It knows about:
the load state (through the nub),
parsed object files (through ObjectFiles), and
finding loaded object files files.
It knows nothing about mobs, CFiles, or Mesa files.
LoadStateAccess: CEDAR DEFINITIONS =
BEGIN
ROPE: TYPE ~ Rope.ROPE;
PATH: TYPE ~ PFSNames.PATH;
LoadStateHandle: TYPE = REF LoadStateHandleBody;
LoadStateHandleBody: TYPE;
CreateLoadStateHandle: PROC[serverName: ROPE, nub: CirioNubAccess.Handle, fileSet: SystemInterface.FileSet] RETURNS[LoadStateHandle];
NOTE: This implementation doesn't provide for multiple segments of the same type.
LoadedSegmentsInfo: TYPE ~ ARRAY SimpleSeg OF LoadedSegmentInfo;
LoadedSegmentInfo: TYPE ~ RECORD [base, size: CARD];
SimpleSeg: TYPE ~ ObjectFiles.SimpleSeg;
BasicPCInfo: TYPE = RECORD[
loadedFileName: PATH,
lsi: LoadedSegmentsInfo,
possibleModuleNames: LIST OF PATH,
moduleRelativeBaseAddr: CARD,
procedureName: ROPE,
procedureModuleRelativeBaseAddr: CARD];
GetBasicPCInfo: PROC[lsh: LoadStateHandle, absPC: CARD] RETURNS[REF BasicPCInfo];
nil if can't analyze
this one is fast and is intended for a quick list of a call stack
GetRopeForBasicPCInfo: PROC[info: REF BasicPCInfo, absPC: CARD, ctr, pc, mo, la: BOOL] RETURNS[ROPE];
ctr => omit the containing .o
pc => list the module-relative pc
mo => list the PC offset of the module wrt the parsed object file
ctr&la=> list of text base of the parsed object file
GetRopeListForBasicPCInfo: PROC[info: REF BasicPCInfo] RETURNS[LIST OF ROPE];
LoadedModuleInfo: TYPE = RECORD[
mtimeOfLoadedFile: CARD,
sizeOfLoadedFile: CARD,
createTimeOfLoadedFile: BasicTime.GMT,
loadedFile: SystemInterface.CirioFile,
parsed: ObjectFiles.Parsed,
lsi: LoadedSegmentsInfo,
module: ObjectFiles.Module,
possibleModuleFileNames: LIST OF PATH,
moduleRelativeBaseAddr: CARD];
GetLoadedModuleInfoFromAbsPC: PROC[lsh: LoadStateHandle, absPC: CARD, targetData: REF ANY ¬ NIL] RETURNS[REF LoadedModuleInfo];
nil if none
GetLoadedModuleInfoFromStemName: PROC[lsh: LoadStateHandle, moduleName: ROPE, nToSkip: CARD, targetData: REF ANY ¬ NIL] RETURNS[REF LoadedModuleInfo];
moduleName should include no leading directory path
moduleName should terminate before any trailing ".o. ..." or ".c2c. ..."
nil if none
GetRopeListForLoadedModuleInfo: PROC[info: REF LoadedModuleInfo] RETURNS[LIST OF ROPE];
GetRopeListForLoadedFileContainingLoadedModule: PROC[info: REF LoadedModuleInfo] RETURNS[LIST OF ROPE];
END..