'From Squeak3.1alpha of 28 February 2001 [latest update: #4290] on 25 August 2001 at 12:10:14 pm'! "Change Set: debugIt-vb&Dew Date: 13 August 2001 Author: Vassili Bykov and Doug Way Adds a 'debug it' command to the text editor pop-up menu. Tweaked by sw so that the correct shifted menu gets invoked."! !Compiler methodsFor: 'public access' stamp: 'vb 8/13/2001 23:11'! compileNoPattern: textOrStream in: aClass context: aContext notifying: aRequestor ifFail: failBlock "Similar to #compile:in:notifying:ifFail:, but the compiled code is expected to be a do-it expression, with no message pattern." self from: textOrStream class: aClass context: aContext notifying: aRequestor. ^self translate: sourceStream noPattern: true ifFail: failBlock! ! !ParagraphEditor methodsFor: 'do-its' stamp: 'vb 8/13/2001 23:41'! compileSelectionFor: anObject in: evalContext | methodNode method | methodNode _ [Compiler new compileNoPattern: self selectionAsStream in: anObject class context: evalContext notifying: self ifFail: [^nil]] on: OutOfScopeNotification do: [:ex | ex resume: true]. method _ methodNode generate: #(0 0 0 0). ^method copyWithTempNames: methodNode tempNames! ! !ParagraphEditor methodsFor: 'do-its' stamp: 'vb 8/13/2001 23:41'! debug: aCompiledMethod receiver: anObject in: evalContext | selector guineaPig debugger context | selector _ evalContext isNil ifTrue: [#DoIt] ifFalse: [#DoItIn:]. anObject class addSelector: selector withMethod: aCompiledMethod. guineaPig _ evalContext isNil ifTrue: [[anObject DoIt] newProcess] ifFalse: [[anObject DoItIn: evalContext] newProcess]. context _ guineaPig suspendedContext. debugger _ Debugger new process: guineaPig controller: ((Smalltalk isMorphic not and: [ScheduledControllers inActiveControllerProcess]) ifTrue: [ScheduledControllers activeController] ifFalse: [nil]) context: context isolationHead: nil. debugger openFullNoSuspendLabel: 'Debug it'. [debugger interruptedContext method == aCompiledMethod] whileFalse: [debugger send]. anObject class removeSelectorSimply: selector! ! !ParagraphEditor methodsFor: 'do-its' stamp: 'vb 8/13/2001 23:38'! debugIt | method receiver context | (model respondsTo: #doItReceiver) ifTrue: [FakeClassPool adopt: model selectedClass. receiver _ model doItReceiver. context _ model doItContext] ifFalse: [receiver _ context _ nil]. self lineSelectAndEmptyCheck: [^self]. method _ self compileSelectionFor: receiver in: context. method notNil ifTrue: [self debug: method receiver: receiver in: context]. FakeClassPool adopt: nil! ! !ParagraphEditor class methodsFor: 'class initialization' stamp: 'sw 8/25/2001 12:08'! initializeTextEditorMenus "Initialize the yellow button pop-up menu and corresponding messages." "ParagraphEditor initializeTextEditorMenus" TextEditorYellowButtonMenu _ SelectionMenu labels: 'find...(f) find again (g) set search string (h) do again (j) undo (z) copy (c) cut (x) paste (v) paste... do it (d) print it (p) inspect it (i) debug it accept (s) cancel (l) show bytecodes more...' lines: #(3 5 9 13 15 16) selections: #(find findAgain setSearchString again undo copySelection cut paste pasteRecent doIt printIt inspectIt debugIt accept cancel showBytecodes shiftedTextPaneMenuRequest) ! ! !PluggableTextMorph methodsFor: 'menu commands' stamp: 'vb 7/29/2001 12:45'! debugIt self handleEdit: [textMorph editor debugIt]! ! "Postscript:" ParagraphEditor initializeTextEditorMenus.!