[Pkg] The Trunk: Tools-nice.296.mcz

commits at source.squeak.org commits at source.squeak.org
Sun Feb 13 21:35:00 UTC 2011

Nicolas Cellier uploaded a new version of Tools to project The Trunk:

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

Name: Tools-nice.296
Author: nice
Time: 13 February 2011, 10:34:34.399 pm
UUID: e8b319a7-5570-4272-a021-30f64f318dd6
Ancestors: Tools-mtf.295, Tools-fbs.286

Merge fbs.286

Remove the contextStackTop instvar in Debugger, replacing its calls with an indirection through "self contextStackTop", which just calls the top/first element of contextStack.

=============== Diff against Tools-mtf.295 ===============

Item was changed:
  CodeHolder subclass: #Debugger
+ 	instanceVariableNames: 'interruptedProcess interruptedController contextStack contextStackIndex contextStackList receiverInspector contextVariablesInspector externalInterrupt proceedValue selectingPC savedCursor isolationHead failedProject errorWasInUIProcess labelString message'
- 	instanceVariableNames: 'interruptedProcess interruptedController contextStack contextStackTop contextStackIndex contextStackList receiverInspector contextVariablesInspector externalInterrupt proceedValue selectingPC savedCursor isolationHead failedProject errorWasInUIProcess labelString message'
  	classVariableNames: 'ContextStackKeystrokes ErrorRecursion InterruptUIProcessIfBlockedOnErrorInBackgroundProcess'
  	poolDictionaries: ''
  	category: 'Tools-Debugger'!
  !Debugger commentStamp: '<historical>' prior: 0!
  I represent the machine state at the time of an interrupted process. I also represent a query path into the state of the process. The debugger is typically viewed through a window that views the stack of suspended contexts, the code for, and execution point in, the currently selected message, and inspectors on both the receiver of the currently selected message, and the variables in the current context.
  Special note on recursive errors:
  Some errors affect Squeak's ability to present a debugger.  This is normally an unrecoverable situation.  However, if such an error occurs in an isolation layer, Squeak will attempt to exit from the isolation layer and then present a debugger.  Here is the chain of events in such a recovery.
  	* A recursive error is detected.
  	* The current project is queried for an isolationHead
  	* Changes in the isolationHead are revoked
  	* The parent project of isolated project is returned to
  	* The debugger is opened there and execution resumes.
  If the user closes that debugger, execution continues in the outer project and layer.  If, after repairing some damage, the user proceeds from the debugger, then the isolationHead is re-invoked, the failed project is re-entered, and execution resumes in that world. !

Item was added:
+ ----- Method: Debugger>>contextStackTop (in category 'accessing') -----
+ contextStackTop
+ 	^ contextStack first.!

Item was changed:
  ----- Method: Debugger>>createMethod (in category 'private') -----
  	"Should only be called when this Debugger was created in response to a
  	MessageNotUnderstood exception. Create a stub for the method that was
  	missing and proceed into it."
  	| msg chosenClass |
+ 	msg := self contextStackTop tempAt: 1.
- 	msg := contextStackTop tempAt: 1.
  	chosenClass := self
+ 		askForSuperclassOf: self contextStackTop receiver class
- 		askForSuperclassOf: contextStackTop receiver class
  		toImplement: msg selector
  		ifCancel: [^self].
  	self implement: msg inClass: chosenClass.

Item was changed:
  ----- Method: Debugger>>expandStack (in category 'context stack (message list)') -----
  	"A Notifier is being turned into a full debugger.  Show a substantial amount of stack in the context pane."
+ 	self newStack: (self contextStackTop stackOfSize: 20).
- 	self newStack: (contextStackTop stackOfSize: 20).
  	contextStackIndex := 0.
  	receiverInspector := Inspector inspect: nil.
  	contextVariablesInspector := ContextVariablesInspector inspect: nil.
  	proceedValue := nil!

Item was changed:
  ----- Method: Debugger>>fullyExpandStack (in category 'context stack (message list)') -----
  	"Expand the stack to include all of it, rather than the first four or five contexts.
  	Well, almost all of it, we better maintain sane limits too."
  	self okToChange ifFalse: [^ self].
+ 	self newStack: (self contextStackTop stackOfSize: contextStack size + 100000).
- 	self newStack: (contextStackTop stackOfSize: contextStack size + 100000).
  	self changed: #contextStackList!

Item was changed:
  ----- Method: Debugger>>interruptedContext (in category 'accessing') -----
  	"Answer the suspended context of the interrupted process."
+ 	^self contextStackTop.!
- 	^contextStackTop!

Item was changed:
  ----- Method: Debugger>>process:controller:context: (in category 'private') -----
  process: aProcess controller: aController context: aContext
  	super initialize.
  	Smalltalk at: #MessageTally ifPresentAndInMemory: [ :tally |
  		tally terminateTimerProcess].
  	contents := nil. 
  	interruptedProcess := aProcess.
  	interruptedController := aController.
+ 	self newStack: (aContext stackOfSize: 1).
- 	contextStackTop := aContext.
- 	self newStack: (contextStackTop stackOfSize: 1).
  	contextStackIndex := 1.
  	externalInterrupt := false.
  	selectingPC := true.
  	Smalltalk isMorphic ifTrue:
  		[errorWasInUIProcess := false]!

Item was changed:
  ----- Method: Debugger>>resetContext: (in category 'private') -----
  resetContext: aContext 
  	"Used when a new context becomes top-of-stack, for instance when the
  	method of the selected context is re-compiled, or the simulator steps or
  	returns to a new method. There is room for much optimization here, first
  	to save recomputing the whole stack list (and text), and secondly to avoid
  	recomposing all that text (by editing the paragraph instead of recreating it)."
  	| oldContext |
  	oldContext := self selectedContext.
+ 	self newStack: aContext contextStack.
- 	contextStackTop := aContext.
- 	self newStack: contextStackTop contextStack.
  	self changed: #contextStackList.
  	self contextStackIndex: 1 oldContextWas: oldContext.
  	self contentsChanged.

Item was changed:
  ----- Method: Debugger>>selectedContext (in category 'private') -----
  	contextStackIndex = 0
+ 		ifTrue: [^contextStack first]
- 		ifTrue: [^contextStackTop]
  		ifFalse: [^contextStack at: contextStackIndex]!

Item was changed:
  ----- Method: Debugger>>storeLog (in category 'notifier menu') -----
+ 	Smalltalk logSqueakError: labelString printString inContext: self contextStackTop
- 	Smalltalk logSqueakError: labelString printString inContext: contextStackTop

Item was changed:
  ----- Method: Debugger>>windowIsClosing (in category 'initialize') -----
  	"My window is being closed; clean up. Restart the low space watcher."
  	interruptedProcess == nil ifTrue: [^ self].
  	interruptedProcess terminate.
  	interruptedProcess := nil.
  	interruptedController := nil.
  	contextStack := nil.
- 	contextStackTop := nil.
  	receiverInspector := nil.
  	contextVariablesInspector := nil.
  	Smalltalk installLowSpaceWatcher.  "restart low space handler"

More information about the Packages mailing list