[squeak-dev] The Trunk: Tools-eem.428.mcz
Eliot Miranda
eliot.miranda at gmail.com
Thu Nov 15 21:03:53 UTC 2012
Hmmm, the expection that proves the rule :-/
On Thu, Nov 15, 2012 at 12:59 PM, <commits at source.squeak.org> wrote:
> Eliot Miranda uploaded a new version of Tools to project The Trunk:
> http://source.squeak.org/trunk/Tools-eem.428.mcz
>
> ==================== Summary ====================
>
> Name: Tools-eem.428
> Author: eem
> Time: 15 November 2012, 12:59:12.101 pm
> UUID: 5d9b5b4d-52fa-4489-8803-f4ad4c1e02b2
> Ancestors: Tools-eem.427
>
> Provide a run-until-expression facility for the debugger.
> Thanks to Bob Arning and Bert Freudenberg for UI advice.
>
> =============== Diff against Tools-eem.427 ===============
>
> 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.
> ^aMenu.!
>
> Item was added:
> + ----- Method: Debugger>>runUntil (in category 'code pane menu') -----
> + runUntil
> + "Step until an expression evaluates to other than false, reporting
> an erroer if it doesn't evaluate to true.
> + Remember the expression in an inst var. If shift is pressed when
> the expression is supplied, don't update the UI.
> + If shift is pressed while stepping, stop stepping. Using a user
> interrupt to break out would be more natural
> + but Squeak currently doesn't provide a UserInterrupt expection.
> It should do."
> + | expression receiver context method value lastUpdate updateUI
> breakOnShift |
> + expression := UIManager default
> + request: 'run until expression is
> true (shift to disable ui update; shift to break).'
> + initialAnswer: (untilExpression
> ifNil: 'boolean expression').
> + (expression isNil or: [expression isEmpty]) ifTrue:
> + [^self].
> + updateUI := breakOnShift := Sensor shiftPressed not.
> + 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.
> +
> + lastUpdate := Time millisecondClockValue.
> + FakeClassPool adopt: nil.
> + [self selectedContext == context
> + and: [(value := receiver with: context executeMethod: method) ==
> false]] whileTrue:
> + [self doStep.
> + Time millisecondClockValue - lastUpdate > 50 ifTrue:
> + [updateUI ifTrue: [World displayWorldSafely].
> + breakOnShift
> + ifTrue: [Sensor shiftPressed ifTrue:
> [^self]]
> + ifFalse: [Sensor shiftPressed ifFalse:
> [breakOnShift := true]].
> + lastUpdate := Time millisecondClockValue]].
> + (value ~~ false and: [value ~~ true]) ifTrue:
> + [UIManager default inform: 'expression ', (untilExpression
> contractTo: 40), ' answered ', (value printString contractTo: 20), '!!!!']!
>
>
>
--
best,
Eliot
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20121115/e4aa1917/attachment-0001.htm
More information about the Squeak-dev
mailing list
|