-- XXDebugInterface.mesa Edited by Bruce, October 13, 1980 2:23 PM DIRECTORY FormSW, ImageDefs USING [BcdTime], RESOut USING [WindowsObject], STDebugDefs USING [depthString, showLinks, STDebugMisc, STDebugSymbols, STDebugTrees], String USING [AppendString], Time USING [Append, Unpack], Tool, ToolWindow USING [TransitionProcType], Window, XXDebugCommandDefs USING [ParamIndex, Params], XXDebugDefs; XXDebugInterface: PROGRAM IMPORTS FormSW, ImageDefs, STDebugDefs, String, Time, Tool, XXDebugDefs EXPORTS XXDebugDefs = BEGIN OPEN FormSW, XXDebugDefs; windows: RESOut.WindowsObject _ [NIL, NIL, NIL, NIL]; Init: PRIVATE PROCEDURE = BEGIN title: STRING = "Mesa 6.0 Debugger Debug of "L; herald: STRING _ [60]; String.AppendString[to: herald, from: title]; Time.Append[herald, Time.Unpack[ImageDefs.BcdTime[]]]; herald.length _ herald.length - 3; windows.main _ Tool.Create[ makeSWsProc: MakeMySWs, clientTransition: StateChanged, name: herald]; XXDebugDefs.handle _ @windows; END; StateChanged: ToolWindow.TransitionProcType = BEGIN IF new = inactive THEN windows.msgSW _ windows.formSW _ windows.fileSW _ NIL; END; MakeMySWs: Tool.MakeSWsProc = BEGIN windows.msgSW _ Tool.MakeMsgSW[window: window]; windows.formSW _ Tool.MakeFormSW[window: window, formProc: MakeParameterArray]; windows.fileSW _ Tool.MakeFileSW[window: window, name: "XXDebug.log"L]; END; TopCtxCol: CARDINAL = 0*7; StkCol: CARDINAL = TopCtxCol + 8*7; CtxCol: CARDINAL = StkCol + 7*7; CtCol: CARDINAL = CtxCol + 8*7; MTCol: CARDINAL = CtCol + 4*7; LitCol: CARDINAL = MTCol + 4*7; SourceCol: CARDINAL = LitCol + 7*7; ListCol: CARDINAL = SourceCol + 13*7; topctxPlace: Window.Place = [x: TopCtxCol+0*7, y: line0]; tosPlace: Window.Place = [x: TopCtxCol+0*7, y: line1]; pcPlace: Window.Place = [x: TopCtxCol+0*7, y: line2]; nxpcPlace: Window.Place = [x: TopCtxCol+4*7, y: line2]; pcciPlace: Window.Place = [x: TopCtxCol+0*7, y: line3]; stkPlace: Window.Place = [x: StkCol+0*7, y: line0]; brkPlace: Window.Place = [x: StkCol+0*7, y: line1]; fooPlace: Window.Place = [x: StkCol+1*7, y: line2]; ctxPlace: Window.Place = [x: CtxCol+1*7, y: line0]; userPlace: Window.Place = [x: CtxCol+1*7, y: line1]; nPlace: Window.Place = [x: CtxCol+0*7, y: line2]; ctiPlace: Window.Place = [x: CtCol+0*7, y: line0]; btiPlace: Window.Place = [x: CtCol+0*7, y: line1]; seiPlace: Window.Place = [x: CtCol+0*7, y: line2]; mdiPlace: Window.Place = [x: MTCol+0*7, y: line0]; htiPlace: Window.Place = [x: MTCol+0*7, y: line1]; nextsePlace: Window.Place = [x: MTCol+0*7, y: line2]; ltiPlace: Window.Place = [x: LitCol+1*7, y: line0]; repPlace: Window.Place = [x: LitCol+1*7, y: line1]; treePlace: Window.Place = [x: LitCol+0*7, y: line2]; sourcePlace: Window.Place = [x: SourceCol+0*7, y: line0]; filePlace: Window.Place = [x: SourceCol+0*7, y: line1]; depthPlace: Window.Place = [x: SourceCol+0*7, y: line2]; linksPlace: Window.Place = [x: SourceCol+6*7, y: line2]; listPlace: Window.Place = [x: ListCol+0*7, y: line2]; nxlistPlace: Window.Place = [x: ListCol+6*7, y: line2]; nsizePlace: Window.Place = [x: ListCol-4*7, y: line3]; nlinkPlace: Window.Place = [x: ListCol+4*7, y: line3]; MakeParameterArray: FormSW.ClientItemsProcType = BEGIN OPEN FormSW; sourceEnumRec: ARRAY STSource OF Enumerated _ [ [string: "allocator"L, value: STSource[allocator]], [string: "file"L, value: STSource[file]], [string: "copier"L, value: STSource[copier]], [string: "alFrame"L, value: STSource[alFrame]], [string: "spFrame"L, value: STSource[spFrame]], [string: "none"L, value: STSource[none]]]; nParams: CARDINAL = LOOPHOLE[LAST[XXDebugCommandDefs.ParamIndex], CARDINAL] + 1; params: XXDebugCommandDefs.Params _ LOOPHOLE[AllocateItemDescriptor[nParams]]; params[topctx] _ CommandItem[ tag: "TopCtx"L, place: topctxPlace, proc: ParamNotify]; params[tos] _ CommandItem[ tag: "TOS"L, place: tosPlace, proc: ParamNotify]; params[pc] _ CommandItem[ tag: "PC"L, place: pcPlace, proc: ParamNotify]; params[nxpc] _ CommandItem[ tag: "nx"L, place: nxpcPlace, proc: ParamNotify]; params[pcci] _ CommandItem[ tag: "pcci"L, place: pcciPlace, proc: ParamNotify]; params[stk] _ CommandItem[ tag: "@Stk"L, place: stkPlace, proc: ParamNotify]; params[brk] _ CommandItem[ tag: "@Brk"L, place: brkPlace, proc: ParamNotify]; params[foo] _ CommandItem[ tag: "Foo"L, place: fooPlace, proc: ParamNotify]; params[ctx] _ CommandItem[ tag: "@Ctx"L, place: ctxPlace, proc: ParamNotify]; params[user] _ CommandItem[ tag: "user"L, place: userPlace, proc: ParamNotify]; params[n] _ StringItem[ tag: "n"L, place: nPlace, string: @XXDebugDefs.nString, inHeap: TRUE]; params[cti] _ CommandItem[ tag: "ct"L, place: ctiPlace, proc: ParamNotify]; params[bti] _ CommandItem[ tag: "bt"L, place: btiPlace, proc: ParamNotify]; params[sei] _ CommandItem[ tag: "se"L, place: seiPlace, proc: ParamNotify]; params[mdi] _ CommandItem[ tag: "mt"L, place: mdiPlace, proc: ParamNotify]; params[hti] _ CommandItem[ tag: "ht"L, place: htiPlace, proc: ParamNotify]; params[nextse] _ CommandItem[ tag: "nx"L, place: nextsePlace, proc: ParamNotify]; params[lti] _ CommandItem[ tag: "lit"L, place: ltiPlace, proc: ParamNotify]; params[rep] _ CommandItem[ tag: "rep"L, place: repPlace, proc: ParamNotify]; params[tree] _ CommandItem[ tag: "Tree"L, place: treePlace, proc: ParamNotify]; params[source] _ EnumeratedItem[ tag: "source"L, place: sourcePlace, feedback: one, choices: LOOPHOLE[DESCRIPTOR[sourceEnumRec]], proc: SourceChanged, value: @stSource]; params[file] _ StringItem[ tag: "file/frame"L, place: filePlace, string: @stFile, filterProc: NameChanged, inHeap: TRUE]; params[depth] _ StringItem[ tag: "d"L, place: depthPlace, string: @STDebugDefs.depthString, inHeap: TRUE]; params[links] _ BooleanItem[ tag: "lnks"L, place: linksPlace, switch: @STDebugDefs.showLinks]; params[list] _ CommandItem[ tag: "list"L, place: listPlace, proc: ParamNotify]; params[nxlist] _ CommandItem[ tag: "nx"L, place: nxlistPlace, proc: ParamNotify]; params[nsize] _ StringItem[ tag: "size"L, place: nsizePlace, string: @XXDebugDefs.nodeSizeString, inHeap: TRUE]; params[nlink] _ StringItem[ tag: "link"L, place: nlinkPlace, string: @XXDebugDefs.nodeLinkString, inHeap: TRUE]; RETURN[items: LOOPHOLE[params], freeDesc: TRUE]; END; NameChanged: FormSW.FilterProcType = BEGIN IF stSource = file THEN BEGIN stSource _ none; FormSW.DisplayItem[ sw, LOOPHOLE[XXDebugCommandDefs.ParamIndex[source]]]; END; FormSW.StringEditProc[sw, item, insert, string]; END; -- Mainline code START XXDebugCommands; START STDebugDefs.STDebugTrees; START STDebugDefs.STDebugSymbols; START XXDebugGlobals; START XXDebugContext; START XXDebugUser; START XXDebugPC; START STDebugDefs.STDebugMisc; Init[]; END...