Marcel Taeumel uploaded a new version of Tools to project The Trunk: http://source.squeak.org/trunk/Tools-mt.1241.mcz
==================== Summary ====================
Name: Tools-mt.1241 Author: mt Time: 28 November 2023, 10:32:22.826569 am UUID: 5ecdd41c-8d57-fc45-8b23-d96784261782 Ancestors: Tools-dtl.1240
Adds DebuggerInvocationCue as an extension point to pass on more information from exceptions to the debugger.
See senders of #todoDebugger if you want to make use of this new extension point.
Thanks to Eliot (eem) for the idea and Jaromir (jar) for the use case via BlockCannotReturn.
See discussions here: - http://lists.squeakfoundation.org/archives/list/squeak-dev@lists.squeakfound... - http://lists.squeakfoundation.org/archives/list/squeak-dev@lists.squeakfound...
=============== Diff against Tools-dtl.1240 ===============
Item was changed: ----- Method: Debugger class>>openOn:context:label:contents:fullView: (in category 'opening') ----- openOn: process context: context label: title contents: contentsStringOrNil fullView: bool - "PRIVATE!! Open a notifier or a full debugger window for the given process - at the given context. Clients MUST use a ToolSet that is configured with the - receiver class (or tool) to then debug a process via - Process >> #debug(WithTitle:) - ProcessorScheduler >> #debugWithTitle: - ToolSet >> #debugProcess:context:... - and similar messages in Process or ProcessorScheduler. - - Example invocations: - Processor debugWithTitle: 'Example'. - (Process forBlock: [3+4]) debug. - 7/0. - - Configure a new tool set like this - ToolSet default: StandardToolSet - See commentary in - Process >> #debugWithTitle:full:contents: - ProcessorScheduler >> #debugContext:title:full:contents:"
+ self flag: #deprecated. + + ^ self openOnCue: (DebuggerInvocationCue new + process: process; + context: context; + label: title; + contents: contentsStringOrNil; - ^ (self onProcess: process context: context) - openWithLabel: title - contents: contentsStringOrNil fullView: bool; + yourself)! - yourself!
Item was added: + ----- Method: Debugger class>>openOnCue: (in category 'opening') ----- + openOnCue: invocationCue + "PRIVATE!! Open a notifier or a full debugger window for the given process + at the given context. Clients MUST use a ToolSet that is configured with the + receiver class (or tool) to then debug a process via + Process >> #debug(WithTitle:) + ProcessorScheduler >> #debugWithTitle: + ToolSet >> #debugProcess:context:... + and similar messages in Process or ProcessorScheduler. + + Example invocations: + Processor debugWithTitle: 'Example'. + (Process forBlock: [3+4]) debug. + 7/0. + + Configure a new tool set like this + ToolSet default: StandardToolSet + See commentary in + Process >> #debugWithTitle:full:contents: + ProcessorScheduler >> #debugContext:title:full:contents:" + + self flag: #todoDebugger. "mt: Use exception-specific parameters from the invocation cue such as for BlockCannotReturn. See discussions here: + - http://lists.squeakfoundation.org/archives/list/squeak-dev@lists.squeakfound... + - http://lists.squeakfoundation.org/archives/list/squeak-dev@lists.squeakfound... + " + + ^ (self onProcess: invocationCue process context: invocationCue context) + openWithLabel: invocationCue label + contents: invocationCue contents + fullView: invocationCue fullView; + yourself!
Item was added: + Object subclass: #DebuggerInvocationCue + instanceVariableNames: 'process context label contents fullView' + classVariableNames: '' + poolDictionaries: '' + category: 'Tools-Debugger'!
Item was added: + ----- Method: DebuggerInvocationCue>>contents (in category 'accessing') ----- + contents + + ^ contents!
Item was added: + ----- Method: DebuggerInvocationCue>>contents: (in category 'accessing') ----- + contents: anObject + + contents := anObject.!
Item was added: + ----- Method: DebuggerInvocationCue>>context (in category 'accessing') ----- + context + + ^ context!
Item was added: + ----- Method: DebuggerInvocationCue>>context: (in category 'accessing') ----- + context: anObject + + context := anObject.!
Item was added: + ----- Method: DebuggerInvocationCue>>fullView (in category 'accessing') ----- + fullView + + ^ fullView ifNil: [false]!
Item was added: + ----- Method: DebuggerInvocationCue>>fullView: (in category 'accessing') ----- + fullView: anObject + + fullView := anObject.!
Item was added: + ----- Method: DebuggerInvocationCue>>label (in category 'accessing') ----- + label + + ^ label!
Item was added: + ----- Method: DebuggerInvocationCue>>label: (in category 'accessing') ----- + label: anObject + + label := anObject.!
Item was added: + ----- Method: DebuggerInvocationCue>>process (in category 'accessing') ----- + process + + ^ process!
Item was added: + ----- Method: DebuggerInvocationCue>>process: (in category 'accessing') ----- + process: anObject + + process := anObject.!
Item was changed: ----- Method: StandardToolSet class>>debugProcess:context:label:contents:fullView: (in category 'debugging') ----- debugProcess: aProcess context: aContext label: aString contents: contents fullView: aBool
+ self flag: #deprecated. - (aProcess isTerminated and: [aString isNil or: [aString beginsWith: 'Debug it']]) ifTrue: [ - ^ Project uiManager inform: 'Nothing to debug. Process has terminated.\Expression optimized.' translated withCRs].
+ ^ self debugWithCue: (DebuggerInvocationCue new + process: aProcess; + context: aContext; + label: aString; + contents: contents; + fullView: aBool; + yourself)! - ^ Debugger - openOn: aProcess - context: aContext - label: aString - contents: contents - fullView: aBool!
Item was added: + ----- Method: StandardToolSet class>>debugWithCue: (in category 'debugging') ----- + debugWithCue: invocationCue + + (invocationCue process isTerminated and: [invocationCue label isNil or: [invocationCue label beginsWith: 'Debug it']]) ifTrue: [ + ^ Project uiManager inform: 'Nothing to debug. Process has terminated.\Expression optimized.' translated withCRs]. + + ^ Debugger openOnCue: invocationCue!
Item was changed: ----- Method: StandardToolSet class>>handleError: (in category 'debugging - handlers') ----- handleError: anError "Double dispatch. Let the processor take care of that error, which usually calls back here to #debugProcess:..."
+ self flag: #todoDebugger. "mt: Pass exception-specific parameters to the invocation cue such as for BlockCannotReturn. See discussions here: + - http://lists.squeakfoundation.org/archives/list/squeak-dev@lists.squeakfound... + - http://lists.squeakfoundation.org/archives/list/squeak-dev@lists.squeakfound... + " + + ^ Processor debugWithCue: (DebuggerInvocationCue new + context: anError signalerContext; + label: anError description; + fullView: false; + "contents: nil;" + yourself)! - ^ Processor - debugContext: anError signalerContext - title: anError description - full: false - contents: nil!
Item was changed: ----- Method: StandardToolSet class>>handleWarning: (in category 'debugging - handlers') ----- handleWarning: aWarning "Double dispatch. Let the processor take care of that warning, which usually calls back here to #debugProcess:..."
| message | message := '{1}\{2}' withCRs asText format: { "First, show the actual text of this warning." aWarning messageText. "Second, append some helpful information that apply to all kinds of warnings." ('{1} {2}' asText format: { 'Select "Proceed" to continue or close this window to cancel the operation.' translated. 'If you do not want to be interrupted anymore, you can {1} this kind of warning. You can also {2}, which resets such warnings on the next image startup.' translated asText format: { "Provide clickable text links so that the user can directly suppress warnings." 'always suppress' asText addAttribute: (PluggableTextAttribute evalBlock: [ aWarning class suppressWarnings. self inform: ('All ''{1}'' warnings will be suppressed.' translated format: {aWarning class name})]). 'suppress temporarily' asText addAttribute: (PluggableTextAttribute evalBlock: [ aWarning class suppressAndResetOnStartUp. self inform: ('All ''{1}'' warnings will be suppressed\and reset on the next image startup.' translated withCRs format: {aWarning class name})])}. }) addAttribute: ( "Show this helpful information in a smaller font." TextFontReference toFont: Preferences standardButtonFont)}. + + self flag: #todoDebugger. "mt: Pass exception-specific parameters to the invocation cue such as for BlockCannotReturn. See discussions here: + - http://lists.squeakfoundation.org/archives/list/squeak-dev@lists.squeakfound... + - http://lists.squeakfoundation.org/archives/list/squeak-dev@lists.squeakfound... + " + + ^ Processor debugWithCue: (DebuggerInvocationCue new + context: aWarning signalerContext; + label: 'Warning' translated; + fullView: false; + contents: message; + yourself)! - - ^ Processor - debugContext: aWarning signalerContext - title: 'Warning' translated - full: false - contents: message!
Item was changed: ----- Method: SyntaxError>>debug (in category 'menu') ----- debug "Show the stack of the process leading to this syntax editor, typically showing the stack of the compiler as called from fileIn."
+ ToolSet debugWithCue: (DebuggerInvocationCue new + process: compilerProcess; + context: notification signalerContext; + label: 'Stack of the Syntax Error' translated; + "contents: nil;" + fullView: true; + yourself). - ToolSet - debugProcess: compilerProcess - context: notification signalerContext - label: 'Stack of the Syntax Error' translated - contents: nil - fullView: true. "Receiver must give up control over that process now." compilerProcess := nil. self changed: #close.!
packages@lists.squeakfoundation.org