Christoph Thiede uploaded a new version of Tools to project The Inbox: http://source.squeak.org/inbox/Tools-ct.1245.mcz
==================== Summary ====================
Name: Tools-ct.1245 Author: ct Time: 30 December 2023, 8:52:32.810665 pm UUID: 2a87a721-9966-6f46-abea-4e240d9f5ecd Ancestors: Tools-ct.1244
Complements Kernel-ct.1546 (fixes stepping through #mustBeBoolean errors and restarting from primitive methods that no longer fail).
=============== Diff against Tools-ct.1244 ===============
Item was changed: ----- Method: Debugger>>contents:notifying: (in category 'accessing') ----- contents: aText notifying: aController "Accept new method source of the selected context."
| selector classOfMethod category ctxt newMethod | contextStackIndex = 0 ifTrue: [^ false]. "First, handle some edge cases" selector := self selectedClass newParser parseSelector: aText. "selector isDoIt ifTrue: [ currentCompiledMethod := self compileDoIt: aText]." self flag: #todo. "ct: Recompile doIt method *without* creating method litters!! See Compiler>>#evaluateCue:ifFail:." selector = self selectedMessageName ifFalse: [ "Different message compiled, delegating to super" ^ super contents: aText notifying: aController]. self selectedContext isExecutingBlock ifTrue: [ "If we are in a block context, we need to rewind the stack before ." | home | home := self selectedContext activeHome. home ifNil: [ (self confirm: 'Method for block not found on stack, can''t edit and continue. Update method anyway?' translated) ifFalse: [ ^ false]. ^ (super contents: aText notifying: aController) ifTrue: [ contents := nil. self contentsChanged. self inform: 'Method was updated, but cannot revert the stack to it.' translated]; yourself]. (self confirm: 'I will have to revert to the method from\which this block originated. Is that OK?' translated withCRs) ifFalse: [ ^ false]. self resetContext: home changeContents: false. "N.B. Only reset the contents if the compilation succeeds. If contents would be reset when compilation fails, both compiler error message and modifications were lost." ^ (self contents: aText notifying: aController) ifTrue: [self contentsChanged]; yourself]. classOfMethod := self selectedClass. category := self selectedMessageCategoryName. "Do the actual compilation" selector := classOfMethod compile: aText classified: category notifying: aController. selector ifNil: [^ false]. "compilation cancelled" "Update views" contents := aText. newMethod := classOfMethod compiledMethodAt: selector. newMethod isQuick ifTrue: [ self cutBackExecutionToSenderContext]. ctxt := interruptedProcess popTo: self selectedContext. ctxt == self selectedContext ifFalse: [self inform: 'Method saved, but current context unchanged\because of unwind error. Click OK to see error' translated withCRs] ifTrue: [ newMethod isQuick ifFalse: [ + ctxt := interruptedProcess restartTopWith: newMethod. + ctxt := interruptedProcess stepToSendOrReturn]. - interruptedProcess restartTopWith: newMethod. - interruptedProcess stepToSendOrReturn]. contextVariablesInspector object: nil]. self resetContext: ctxt. Project current addDeferredUIMessage: [ self changed: #contentsSelection]. ^ true!
Item was changed: ----- Method: Debugger>>tryRestartFrom: (in category 'context stack menu') ----- tryRestartFrom: context "Try to restart from the initial state of the context. Return whether an unwind error occurred."
| actualContext unwindError | actualContext := interruptedProcess popTo: context. unwindError := actualContext ~= context. unwindError ifFalse: [ + actualContext := interruptedProcess restartTop; stepToSendOrReturn]. - interruptedProcess restartTop; stepToSendOrReturn]. self resetContext: actualContext. ^ unwindError!
squeak-dev@lists.squeakfoundation.org