The Trunk: Tools-dtl.269.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.269.mcz

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

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

Name: Tools-dtl.269
Author: dtl
Time: 12 September 2010, 3:41:47.258 pm
UUID: 041a5a4b-3607-49e8-9bb5-7f1273c081a1
Ancestors: Tools-eem.268

MVC fixes by Florin Mateoc to address debugger opening, including low space interrupt and user interrupt in MVC.

=============== Diff against Tools-eem.268 ===============

Item was changed:
  ----- Method: Debugger class>>openOn:context:label:contents:fullView: (in category 'opening') -----
  openOn: 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."
 
+ | controller errorWasInUIProcess debugger |
- | controller errorWasInUIProcess block |
  Smalltalk isMorphic
  ifTrue: [errorWasInUIProcess := Project spawnNewProcessIfThisIsUI: process]
+ ifFalse: [
+ controller := ScheduledControllers activeControllerProcess == process
+ ifTrue: [ScheduledControllers activeController].
+ [
- ifFalse: [controller := ScheduledControllers activeControllerProcess == process
- ifTrue: [ScheduledControllers activeController]].
- block := [
- [ | debugger |
-
  debugger := self new process: process controller: controller context: context.
+ bool
+ ifTrue: [debugger openFullNoSuspendLabel: title]
+ ifFalse: [debugger openNotifierContents: contentsStringOrNil label: title].
+ Preferences logDebuggerStackToFile ifTrue: [
+ Smalltalk logError: title inContext: context to: 'SqueakDebug.log'].
+ ] on: Error do: [:ex |
+ self primitiveError:
+ 'Orginal error: ',
+ title asString, '.
+ Debugger error: ',
+ ([ex description] on: Error do: ['a ', ex class printString]), ':'
+ ]].
+ 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.
+ bool
+ ifTrue: [debugger openFullNoSuspendLabel: title]
+ ifFalse: [debugger openNotifierContents: contentsStringOrNil label: title].
- Smalltalk isMorphic
- ifTrue: ["schedule debugger in deferred UI message to address redraw
- problems after opening a debugger e.g. from the testrunner."
- "WorldState addDeferredUIMessage: ["bool
- ifTrue: [debugger openFullNoSuspendLabel: title]
- ifFalse: [debugger openNotifierContents: contentsStringOrNil label: title]]
- ifFalse: ["deferred UI message would require special controller in MVC"
- bool
- ifTrue: [debugger openFullNoSuspendLabel: title]
- ifFalse: [debugger openNotifierContents: contentsStringOrNil label: title]].
  debugger errorWasInUIProcess: errorWasInUIProcess.
  Preferences logDebuggerStackToFile ifTrue: [
  Smalltalk logError: title inContext: context to: 'SqueakDebug.log'].
- Smalltalk isMorphic
- ifFalse: [ScheduledControllers searchForActiveController "needed since openNoTerminate (see debugger #open...) does not set up activeControllerProcess if activeProcess (this fork) is not the current activeControllerProcess (see #scheduled:from:)"].
  ] on: Error do: [:ex |
  self primitiveError:
  'Orginal error: ',
  title asString, '.
  Debugger error: ',
  ([ex description] on: Error do: ['a ', ex class printString]), ':'
  ]
  ].
+ process suspend.
+ !
- self ifPreferredInterruptUIProcessIfBlocked: errorWasInUIProcess.
- Project current addDeferredUIMessage: block.
- process suspend!

Item was changed:
  ----- Method: Debugger>>openFullNoSuspendLabel: (in category 'initialize') -----
  openFullNoSuspendLabel: aString
  "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: aString.
- ToolBuilder open: self label: aString.
  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 porcess has not been suspended.  The sender will do this."
  | msg builder spec |
  Sensor flushKeyboard.
  savedCursor := Sensor currentCursor.
  Sensor 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.
- builder open: spec.
  errorWasInUIProcess := Project spawnNewProcessIfThisIsUI: interruptedProcess.
  !