"Change Set: DebuggerRestartPreference Date: 7 September 2001 Author: Hans-Martin Mosner As requested by Craig Latta and others: Make the restart behavior in the debugger a user preference. Defaults to true (= old behavior)" Preferences addPreference: #restartAlsoProceeds category: #debug default: true balloonHelp: 'If this preference is set, the debugger''s restart button and menu item will also proceed. If the preference is not set, the selected context will just be reset to its initial condition, so you may step through it again.'! !Debugger methodsFor: 'initialize' stamp: 'hmm 9/7/2001 16:41'! optionalButtonPairs "Actually, return triples" | list | list _ #(('Proceed' proceed 'close the debugger and proceed.') ('Restart' restart 'reset this context to its start.') ('Send' send 'step into message sends') ('Step' doStep 'step over message sends') ('Through' stepIntoBlock 'step into a block') ('Full Stack' fullStack 'show full stack') ('Where' where 'select current pc range') ('Browse' browseMethodFull 'open a browser on the selected method')). Preferences restartAlsoProceeds ifTrue: [ list _ list collect: [:each | each second == #restart ifTrue: [each copy at: 3 put: 'proceed from the beginning of this context.'; yourself] ifFalse: [each]]]. ^list! ! !Debugger methodsFor: 'context stack menu' stamp: 'hmm 9/7/2001 16:46'! restart "Proceed from the initial state of the currently selected context. The argument is a controller on a view of the receiver. That view is closed." "Closing now depends on a preference #restartAlsoProceeds - hmm 9/7/2001 16:46" self okToChange ifFalse: [^ self]. self checkContextSelection. (self selectedContext isKindOf: MethodContext) ifFalse: [(self confirm: 'I will have to revert to the method from which this block originated. Is that OK?') ifTrue: [self resetContext: self selectedContext home] ifFalse: [^self]]. self selectedContext restart. self resetContext: self selectedContext. Preferences restartAlsoProceeds ifTrue: [self proceed]! !