The Trunk: Tools-dtl.483.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

The Trunk: Tools-dtl.483.mcz

commits-2
David T. Lewis uploaded a new version of Tools to project The Trunk:
http://source.squeak.org/trunk/Tools-dtl.483.mcz

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

Name: Tools-dtl.483
Author: dtl
Time: 9 July 2013, 7:44:32.706 pm
UUID: 342fdefa-8e4e-4bef-9354-90196169ce2d
Ancestors: Tools-fbs.482

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 Tools-fbs.482 ===============

Item was changed:
  ----- Method: Debugger>>debug (in category 'notifier menu') -----
  debug
  "Open a full DebuggerView."
  | topView |
  topView := self topView.
  topView model: nil.  "so close won't release me."
  self breakDependents.
+ self openFullNoSuspendFrom: topView.
+ !
- ToolBuilder default close: topView.
- ^ self openFullNoSuspendLabel: topView label!

Item was added:
+ ----- Method: Debugger>>openFullNoSuspendFrom: (in category 'initialize') -----
+ openFullNoSuspendFrom: topView
+ "Create and schedule a full debugger with the given label. Do not terminate the current active process."
+
+ | oldContextStackIndex |
+ oldContextStackIndex := contextStackIndex.
+ self expandStack. "Sets contextStackIndex to zero."
+ ToolBuilder default openDebugger: self label: topView label closing: topView.
+ self toggleContextStackIndex: oldContextStackIndex.!

Item was changed:
  ----- Method: Debugger>>openNotifierContents:label: (in category 'initialize') -----
  openNotifierContents: msgString label: label
  "Create and schedule a notifier view with the given label and message. A notifier view shows just the message or the first several lines of the stack, with a menu that allows the user to open a full debugger if so desired."
+ "NOTE: When this method returns, a new process has been scheduled to run the windows, and thus this notifier, but the previous active process has not been suspended.  The sender will do this."
- "NOTE: When this method returns, a new process has been scheduled to run the windows, and thus this notifier, but the previous active porcess has not been suspended.  The sender will do this."
  | msg builder spec |
+
  Sensor flushKeyboard.
  savedCursor := Cursor currentCursor.
  Cursor currentCursor: Cursor normal.
  (label beginsWith: 'Space is low')
  ifTrue: [msg := self lowSpaceChoices, (msgString ifNil: [''])]
  ifFalse: [msg := msgString].
  builder := ToolBuilder default.
  spec := self buildNotifierWith: builder label: label message: msg.
  self expandStack.
  builder openDebugger: spec.
+ errorWasInUIProcess := Project current spawnNewProcessIfThisIsUI: interruptedProcess.
- errorWasInUIProcess := Project spawnNewProcessIfThisIsUI: interruptedProcess.
  !

Item was changed:
  ----- Method: Debugger>>resumeProcess: (in category 'private') -----
+ resumeProcess: aTopView
+
+ ^ Project current
+ dispatchTo: self
+ addPrefixAndSend: #ResumeProcess:
+ withArguments: { aTopView }
+ !
- resumeProcess: aTopView
- Smalltalk isMorphic
- ifFalse: [aTopView erase].
- savedCursor
- ifNotNil: [Sensor currentCursor: savedCursor].
- interruptedProcess isTerminated ifFalse: [
- Smalltalk isMorphic
- ifTrue: [errorWasInUIProcess
- ifTrue: [Project resumeProcess: interruptedProcess]
- ifFalse: [interruptedProcess resume]]
- ifFalse: [ScheduledControllers activeControllerNoTerminate: interruptedController andProcess: interruptedProcess]].
- "if old process was terminated, just terminate current one"
- interruptedProcess := nil.
- "Before delete, so release doesn't terminate it"
- Smalltalk isMorphic
- ifTrue: [aTopView delete.
- World displayWorld]
- ifFalse: [aTopView controller closeAndUnscheduleNoErase].
- Smalltalk installLowSpaceWatcher.
- "restart low space handler"
- errorWasInUIProcess == false
- ifFalse: [Processor terminateActive]!