[Pkg] The Trunk: Morphic-dtl.665.mcz

commits at source.squeak.org commits at source.squeak.org
Tue Jul 9 23:41:09 UTC 2013

David T. Lewis uploaded a new version of Morphic to project The Trunk:

==================== Summary ====================

Name: Morphic-dtl.665
Author: dtl
Time: 9 July 2013, 7:39:37.012 pm
UUID: 82d5e6ad-d9e3-461a-8cc9-2c4f42b306a1
Ancestors: Morphic-fbs.664

Fix Debugger in MVC

Changes to Tools, System, ST80, Morphic, and ToolBuilder-Kernel to restore Debugger operation in MVC. Resolves several issues introduced in the Squeak 3.9 time frame. 

Add ToolBuilder>>openDebugger:label:closing: to specify a topLevel to close when transitioning from debug notifier to the debugger. This enables the transition from a debug notifier to the full debug window. MVC closes views and controllers in a rather specific order, and #openDebugger:label: was not sufficient to implement this properly.

Fix some errors in earlier Project refactorings that were causing a debugger in MVC to call a method to restart the (Morphic) UI process when interrupting the UI process. This resulted in two active controller processes running in MVC after resuming from a debugger. The spawnNewProcessIfThisIsUI: method is moved to the instance side of Project and becomes a no-op for an MVC project. Class side methods are retained to protect for possible references from external projects.

=============== Diff against Morphic-fbs.664 ===============

Item was changed:
  ----- Method: Debugger class>>morphicOpenOn:context:label:contents:fullView: (in category '*Morphic-opening') -----
  morphicOpenOn: process context: context label: title contents: contentsStringOrNil fullView: bool
  	"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."
  	| errorWasInUIProcess debugger |
+ 	errorWasInUIProcess := Project current spawnNewProcessIfThisIsUI: process.
- 	errorWasInUIProcess := Project spawnNewProcessIfThisIsUI: process.
  	[Preferences logDebuggerStackToFile
  		ifTrue: [Smalltalk logSqueakError: title inContext: context]] on: Error do: [:ex | ex return: nil].
  	WorldState addDeferredUIMessage: [ 
  		"schedule debugger in deferred UI message to address redraw
  		problems after opening a debugger e.g. from the testrunner."
  			debugger := self new process: process controller: nil context: context.
  				ifTrue: [debugger openFullNoSuspendLabel: title]
  				ifFalse: [debugger openNotifierContents: contentsStringOrNil label: title].
  			debugger errorWasInUIProcess: errorWasInUIProcess.
  		] on: Error do: [:ex |
  				self primitiveError: 
  					'Original error: ', 
  					title asString, '.
  	Debugger error: ', 
  				([ex description] on: Error do: ['a ', ex class printString]), ':'
  	process suspend.

Item was added:
+ ----- Method: Debugger>>morphicResumeProcess: (in category '*Morphic-opening') -----
+ morphicResumeProcess: aTopView 
+ 	savedCursor
+ 		ifNotNil: [Sensor currentCursor: savedCursor].
+ 	interruptedProcess isTerminated ifFalse: [
+ 		errorWasInUIProcess
+ 					ifTrue: [Project resumeProcess: interruptedProcess]
+ 					ifFalse: [interruptedProcess resume]].
+ 	"if old process was terminated, just terminate current one"
+ 	interruptedProcess := nil. "Before delete, so release doesn't terminate it"
+ 	aTopView delete.
+ 	World displayWorld.
+ 	Smalltalk installLowSpaceWatcher. "restart low space handler"
+ 	errorWasInUIProcess == false
+ 		ifFalse: [Processor terminateActive]!

Item was added:
+ ----- Method: MorphicProject>>spawnNewProcess (in category 'active process') -----
+ spawnNewProcess
+ 	UIProcess := [
+ 		[World doOneCycle.  Processor yield ] repeat.
+ 	] newProcess priority: Processor userSchedulingPriority.
+ 	UIProcess resume!

Item was added:
+ ----- Method: MorphicProject>>spawnNewProcessIfThisIsUI: (in category 'active process') -----
+ spawnNewProcessIfThisIsUI: suspendedProcess
+ 	"Initialize a UI process if needed. Answer true if suspendedProcess was interrupted
+ 	from a UI process."
+ 	UIProcess == suspendedProcess ifTrue: [
+ 		self spawnNewProcess.
+ 		^true
+ 	].
+ 	^false		"no new process was created"
+ !

Item was changed:
  ----- Method: SyntaxError class>>morphicOpen: (in category '*Morphic-Support') -----
  morphicOpen: aSyntaxError
  	"Answer a view whose model is an instance of me."
  	self buildMorphicViewOn: aSyntaxError.
+ 	Project current spawnNewProcessIfThisIsUI: Processor activeProcess.
- 	Project spawnNewProcessIfThisIsUI: Processor activeProcess.
  	^ Processor activeProcess suspend!

More information about the Packages mailing list