[squeak-dev] The Trunk: Tools-mt.1164.mcz

commits at source.squeak.org commits at source.squeak.org
Tue Jun 21 10:11:47 UTC 2022


Marcel Taeumel uploaded a new version of Tools to project The Trunk:
http://source.squeak.org/trunk/Tools-mt.1164.mcz

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

Name: Tools-mt.1164
Author: mt
Time: 21 June 2022, 12:11:44.074865 pm
UUID: d9b06d00-9ac3-6445-be0f-9951d54a20ff
Ancestors: Tools-mt.1163

Tweak the debugger UI a little bit wrt. the new #terminate vs. #terminateAggressively semantics. Note that the current #terminateAggressively is the former #terminate while the current #terminate will allow the active unwind context to complete.

Use preferences to tweak the close button and the notifier-debugger buttons. Use the window menu to always choose between "abandon" (i.e., #terminateAggressively) and "terminate".

The defaults are so that both GUI and semantics remain compatible with Squeak 5.3:

[x] #closeMeansAbandon
[x] #showAbandonButton
[ ] #showTerminateButton

=============== Diff against Tools-mt.1163 ===============

Item was changed:
  CodeHolder subclass: #Debugger
  	instanceVariableNames: 'interruptedProcess contextStack contextStackIndex contextStackList receiverInspector receiverInspectorState contextVariablesInspector contextVariablesInspectorState externalInterrupt proceedValue selectingPC savedCursor isolationHead failedProject labelString message untilExpression terminateProcessSelector'
+ 	classVariableNames: 'CloseMeansAbandon ContextStackKeystrokes ErrorReportServer FullStackSize InterruptUIProcessIfBlockedOnErrorInBackgroundProcess NotifierStackSize SavedExtent ShowAbandonButton ShowTerminateButton StackSizeLimit WantsAnnotationPane'
- 	classVariableNames: 'ContextStackKeystrokes ErrorReportServer FullStackSize InterruptUIProcessIfBlockedOnErrorInBackgroundProcess NotifierStackSize SavedExtent StackSizeLimit WantsAnnotationPane'
  	poolDictionaries: ''
  	category: 'Tools-Debugger'!
  
  !Debugger commentStamp: 'mt 12/17/2019 12:19' 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. 
  
  ---
  
  In September 2019, we added MorphicDebugger and MVCDebugger to untangle framework-specific features in our debugger infrastructure. However, this is just an intermediate step. The overall goal would be to remove those two subclasses again while preserving their functionality. Mostly, MVC and Morphic differ in their GUI-process management. This means that "proceed" and "close" work differently depending on the process that is being debugged. --- One idea is to attach that framework-specific information to the process objects. See Process >> #environmentAt: and #environmentAt:put:. Also see ToolSet's #handle* and #debug* methods.!

Item was added:
+ ----- Method: Debugger class>>closeMeansAbandon (in category 'preferences') -----
+ closeMeansAbandon
+ 	<preference: 'Terminate aggressively on window closed'
+ 		categoryList: #(debug tools)
+ 		description: 'When enabled, closing the window of a full or notifier debugger will terminate the process aggressively, which means that the active unwind context (i.e., ensure-block) will not be completed. Not-yet-started unwind contexts are allowed to start and complete.'
+ 		type: #Boolean>
+ 		
+ 	^ CloseMeansAbandon ifNil: [true]!

Item was added:
+ ----- Method: Debugger class>>closeMeansAbandon: (in category 'preferences') -----
+ closeMeansAbandon: aBooleanOrNil
+ 		
+ 	CloseMeansAbandon := aBooleanOrNil.!

Item was added:
+ ----- Method: Debugger class>>showAbandonButton (in category 'preferences') -----
+ showAbandonButton
+ 	<preference: 'Show ''Abandon'' button in notifier debugger'
+ 		categoryList: #(debug tools)
+ 		description: 'An extra button in the notifier window that allows the user to terminate the process aggressively, which means that the active unwind context (i.e., ensure-block) will not be completed. Not-yet-started unwind contexts are allowed to start and complete.'
+ 		type: #Boolean>
+ 		
+ 	^ ShowAbandonButton ifNil: [true]!

Item was added:
+ ----- Method: Debugger class>>showAbandonButton: (in category 'preferences') -----
+ showAbandonButton: aBooleanOrNil
+ 
+ 	ShowAbandonButton := aBooleanOrNil.!

Item was added:
+ ----- Method: Debugger class>>showTerminateButton (in category 'preferences') -----
+ showTerminateButton
+ 	<preference: 'Show ''Terminate'' button in notifier debugger'
+ 		categoryList: #(debug tools)
+ 		description: 'An extra button in the notifier window that allows the user to terminate the process while allowing the active context (i.e., ensure-block) to unwind first.'
+ 		type: #Boolean>
+ 		
+ 	^ ShowTerminateButton ifNil: [false]!

Item was added:
+ ----- Method: Debugger class>>showTerminateButton: (in category 'preferences') -----
+ showTerminateButton: aBooleanOrNil
+ 
+ 	ShowTerminateButton := aBooleanOrNil.!

Item was changed:
  ----- Method: Debugger>>addModelItemsToWindowMenu: (in category 'misc') -----
  addModelItemsToWindowMenu: aMenu
  
  	super addModelItemsToWindowMenu: aMenu.
  	
  	aMenu addLine.
  	aMenu
  		add: 'inspect process' translated target: self interruptedProcess action: #inspect;
  		add: 'explore process' translated target: self interruptedProcess action: #explore;
+ 		addLine;
  		add: 'terminate process' translated target: self action: #terminateProcess;
+ 		balloonTextForLastItem: 'Terminates this process while allowing the active context to unwind first. Unlike ''abandon,'' even a currently active ensure-block will be allowed to finish.' translated;
+ 		add: 'abandon process' translated target: self action: #abandon;
+ 		balloonTextForLastItem: 'Terminates this process <b>aggressively</b>, still allowing not-yet-started unwind contexts to start and complete. Unlike ''terminate,'' a currently active ensure-block will be discarded. ' translated asTextFromHtml.!
- 		balloonTextForLastItem: 'other than Abandon, this will allow the active context to unwind first.' translated.!

Item was changed:
  ----- Method: Debugger>>initialize (in category 'initialize') -----
  initialize
  
  	super initialize.
  
  	Smalltalk at: #MessageTally ifPresentAndInMemory: [ :tally |
  		tally terminateTimerProcess].
  
  	externalInterrupt := false.
  	selectingPC := true.
  	
  	contextStackIndex := 0.
  	
+ 	"The default termination procedure is aggressive to ignore currently running, and thus erroneous, ensure-blocks in the debugged process. The preference can change that."
+ 	terminateProcessSelector := self class closeMeansAbandon
+ 		ifTrue: [#terminateAggressively]
+ 		ifFalse:[#terminate].!
- 	"The default termination procedure is aggressive to ignore currently running, and thus erroneous, ensure-blocks in the debugged process."
- 	terminateProcessSelector := #terminateAggressively.!

Item was changed:
  ----- Method: Debugger>>preDebugButtonQuads (in category 'initialize') -----
  preDebugButtonQuads
  
  	^Preferences eToyFriendly
  		ifTrue: [
  	{
  	{'Send error report' translated.	#sendReport. 	#blue. 	'send a report of the encountered problem to the Squeak developers' translated}.
  	{'Abandon' translated.	#abandon. 	#black.	'abandon this execution by closing this window' translated}.
  	{'Debug'	 translated.		#debug. 	#red. 	'bring up a debugger' translated}}]
  		ifFalse: [
  	{
  	{'Proceed' translated.	#proceed. 	#blue. 	'continue execution' translated. #interruptedProcessShouldResume}.
+ 	self class showTerminateButton ifTrue: [
+ 		{'Terminate' translated.	#terminateProcess. 	#black.	'terminate this execution and close this window' translated}].
+ 	self class showAbandonButton ifTrue: [
+ 		{'Abandon' translated.	#abandon. 	#black.	'terminate this execution aggressively and close this window' translated}].
+ 	{'Debug'	 translated.		#debug.		#red. 	'bring up a debugger' translated}}
+ 		reject: [:quad | quad isNil] ]
- 	{'Abandon' translated.	#abandon. 	#black.	'abandon this execution by closing this window' translated}.
- 	{'Debug'	 translated.		#debug.		#red. 	'bring up a debugger' translated}}]
  !



More information about the Squeak-dev mailing list