Cedar Nucleus: data structures for communication between debugger and debuggee
DebuggerFormat.mesa
Andrew Birrell July 26, 1983 4:44 pm
DIRECTORY
DiskFace USING [Label, PageNumber, Type],
PrincOps USING [GlobalFrameHandle, PsbIndex, PsbNull, StateVector, SVPointer],
Basics USING [BITXOR, HighHalf, LowHalf];
DebuggerFormat: CEDAR DEFINITIONS
IMPORTS Basics =
BEGIN
SVPointer: TYPE = PrincOps.SVPointer;
SwapInfo: TYPE = RECORD [
(this is the actual usage of PrincOps.PDA.available.)
availableA: UNSPECIFIED,
externalStateVector: LONG POINTER TO ExternalStateVector,
availableB: ARRAY [0..2) OF UNSPECIFIED ];
ExternalStateVector: TYPE = MACHINE DEPENDENT RECORD [
state: SVPointer, -- client's higher level state. (a short pointer
in the (only) MDS.
reason: SwapReason,
level: [0..3777B],
parameter: POINTER TO DebugParameter,
versionident: CARDINAL,
loadstatepage: CARDINAL,
spare: CARDINAL,
vmRunTable: LONG POINTER TO VMRunTable,
mds: CARDINAL, -- MDS of *all* processes.
filler: [0..100B) ← 0,
psb: PrincOps.PsbIndex ← PrincOps.PsbNull, -- PrincOps of current process.
fill: ARRAY [10..19) OF WORD];
VersionID: CARDINAL = 08130+1;
SwapReason: TYPE = MACHINE DEPENDENT{
handled by user's nub
proceed(0), -- THIS MUST BE FIRST !!
start(1),
call(2),
resume(3),
quit(4),
showscreen(5),
kill(6),
handled by debugger
breakpoint(8),
worrybreak(9),
worrycall(10),
uncaughtsignal(11),
explicitcall(12),
return(13),
returnAborted(24),
(31)
};
DebugParameter: TYPE = MACHINE DEPENDENT RECORD [
spare: POINTER,
body: SELECT OVERLAID SwapReason FROM
uncaughtsignal => [
msg: UNSPECIFIED,
signal: UNSPECIFIED],
return => [
value: UNSPECIFIED],
start => [
frame: PrincOps.GlobalFrameHandle],
call => [
sv: PrincOps.StateVector],
ENDCASE];
VMRunTable: TYPE = MACHINE DEPENDENT RECORD[
nRuns: CARDINAL,
runs: SEQUENCE length: CARDINAL OF Run];
Run: TYPE = MACHINE DEPENDENT RECORD [
page: INT -- VM.PageNumber--,
count: CARDINAL, -- number of pages in this contiguous run --
Description of the first page of the run:
deviceType: DiskFace.Type,
deviceOrdinal: CARDINAL,
diskPage: DiskFace.PageNumber, -- physical page number relative to [type,ordinal]
labelCheck: CARDINAL -- compact approximation to the label of first page of run
];
LabelChecksum: SAFE PROC[label: DiskFace.Label, offset: CARDINAL] RETURNS[ CARDINAL ] = TRUSTED INLINE
BEGIN
OPEN fID: LOOPHOLE[label.fileID, MACHINE DEPENDENT RECORD[a,b,c,d,e: CARDINAL]];
adj: INT = label.filePage - offset;
RETURN[ Basics.BITXOR[
fID.a, Basics.BITXOR[
fID.b, Basics.BITXOR[
fID.c, Basics.BITXOR[
fID.d, Basics.BITXOR[
fID.e, Basics.BITXOR[
Basics.LowHalf[adj], Basics.HighHalf[adj]
]]]]]] ]
END;
END.