[squeak-dev] The Inbox: Tools-eem.426.mcz
nicolas.cellier.aka.nice at gmail.com
Mon Nov 5 19:34:49 UTC 2012
Good, except FakeClassPool is kind of obsolete (or I wish it were).
and for joke:
2012/11/5 <commits at source.squeak.org>:
> A new version of Tools was added to project The Inbox:
> ==================== Summary ====================
> Name: Tools-eem.426
> Author: eem
> Time: 5 November 2012, 10:39:18.848 am
> UUID: d2507ad6-1423-4b1a-9922-41894ea2174a
> Ancestors: Tools-ul.425
> A serviceable "run until expression" for the debugger.
> Would be nice if the UI updated.
> WOuld be nice if there was some solution for temporaries
> that are undefined rather than writing explicit guards in the
> Hence publishing to inbox for now.
> =============== Diff against Tools-ul.425 ===============
> Item was changed:
> CodeHolder subclass: #Debugger
> + instanceVariableNames: 'interruptedProcess interruptedController contextStack contextStackIndex contextStackList receiverInspector contextVariablesInspector externalInterrupt proceedValue selectingPC savedCursor isolationHead failedProject errorWasInUIProcess labelString message untilExpression'
> - instanceVariableNames: 'interruptedProcess interruptedController contextStack 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 changed:
> ----- Method: Debugger>>codePaneMenu:shifted: (in category 'code pane menu') -----
> codePaneMenu: aMenu shifted: shifted
> + aMenu
> + add: 'run to here' target: self selector: #runToSelection: argument: thisContext sender receiver selectionInterval;
> + add: 'run until...' target: self selector: #runUntil;
> + addLine.
> - aMenu add: 'run to here' target: self selector: #runToSelection: argument: thisContext sender receiver selectionInterval.
> - aMenu addLine.
> super codePaneMenu: aMenu shifted: shifted.
> Item was added:
> + ----- Method: Debugger>>runUntil (in category 'code pane menu') -----
> + runUntil
> + | expression receiver context method value |
> + expression := UIManager default
> + request: 'run until expression is true'
> + initialAnswer: (untilExpression ifNil: 'boolean expression').
> + (expression isNil or: [expression isEmpty]) ifTrue:
> + [^self].
> + untilExpression := expression.
> + context := self selectedContext.
> + receiver := context receiver.
> + FakeClassPool adopt: receiver class.
> + method := receiver class evaluatorClass new
> + compiledMethodFor: untilExpression
> + in: context
> + to: receiver
> + notifying: nil
> + ifFail: [FakeClassPool adopt: nil. ^ #failedDoit]
> + logged: false.
> + FakeClassPool adopt: nil.
> + [self selectedContext == context
> + and: [(value := receiver with: context executeMethod: method) == false]] whileTrue:
> + [self doStep].
> + (value ~~ false and: [value ~~ true]) ifTrue:
> + [UIManager default inform: 'expression ', (untilExpression contractTo: 40), ' answered ', (value printString contractTo: 20), '!!!!']
> + !
More information about the Squeak-dev