[squeak-dev] The Inbox: System-dtl.982.mcz

commits at source.squeak.org commits at source.squeak.org
Sat Dec 9 16:05:09 UTC 2017

David T. Lewis uploaded a new version of System to project The Inbox:

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

Name: System-dtl.982
Author: dtl
Time: 9 December 2017, 11:04:54.881758 am
UUID: c8f8b473-6da3-4e75-953f-62ba8d05fcf7
Ancestors: System-dtl.981

When entering a project for emergency evaluation, let the resulting debugger display the name of the project from which the failure originated.

Set a guard flag to prevent recursion when entering projects for emergency evaluation. For example, if a failure occurs in a Morphic project, and an MVC project has been entered for emergency evaluation, then subsequent error handling (if needed) will drop into the traditional emergency evaluator.

=============== Diff against System-dtl.981 ===============

Item was changed:
  Model subclass: #Project
  	instanceVariableNames: 'world uiManager changeSet transcript parentProject previousProject displayDepth viewSize thumbnail nextProject projectParameters version urlList lastDirectory lastSavedAtSeconds projectPreferenceFlagDictionary resourceManager'
+ 	classVariableNames: 'AllProjects CurrentProject EmergencyRecoveryRequested GoalFreePercent GoalNotMoreThan'
- 	classVariableNames: 'AllProjects CurrentProject GoalFreePercent GoalNotMoreThan'
  	poolDictionaries: ''
  	category: 'System-Support'!
  !Project commentStamp: 'cbr 7/27/2010 21:36' prior: 0!
  A Project stores the state of a complete Squeak desktop, including
  the windows, and the currently active changeSet.  A project knows who
  its parent project is.  When you change projects, whether by entering
  or exiting, the screen state of the project being exited is saved in
  that project.
  A project is retained by its view in the parent world.  It is
  effectively named by the name of its changeSet, which can be changed
  either by renaming in a changeSorter, or by editing the label of its
  view from the parent project.
  As the site of major context switch, Projects are the locus of
  swapping between the old MVC and the new Morphic worlds.  The
  distinction is based on whether the variable 'world' contains a
  WorldMorph or a ControlManager.
  Saving and Loading
  Projects may be stored on the disk in external format.  (Project
  named: 'xxx') exportSegment, or choose 'store project on file...'.
  Projects may be loaded from a server and stored back.  Storing on a
  server never overwrites;  it always makes a new version.  A project
  remembers the url of where it lives in urlList.  The list is length
  one, for now.  The url may point to a local disk instead of a server.
  All projects that the user looks at are cached in the Squeaklet
  folder.  Sorted by server.  The cache holds the most recent version
  When a project is loaded into Squeak, its objects are converted to
  the current version.  There are three levels of conversion.  First,
  each object is converted from raw bits to an object in its old
  format.  Then it is sent some or all of these messages:
  	comeFullyUpOnReload: smartRefStream  		Used to
  re-discover an object that already exists in this image, such as a
  resource, global variable, Character, or Symbol.  (sent to objects in
  	convertToCurrentVersion: varDict refStream: smartRefStrm
  		fill in fields that have been added to a class since
  the object was stored.  Used to set the extra inst var to a default
  value.  Or, return a new object of a different class.  (sent to
  objects that changed instance variables)
  	fixUponLoad: aProject refStream: smartRefStrm
  	change the object due to conventions that have changed on the
  project level.  (sent to all objects in the incoming project)
  Here is the calling sequence for storing out a Project:
  Project saveAs
  Project storeOnServer
  Project storeOnServerWithProgressInfo
  Project storeOnServerInnards
  Project exportSegmentFileName:directory:
  Project exportSegmentWithChangeSet:fileName:directory:
  ImageSegment writeForExportWithSources:inDirectory:changeSet:

Item was changed:
  ----- Method: Project>>enterForEmergencyRecovery (in category 'enter - recovery') -----
  	"Stripped down verion of #enter:revert:saveForRevert:. More error handling. Less features."
+ 	| leavingProject process titleForDebuggerWindow |
- 	| leavingProject process |
  	self isCurrentProject ifTrue: [^ self].
+ 	EmergencyRecoveryRequested == true ifTrue: [^ self].
+ 	EmergencyRecoveryRequested := true.
+ 	titleForDebuggerWindow := 'FATAL PROJECT ERROR: Project was ''', CurrentProject name, ''''.
  	ProjectHistory remember: CurrentProject.
  	nextProject := CurrentProject.
  	[ CurrentProject world triggerEvent: #aboutToLeaveWorld.
  	CurrentProject abortResourceLoading.
  	CurrentProject finalExitActions: self.
  	CurrentProject saveState ] on: Error do: [:ex | "Ignore." ].
  	"********** SWITCHING CURRENT PROJECT **********"
  	leavingProject := CurrentProject.
  	CurrentProject := self.
  	ProjectHistory remember: self.
  	"********** SWITCHING CURRENT PROJECT **********"
  	self loadState.
  	self finalEnterActions: leavingProject.
  	self addDeferredUIMessage: [self startResourceLoading].
  	self world triggerEvent: #aboutToEnterWorld.
  	"Now that everything is set up, we can show zoom animation.
  	Do we really need this in case of an emergency?"
  	self showZoom
  		ifTrue: [self displayZoom: leavingProject parent ~~ self "Entering?"]
  		ifFalse: [self restore].
  	"Update processes at last."
  	self scheduleProcessForEnter.
  	"Do not terminate but suspend the projects ui process to support debugging."
  	process := leavingProject uiProcess.
+ 	self addDeferredUIMessage: [process debugWithTitle: titleForDebuggerWindow].
- 	self addDeferredUIMessage: [process debugWithTitle: 'FATAL PROJECT ERROR!!'].
  	leavingProject suspendProcessForDebug.!

Item was changed:
  ----- Method: Project>>finalExitActions: (in category 'enter') -----
  finalExitActions: enteringProject
+ 	EmergencyRecoveryRequested := false. "clear fence variable if previously set due to error"
+ !
- 	SoundService stop.!

More information about the Squeak-dev mailing list