Marcel Taeumel uploaded a new version of ST80 to project The Trunk:
http://source.squeak.org/trunk/ST80-mt.203.mcz ==================== Summary ==================== Name: ST80-mt.203 Author: mt Time: 17 April 2016, 7:56:01.511544 pm UUID: 8e4ab44d-2022-c94c-bfaf-994cf5e8c08e Ancestors: ST80-mt.202 Move interrupt handling and "debug it" to project code. =============== Diff against ST80-mt.202 =============== Item was removed: - ----- Method: ControlManager>>interruptName: (in category 'scheduling') ----- - interruptName: labelString - "Create a Notifier on the active scheduling process with the given label. Make the Notifier the active controller." - - ^ self interruptName: labelString preemptedProcess: activeControllerProcess - ! Item was removed: - ----- Method: ControlManager>>interruptName:preemptedProcess: (in category 'scheduling') ----- - interruptName: labelString preemptedProcess: theInterruptedProcess - "Create a Notifier on the interrupted process with the given label. Make the Notifier the active controller." - - theInterruptedProcess suspend. - - (activeController ~~ nil and: [activeController ~~ screenController]) ifTrue: [ - theInterruptedProcess == activeControllerProcess - ifTrue: [ - "Carefully de-emphasis the current window." - activeController view topView deEmphasizeForDebugger] - ifFalse: [ - activeController controlTerminate]]. - - "This will just scheduleNoTerminate the newly built controller" - Debugger - openInterrupt: labelString - onProcess: theInterruptedProcess. - - self searchForActiveController! Item was added: + ----- Method: MVCProject>>debugMethod:forReceiver:inContext: (in category 'debugging') ----- + debugMethod: aCompiledMethod forReceiver: anObject inContext: aContextOrNil + + | guineaPig debugger debuggerWindow context | + guineaPig := + [aCompiledMethod + valueWithReceiver: anObject + arguments: (aContextOrNil ifNil: [ #() ] ifNotNil: [ { aContextOrNil } ]). + guineaPig := nil "spot the return from aCompiledMethod"] newProcess. + context := guineaPig suspendedContext. + debugger := Debugger new + process: guineaPig + controller: (world inActiveControllerProcess ifTrue: + [world activeController]) + context: context. + debuggerWindow := debugger openFullNoSuspendLabel: 'Debug it'. + "Now step into the expression. But if it is quick (is implemented as a primtiive, e.g. `0') + it will return immediately back to the block that is sent newProcess above. Guard + against that with the check for home being thisContext." + [debugger interruptedContext method == aCompiledMethod] + whileFalse: + [(guineaPig isNil + and: [debugger interruptedContext home == thisContext]) ifTrue: + [debuggerWindow controller closeAndUnschedule. + UIManager default inform: 'Nothing to debug; expression is optimized'. + ^self]. + debugger send]! Item was changed: ----- Method: MVCProject>>interruptName: (in category 'utilities') ----- interruptName: labelString + "Create a Notifier on the active scheduling process with the given label. Make the Notifier the active controller." - "Create a Notifier on the active scheduling process with the given label." + ^ self + interruptName: labelString + preemptedProcess: self uiProcess! - ^ world interruptName: labelString - ! Item was changed: ----- Method: MVCProject>>interruptName:preemptedProcess: (in category 'utilities') ----- interruptName: labelString preemptedProcess: theInterruptedProcess + "Create a Notifier on the interrupted process with the given label. Make the Notifier the active controller." - "Create a Notifier on the active scheduling process with the given label." + theInterruptedProcess suspend. + + (world activeController ~~ nil and: [world activeController ~~ world screenController]) ifTrue: [ + theInterruptedProcess == self uiProcess + ifTrue: [ + "Carefully de-emphasis the current window." + world activeController view topView deEmphasizeForDebugger] + ifFalse: [ + world activeController controlTerminate]]. + + "This will just scheduleNoTerminate the newly built controller" + Debugger + openInterrupt: labelString + onProcess: theInterruptedProcess. + + world searchForActiveController.! - ^ world interruptName: labelString preemptedProcess: theInterruptedProcess - ! |
Free forum by Nabble | Edit this page |