Levente Uzonyi uploaded a new version of 61Deprecated to project The Trunk: http://source.squeak.org/trunk/61Deprecated-ul.10.mcz
==================== Summary ====================
Name: 61Deprecated-ul.10 Author: ul Time: 7 October 2023, 10:31:14.012496 am UUID: 13110127-70a1-43b6-b291-29dbd27133b2 Ancestors: 61Deprecated-ul.9
Some methods of MVCDebugger and MorphicDebugger are not in the 61Deprecated monticello package even though the classes are in the 61Deprecated category. This is an attempt to fix that. Move to trunk if it works for you as well.
=============== Diff against 61Deprecated-ul.9 ===============
Item was added: + ----- Method: MVCDebugger class>>openOn:context:label:contents:fullView: (in category 'opening') ----- + openOn: processToDebug context: context label: title contents: contentsStringOrNil fullView: full + "Open a notifier in response to an error, halt, or notify. A notifier view just shows a short view of the sender stack and provides a menu that lets the user open a full debugger." + + | debugger cm ac acp wasActive | + cm := Project current world. "controller manager" + ac := cm activeController. + acp := cm activeControllerProcess. "the ui process" + wasActive := cm inActiveControllerProcess. + + debugger := self new + process: processToDebug + "Keep track of the controller if it matches." + controller: (acp == processToDebug ifTrue: [ac]) + context: context. + + full + ifTrue: [debugger openFullNoSuspendLabel: title] + ifFalse: [debugger openNotifierNoSuspendContents: contentsStringOrNil label: title]. + + "Try drawing the debugger tool at least once to avoid freeze." + Project current restoreDisplay. + + "If we are in a helper process, #openNoTerminate WILL NOT activate the debugger's controller. Example: user-interrupt request (cmd+dot)." + (acp == processToDebug and: [wasActive not]) + ifTrue: [ [cm searchForActiveController] fork ]. + + "Be sure to suspend the process we want to debug now." + processToDebug suspend. + + "If we are NOT in a helper process, #openNoTerminate WILL NOT terminate the active controller's process." + (acp ~~ processToDebug and: [wasActive]) + ifTrue: [ Processor terminateActive ]. + + "Get here only if active process is not the process-to-debug. Use helper process if you want to access this return value." + ^ debugger!
Item was added: + ----- Method: MVCDebugger>>context: (in category 'initialize') ----- + context: aContext + + self + process: Processor activeProcess + controller: (ScheduledControllers inActiveControllerProcess + ifTrue: [ScheduledControllers activeController]) + context: aContext.!
Item was added: + ----- Method: MVCDebugger>>openFullFromNotifier: (in category 'initialize') ----- + openFullFromNotifier: notifierView + "Create, schedule and answer a full debugger with the given label. Do not terminate the current active process." + + | fullView | + super openFullFromNotifier: notifierView. + + fullView := ToolBuilder default build: self. + fullView label: notifierView label. "Keep the label." + fullView controller openNoTerminate. + + notifierView controller closeAndUnscheduleNoTerminate. + Processor terminateActive.!
Item was added: + ----- Method: MVCDebugger>>openFullNoSuspendLabel: (in category 'initialize') ----- + openFullNoSuspendLabel: aString + "Create, schedule and answer a full debugger with the given label. Do not terminate the current active process." + + | fullView | + super openFullNoSuspendLabel: aString. + + fullView := ToolBuilder default build: self. + fullView label: aString. + fullView controller openNoTerminate. + + ^ fullView!
Item was added: + ----- Method: MVCDebugger>>openNotifierNoSuspendContents:label: (in category 'initialize') ----- + openNotifierNoSuspendContents: msgString label: label + + | builder spec view | + EventSensor default flushEvents. + super openNotifierNoSuspendContents: msgString label: label. + + builder := ToolBuilder default. + spec := self buildNotifierWith: builder label: label message: msgString. + + view := builder build: spec. + view controller openNoTerminate. + + ^ view!
Item was added: + ----- Method: MVCDebugger>>process:controller:context: (in category 'initialize') ----- + process: aProcess controller: aController context: aContext + + self process: aProcess context: aContext. + + interruptedController := aController.!
Item was added: + ----- Method: MVCDebugger>>resumeProcess: (in category 'private') ----- + resumeProcess: processToResume + "Finally free the reference to the controller if any. We cannot do this in #windowIsClosing." + + | controllerToReschedule | + controllerToReschedule := interruptedController. + interruptedController := nil. + + ScheduledControllers + activeController: controllerToReschedule + andProcess: processToResume.!
Item was added: + ----- Method: MorphicDebugger class>>openOn:context:label:contents:fullView: (in category 'opening') ----- + openOn: processToDebug context: context label: title contents: contentsStringOrNil fullView: full + + | debugger uiBlock | + debugger := self new + process: processToDebug context: context; + errorWasInUIProcess: (Project current spawnNewProcessIfThisIsUI: processToDebug). + + uiBlock := [ + full + ifTrue: [debugger openFullNoSuspendLabel: title] + ifFalse: [debugger openNotifierNoSuspendContents: contentsStringOrNil label: title]. + + "Try layouting the debugger tool at least once to avoid freeze." + debugger topView ifNotNil: [:window | + "There are way too many #fullBounds sends. Layout errors might already have happened." + window allMorphsDo: [:m | (m hasProperty: #errorOnLayout) ifTrue: [self error: 'Layout error']]. + window world doLayout. "Not safely!!"]. + "Try drawing the debugger tool at least once to avoid freeze." + debugger topView ifNotNil: [:window | window world displayWorld. "Not safely!!"]. + ]. + + "Schedule debugging in a deferred UI message if necessary. Note that only the ui process should execute ui code." + (Project current uiProcess isActiveProcess not or: [processToDebug isActiveProcess]) + ifFalse: uiBlock + ifTrue: [ | event | + self flag: #discuss. "mt: We need to preserve the currentEvent for #openToolsAttachedToMouseCursor ..." + event := self currentEvent. + Project current addDeferredUIMessage: [event becomeActiveDuring: uiBlock]]. + + processToDebug suspend. + + "Get here only if active process is not the process-to-debug. So in tests, use a helper process if you want to access this return value." + ^ debugger!
Item was added: + ----- Method: MorphicDebugger>>openFullFromNotifier: (in category 'initialize') ----- + openFullFromNotifier: notifierWindow + "Create, schedule and answer a full debugger with the given label. Do not terminate the current active process." + + super openFullFromNotifier: notifierWindow. + + notifierWindow delete. + + ^ ToolBuilder default + open: self + label: notifierWindow label!
Item was added: + ----- Method: MorphicDebugger>>openFullNoSuspendLabel: (in category 'initialize') ----- + openFullNoSuspendLabel: aString + "Create, schedule and answer a full debugger with the given label. Do not terminate the current active process." + + super openFullNoSuspendLabel: aString. + + ^ ToolBuilder default + open: self + label: aString!
Item was added: + ----- Method: MorphicDebugger>>openNotifierNoSuspendContents:label: (in category 'initialize') ----- + openNotifierNoSuspendContents: msgString label: label + + | builder spec | + super openNotifierNoSuspendContents: msgString label: label. + + builder := ToolBuilder default. + spec := self buildNotifierWith: builder label: label message: msgString. + + ^ ToolBuilder default open: spec!
Item was added: + ----- Method: MorphicDebugger>>resumeProcess: (in category 'private') ----- + resumeProcess: processToResume + + processToResume isTerminated ifFalse: [ + errorWasInUIProcess ifTrue: [Project current uiProcess: processToResume]. + processToResume resume. + errorWasInUIProcess ifTrue: [Processor terminateActive]].!
Item was added: + ----- Method: MorphicDebugger>>windowIsClosing (in category 'initialize') ----- + windowIsClosing + "Keep track of last debugger extent." + + interruptedProcess ifNil: [ ^ self ]. + + SavedExtent ifNotNil: + [ self dependents + detect: + [ : each | each isWindowForModel: self ] + ifFound: + [ : topWindow | | isDebuggerNotNotifier | + isDebuggerNotNotifier := self dependents anySatisfy: + [ : each | each isTextView ]. + isDebuggerNotNotifier ifTrue: [ + SavedExtent := (topWindow extent / RealEstateAgent scaleFactor) rounded ] ] + ifNone: [ "do nothing" ] ]. + + super windowIsClosing.!
packages@lists.squeakfoundation.org