LarkPrograms.mesa
Last Edited by: Stewart, August 30, 1983 3:11 pm
DIRECTORY
IO USING [STREAM],
Rope USING [ROPE],
TeleLoad USING [AddressSpace, CoreAddress, CoreBlock, State8086Object];
LarkPrograms: CEDAR DEFINITIONS = {
Here is the symbol table part
IDType: TYPE = {procedure, variable};
STObject: TYPE = RECORD [
id: Rope.ROPENIL,
addr: INT ← 0,
type: IDType ← variable
];
global variable with null stuff in it.
nullItem: STObject;
STItem: TYPE = REF STObject;
SymbolTable: TYPE = REF SymTabObject;
SymTabObject: TYPE = RECORD [
e: SEQUENCE length: NAT OF STObject
];
Dealing with programs for Lark
PatchItem: TYPE = REF PatchItemObject;
PatchItemObject: TYPE = RECORD [
name: Rope.ROPE,
address: TeleLoad.CoreAddress,
wordValue: CARDINAL
];
Program: TYPE = REF ProgramObject;
ProgramObject: TYPE = RECORD [
program: LIST OF TeleLoad.CoreBlock ← NIL,
patchList: LIST OF PatchItem ← NIL,
programName: Rope.ROPENIL,
addressSpace: TeleLoad.AddressSpace ← main,
startState: TeleLoad.State8086Object,
searchTable: REF SymTabObject ← NIL,
nameTable: REF SymTabObject ← NIL
];
Enumerate all programs on tap.
EnumeratePrograms: PROC [proc: PROC [program: Program] RETURNS [stop: BOOL]];
Search for the given program on the list of parsed programs
FetchProgram: PROC [programName: Rope.ROPE] RETURNS [p: Program];
Put the given program on the list of parsed programs, replacing a previous copy
AddOrReplaceProgram: PROC [program: Program];
Reset the patch list associated with the program. program.patchList ← NIL
ResetPatchList: PROC [program: Program];
Reads the program, but does not store it in the data base (use AddOrReplaceProgram)
ReadProgramFromDisk: PROC [objectFileName: Rope.ROPE, log: IO.STREAMNIL, addressSpace: TeleLoad.AddressSpace ← main] RETURNS [Program];
ReadProgramFromMBFile: PROC [mbFileName: Rope.ROPE, baseAddress: TeleLoad.CoreAddress, log: IO.STREAMNIL, addressSpace: TeleLoad.AddressSpace ← main] RETURNS [Program];
Read symbol tables for the program. Used internally by Monitor and ReadProgramFromDisk, probably not needed externally.
BuildSearchTable: PROC [program: Program, name: Rope.ROPE, log: IO.STREAMNIL];
Add a patch item to the list for the given program.
PatchProgramWord: PROC [program: Program, address: TeleLoad.CoreAddress, wordValue: CARDINAL, name: Rope.ROPENIL];
Read patch items from the given file, checking symbol names against the symbol table for the given program.
PatchFromFile: PROC [program: Program, fileName: Rope.ROPE, log: IO.STREAMNIL] RETURNS [LIST OF PatchItem];
Symbol table access. ProcedureEnclosing is handy for printing stack traces. It finds the symbol with the next lowest address. (Note: works fine for finding the static symbol most nearby.) If searchMonitor = TRUE, then the search will include monitor symbols, if any can be found.
ProcedureEnclosing: PROC [program: Program, addr: TeleLoad.CoreAddress, searchMonitor: BOOLTRUE] RETURNS [s: STObject];
Usual kind of symbol table lookup. If searchMonitor = TRUE, then the search will include monitor symbols, if any can be found.
FindVariable: PROC [program: Program, name: Rope.ROPE, searchMonitor: BOOLTRUE] RETURNS [item: STObject, found: BOOL];
Return, if possible, a handle for the EPROM monitor for Lark. This is useful for looking at monitor statics.
Monitor: PROC [log: IO.STREAMNIL, addressSpace: TeleLoad.AddressSpace ← main] RETURNS [mon: Program];
}.
April 25, 1983 11:08 am, LCS, created from TeleDebOps
August 10, 1983 12:07 pm, LCS, added ReadProgramFromMBFile
August 30, 1983 3:11 pm, LCS, added addressSpace arg to Monitor