The Inbox: Tools-eem.986.mcz

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

The Inbox: Tools-eem.986.mcz

commits-2
A new version of Tools was added to project The Inbox:
http://source.squeak.org/inbox/Tools-eem.986.mcz

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

Name: Tools-eem.986
Author: eem
Time: 19 September 2020, 1:35:34.572026 pm
UUID: b33a2312-24e5-4cfa-a4e3-7f409ce8f5d4
Ancestors: Tools-ct.985

Use the lastDeferredUIMessage mechanism for avoiding updating the debugger UI too frequently.  Alas this only solves the run to here case; it doesn't fix the rapid clicking issue.  Hence this is in the inbox.  Christoph, this may be useful to you.

=============== Diff against Tools-ct.985 ===============

Item was changed:
  CodeHolder subclass: #Debugger
+ instanceVariableNames: 'interruptedProcess contextStack contextStackIndex contextStackList receiverInspector receiverInspectorState contextVariablesInspector contextVariablesInspectorState externalInterrupt proceedValue selectingPC savedCursor isolationHead failedProject labelString message untilExpression uiUpdateBlock'
- instanceVariableNames: 'interruptedProcess contextStack contextStackIndex contextStackList receiverInspector receiverInspectorState contextVariablesInspector contextVariablesInspectorState externalInterrupt proceedValue selectingPC savedCursor isolationHead failedProject labelString message untilExpression'
  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 changed:
  ----- Method: Debugger>>doStep (in category 'context stack menu') -----
  doStep
  "Send the selected message in the accessed method, and regain control
  after the invoked method returns."
 
  | currentContext newContext |
  self okToChange ifFalse: [^ self].
  self checkContextSelection.
  currentContext := self selectedContext.
  newContext := self handleLabelUpdatesIn: [interruptedProcess completeStep: currentContext]
  whenExecuting: currentContext.
  newContext == currentContext ifTrue:
  [newContext := interruptedProcess stepToSendOrReturn].
  self contextStackIndex > 1
  ifTrue: [self resetContext: newContext]
  ifFalse:
  [newContext == currentContext
+ ifTrue: [self scheduleUIUpdate]
- ifTrue: [self changed: #contentsSelection.
- self updateInspectors]
  ifFalse: [self resetContext: newContext]].
  !

Item was added:
+ ----- Method: Debugger>>scheduleUIUpdate (in category 'context stack menu') -----
+ scheduleUIUpdate
+ uiUpdateBlock ifNil:
+ [uiUpdateBlock := [self changed: #contentsSelection.
+ self updateInspectors]].
+ WorldState lastDeferredUIMessage ~~ uiUpdateBlock ifTrue:
+ [WorldState addDeferredUIMessage: uiUpdateBlock]!


Reply | Threaded
Open this post in threaded view
|

Re: The Inbox: Tools-eem.986.mcz

Christoph Thiede

Hi Levente,


I'm still not sure how this can reliably work if some other unknown process is scheduling deferred UI messages at the same time ...


Also, maybe you could use a closure for the uiUpdateBlock variable instead of bloating the whole object's state, but that could be a subjective thing, too. 😊


Best,

Christoph


Von: Squeak-dev <[hidden email]> im Auftrag von [hidden email] <[hidden email]>
Gesendet: Samstag, 19. September 2020 22:35:37
An: [hidden email]
Betreff: [squeak-dev] The Inbox: Tools-eem.986.mcz
 
A new version of Tools was added to project The Inbox:
http://source.squeak.org/inbox/Tools-eem.986.mcz

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

Name: Tools-eem.986
Author: eem
Time: 19 September 2020, 1:35:34.572026 pm
UUID: b33a2312-24e5-4cfa-a4e3-7f409ce8f5d4
Ancestors: Tools-ct.985

Use the lastDeferredUIMessage mechanism for avoiding updating the debugger UI too frequently.  Alas this only solves the run to here case; it doesn't fix the rapid clicking issue.  Hence this is in the inbox.  Christoph, this may be useful to you.

=============== Diff against Tools-ct.985 ===============

Item was changed:
  CodeHolder subclass: #Debugger
+        instanceVariableNames: 'interruptedProcess contextStack contextStackIndex contextStackList receiverInspector receiverInspectorState contextVariablesInspector contextVariablesInspectorState externalInterrupt proceedValue selectingPC savedCursor isolationHead failedProject labelString message untilExpression uiUpdateBlock'
-        instanceVariableNames: 'interruptedProcess contextStack contextStackIndex contextStackList receiverInspector receiverInspectorState contextVariablesInspector contextVariablesInspectorState externalInterrupt proceedValue selectingPC savedCursor isolationHead failedProject labelString message untilExpression'
         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 changed:
  ----- Method: Debugger>>doStep (in category 'context stack menu') -----
  doStep
         "Send the selected message in the accessed method, and regain control
         after the invoked method returns."
        
         | currentContext newContext |
         self okToChange ifFalse: [^ self].
         self checkContextSelection.
         currentContext := self selectedContext.
         newContext := self handleLabelUpdatesIn: [interruptedProcess completeStep: currentContext]
                                                 whenExecuting: currentContext.
         newContext == currentContext ifTrue:
                 [newContext := interruptedProcess stepToSendOrReturn].
         self contextStackIndex > 1
                 ifTrue: [self resetContext: newContext]
                 ifFalse:
                         [newContext == currentContext
+                                ifTrue: [self scheduleUIUpdate]
-                                ifTrue: [self changed: #contentsSelection.
-                                                self updateInspectors]
                                 ifFalse: [self resetContext: newContext]].
  !

Item was added:
+ ----- Method: Debugger>>scheduleUIUpdate (in category 'context stack menu') -----
+ scheduleUIUpdate
+        uiUpdateBlock ifNil:
+                [uiUpdateBlock := [self changed: #contentsSelection.
+                                                        self updateInspectors]].
+        WorldState lastDeferredUIMessage ~~ uiUpdateBlock ifTrue:
+                [WorldState addDeferredUIMessage: uiUpdateBlock]!