Cedar Nucleus: data structures for communication between debugger and debuggee
DebuggerFormat.mesa
Andrew Birrell July 26, 1983 2:25 pm
DIRECTORY
Device USING [Type],
DiskFace USING [PageNumber, Label],
Inline USING [BITXOR, HighHalf, LowHalf],
PrincOps USING [GlobalFrameHandle, StateVector, SVPointer],
PSB USING [PsbIndex, PsbNull];
DebuggerFormat:
CEDAR
DEFINITIONS
IMPORTS Inline =
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: PSB.PsbIndex ← PSB.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: Device.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[ Inline.
BITXOR[
fID.a, Inline.BITXOR[
fID.b, Inline.BITXOR[
fID.c, Inline.BITXOR[
fID.d, Inline.BITXOR[
fID.e, Inline.BITXOR[
Inline.LowHalf[adj], Inline.HighHalf[adj]
]]]]]] ]
END;