DebuggerFormat.mesa
Copyright © 1985 by Xerox Corporation. All rights reserved.
Andrew Birrell December 2, 1983 10:50 am
Russ Atkinson (RRA) January 30, 1985 7:02:47 pm PST
Doug Wyatt, February 22, 1985 5:53:11 pm PST
Data structures for communication between debugger and debuggee.
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: WORD,
externalStateVector: LONG POINTER TO ExternalStateVector,
availableB: ARRAY [0..2) OF WORD
];
ExternalStateVector:
TYPE =
MACHINE
DEPENDENT
RECORD [
state(0): SVPointer, -- client's higher level state. (a short pointer in the (only) MDS).
reason(1:0..4): SwapReason,
level(1:5..15): [0..3777B],
parameter(2): POINTER TO DebugParameter,
versionident(3): CARDINAL,
loadstatepage(4): CARDINAL, -- "Basic" loadState
spare(5): CARDINAL,
vmRunTable(6): LONG POINTER TO VMRunTable,
mds(8): CARDINAL, -- MDS of *all* processes.
psb(9): PrincOps.PsbIndex ← PrincOps.PsbNull, -- PSB of current process.
loadState(10): LONG POINTER TO LoadState ← NIL, -- to "real" loadState data structure if it exists
display(12): LONG POINTER ← NIL, -- display bitmap
displayW(14), displayH(15): CARDINAL,
systemVolumeKnown(16): BOOL,
systemVolume(17): VolumeID
];
VersionID: CARDINAL = 08130+1; -- Rubicon Pilot + 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: WORD, signal: WORD],
return => [value: WORD],
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 {
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]
]]]]]] ]
};
LoadState: TYPE;
VolumeID: TYPE[5];
END.