Eliot Miranda uploaded a new version of VMMakerUI to project VM Maker: http://source.squeak.org/VMMaker/VMMakerUI-eem.53.mcz
==================== Summary ====================
Name: VMMakerUI-eem.53 Author: eem Time: 5 December 2021, 9:43:17.24613 am UUID: 7b14f884-f965-45ae-a901-1a3e595682ea Ancestors: VMMakerUI-eem.52
Simulator: move and refactor the window closing machinery. Fix closing the multi-threaded simulator and ensure debuggers in threads are also closed.
=============== Diff against VMMakerUI-eem.52 ===============
Item was added: + ----- Method: CogVMSimulator>>close (in category '*VMMakerUI-InterpreterSimulation-Morphic') ----- + close "close any files that ST may have opened, etc" + pluginList do: [:assoc| | plugin | plugin := assoc value. plugin ~~ self ifTrue: [plugin close]]. + "Ugh; at least some of this code belongs in the UI..." + displayView ifNotNil: + [displayView activeHand removeEventListener: self]. + ActiveHand removeEventListener: self. + self closeDependentWindows!
Item was added: + ----- Method: CogVMSimulator>>isDependentDebugger: (in category '*VMMakerUI-InterpreterSimulation-Morphic') ----- + isDependentDebugger: aModel + ^aModel isDebugger + and: [(aModel interruptedProcess suspendedContext ifNotNil: + [:sctxt| + sctxt findContextSuchThat: + [:ctxt| + (ctxt receiver == cogit + and: [ctxt selector == #simulateCogCodeAt:]) + or: [ctxt receiver == self + and: [ctxt selector == #interpret + or: [ctxt selector == #threadSchedulingLoop:]]]]]) notNil] + + "World submorphs select: [:submorph| self isDependentDebugger: submorph model]"!
Item was added: + ----- Method: CogVMSimulator>>windowIsClosing (in category '*VMMakerUI-InterpreterSimulation-Morphic') ----- + windowIsClosing + self close. + [quitBlock ifNotNil: + [:effectiveQuitBlock| + quitBlock := nil. "stop recursion on explicit window close." + [effectiveQuitBlock value] + on: BlockCannotReturn + do: [:ex|]]] "Cause return from #test, et al" + ensure: + [self threadManager ifNotNil: + [:threadManager| threadManager shutdownModule]]!
Item was added: + ----- Method: InterpreterSimulator>>openAsMorph (in category '*VMMakerUI-InterpreterSimulation-Morphic') ----- + openAsMorph + "Open a morphic view on this simulation." + | window localImageName | + localImageName := imageName + ifNotNil: [self localNameFor: imageName] + ifNil: [' synthetic image']. + window := (SystemWindow labelled: 'Simulation of ' , localImageName) model: self. + + window addMorph: (displayView := ImageMorph new image: displayForm) + frame: (0@0 corner: 1@0.8). + + transcript := TranscriptStream on: (String new: 10000). + window addMorph: (PluggableTextMorph on: transcript text: nil accept: nil + readSelection: nil menu: #codePaneMenu:shifted:) + frame: (0@0.8 corner: 0.7@1). + + window addMorph: (PluggableTextMorph on: self + text: #byteCountText accept: nil) hideScrollBarsIndefinitely + frame: (0.7@0.8 corner: 1@1). + + window openInWorld. + ^window!
Item was added: + ----- Method: StackInterpreter>>closeDependentWindows (in category '*VMMakerUI-user interface') ----- + closeDependentWindows + <doNotGenerate> + World submorphs do: + [:submorph| + (submorph model isVMObjectInspector + and: [submorph model coInterpreter == self]) ifTrue: + [submorph delete]. + (self isDependentDebugger: submorph model) ifTrue: + [submorph model windowIsClosing. + submorph delete]]!
Item was added: + ----- Method: StackInterpreterSimulator>>close (in category '*VMMakerUI-InterpreterSimulation-Morphic') ----- + close "close any files that ST may have opened, etc" + pluginList do: [:assoc| | plugin | plugin := assoc value. plugin ~~ self ifTrue: [plugin close]]. + "Ugh; at least some of this code belongs in the UI..." + displayView ifNotNil: + [displayView activeHand removeEventListener: self]. + ActiveHand removeEventListener: self. + self closeDependentWindows!
Item was added: + ----- Method: StackInterpreterSimulator>>isDependentDebugger: (in category '*VMMakerUI-InterpreterSimulation-Morphic') ----- + isDependentDebugger: aModel + ^aModel isDebugger + and: [(aModel interruptedProcess suspendedContext ifNotNil: + [:sctxt| + sctxt findContextSuchThat: + [:ctxt| + ctxt receiver == self + and: [ctxt selector == #run]]]) notNil]!
Item was added: + ----- Method: StackInterpreterSimulator>>windowIsClosing (in category '*VMMakerUI-InterpreterSimulation-Morphic') ----- + windowIsClosing + self close. + quitBlock ifNotNil: + [:effectiveQuitBlock| + quitBlock := nil. "stop recursion on explicit window close." + [effectiveQuitBlock value] + on: BlockCannotReturn + do: [:ex|]] "Cause return from #test, et al"!
vm-dev@lists.squeakfoundation.org