diff --git a/sources/JadeDebugger.cls b/sources/JadeDebugger.cls index 03630622..f2753e1e 100644 --- a/sources/JadeDebugger.cls +++ b/sources/JadeDebugger.cls @@ -352,18 +352,18 @@ updateSaveMethodOop: anInteger !JadeDebugger categoriesFor: #clearUI!public! ! !JadeDebugger categoriesFor: #codeSourcePresenterClass!private! ! !JadeDebugger categoriesFor: #contextObject!public! ! -!JadeDebugger categoriesFor: #copyStack!menu handlers!public! ! +!JadeDebugger categoriesFor: #copyStack!menu handlers!private! ! !JadeDebugger categoriesFor: #createComponents!public! ! !JadeDebugger categoriesFor: #createSchematicWiring!public! ! !JadeDebugger categoriesFor: #getProcessList!public! ! !JadeDebugger categoriesFor: #implement!public! ! !JadeDebugger categoriesFor: #initializeProcess:message:terminateOnClose:!public! ! -!JadeDebugger categoriesFor: #inspectVariable!public! ! -!JadeDebugger categoriesFor: #onViewClosed!public! ! +!JadeDebugger categoriesFor: #inspectVariable!menu handlers!private! ! +!JadeDebugger categoriesFor: #onViewClosed!event handlers!public! ! !JadeDebugger categoriesFor: #queryCommand:!public! ! -!JadeDebugger categoriesFor: #resumeProcess!public! ! -!JadeDebugger categoriesFor: #runToCursor!public! ! -!JadeDebugger categoriesFor: #saveMethod!public! ! +!JadeDebugger categoriesFor: #resumeProcess!menu handlers!private! ! +!JadeDebugger categoriesFor: #runToCursor!menu handlers!private! ! +!JadeDebugger categoriesFor: #saveMethod!menu handlers!private! ! !JadeDebugger categoriesFor: #selectedFrame!public! ! !JadeDebugger categoriesFor: #selectedProcess!public! ! !JadeDebugger categoriesFor: #selectedVariable!public! ! @@ -372,10 +372,10 @@ updateSaveMethodOop: anInteger !JadeDebugger categoriesFor: #stackInitialSelection!public! ! !JadeDebugger categoriesFor: #stackInitialSelectionData!public! ! !JadeDebugger categoriesFor: #statusBarText:!public! ! -!JadeDebugger categoriesFor: #stepInto!public! ! -!JadeDebugger categoriesFor: #stepOut!public! ! -!JadeDebugger categoriesFor: #stepOver!public! ! -!JadeDebugger categoriesFor: #terminateProcess!public! ! +!JadeDebugger categoriesFor: #stepInto!menu handlers!private! ! +!JadeDebugger categoriesFor: #stepOut!menu handlers!private! ! +!JadeDebugger categoriesFor: #stepOver!menu handlers!private! ! +!JadeDebugger categoriesFor: #terminateProcess!menu handlers!private! ! !JadeDebugger categoriesFor: #update!public! ! !JadeDebugger categoriesFor: #updateSaveMethodOop:!public! ! diff --git a/sources/JadeiteDebuggerTestCase.cls b/sources/JadeiteDebuggerTestCase.cls new file mode 100644 index 00000000..877a8a58 --- /dev/null +++ b/sources/JadeiteDebuggerTestCase.cls @@ -0,0 +1,480 @@ +"Filed out from Dolphin Smalltalk 7"! + +JadeiteAbstractTestCase subclass: #JadeiteDebuggerTestCase + instanceVariableNames: 'debugger gsProcess process' + classVariableNames: '' + poolDictionaries: '' + classInstanceVariableNames: ''! +JadeiteDebuggerTestCase guid: (GUID fromString: '{f159d434-7740-414b-9e64-d9fdde995061}')! +JadeiteDebuggerTestCase comment: ''! +!JadeiteDebuggerTestCase categoriesForClass!SUnit! ! +!JadeiteDebuggerTestCase methodsFor! + +closeDebuggers + + | list semaphore | + list := JadeiteMethodListBrowser allInstances , RowanSystemBrowser allInstances , RowanDebugger allInstances. + semaphore := Semaphore new. + list do: [:each | + session removeEventsTriggeredFor: each. + [ + [ + each view close. + each become: Object new. + semaphore signal. + SessionManager inputState prod. + ] on: ProcessTermination do: [:ex | "A debugger wants to terminate the current process!!" + [ + each become: Object new. + semaphore signal. + SessionManager inputState prod. + ] forkAt: Processor userBackgroundPriority. + ex pass. + ]. + ] fork. + semaphore wait. + debugger == each ifTrue: [debugger := nil]. + ]. + list := JadeiteMethodListBrowser allInstances , RowanSystemBrowser allInstances , RowanDebugger allInstances. + self assert: list isEmpty. +! + +debuggerDo: aBlock + + self assert: RowanDebugger semaphore isNil. + RowanDebugger semaphore: Semaphore new. + aBlock value. + RowanDebugger semaphore wait. + RowanDebugger semaphore: nil. +! + +getDebugger + + 100 timesRepeat: [ + debugger := RowanDebugger allInstances detect: [:each | true] ifNone: [nil]. + (debugger notNil and: [debugger documentPresenter view selection notEmpty]) ifTrue: [^self]. + (Delay forMilliseconds: 10) wait. + ]. +! + +methodListBrowser + + ^JadeiteMethodListBrowser allInstances detect: [:each | true] ifNone: [nil] +! + +openDebuggerOn: aString + + self + assert: RowanDebugger allInstances isEmpty; + debuggerDo: [process := [session executeString: aString] fork]; "Typically ~ 180ms" + getDebugger; + yourself. +! + +setUp + + | list1 list2 | + super setUp. + self closeDebuggers. + RowanDebugger debuggerClass: RowanDebugger. + list1 := RowanSystemBrowser allInstances. + list2 := RowanMethodListBrowser allInstances. + self + assert: session notNil; + assert: list1 isEmpty; + assert: list2 isEmpty; + yourself. +! + +systemBrowser + + ^RowanSystemBrowser allInstances detect: [:each | true] ifNone: [nil] +! + +tearDown + + process ifNotNil: [process terminate. process := nil]. + self + terminateGsProcess; + closeDebuggers; + yourself. + RowanDebugger debuggerClass: nil. + RowanDebugger semaphore: nil. + super tearDown. + (Delay forMilliseconds: 50) wait.! + +terminateGsProcess + + | string | + gsProcess ifNil: [^self]. + string := ' +| gsProcess | +gsProcess := Object _objectForOop: ' ,gsProcess printString , '. +gsProcess ifNotNil: [gsProcess terminate. (Delay forMilliseconds: 10) wait]. +Processor allProcesses includes: gsProcess'. + gsProcess := nil. + 5 timesRepeat: [ + (debugger gciSession executeString: string) ifFalse: [^self]. + ]. + self assert: false. +! + +test1 + "Basics of opening a debugger, viewing the UI, and resuming." + + | x | + self + openDebuggerOn: 'nil halt'; + assert: (x := debugger errorMessagePresenter value) = 'a Halt occurred (error 2709)'; + assert: (x := debugger processListPresenter list size) == 1; + assert: (x := debugger frameListPresenter list size) == 2; + assert: (x := debugger frameListPresenter list first) = 'Executed Code @2 line 1'; + assert: (x := debugger variableListPresenter list size) == 1; + assert: (x := debugger variableListPresenter list first) class == RowanVariableService; assert: x oop == 20; + assert: x _key == #'receiver'; + assert: x value = 'nil'; + debuggerDo: [debugger resumeProcess]; + assert: (x := debugger view) class == DeafObject; + yourself. +! + +test2 + "Stepping (note that 3.2.15 has some odd behaviors)" + + self + openDebuggerOn: '| x | +nil halt. +x := 1 + 2 * 3. +1 == 1 ifTrue: [x := 1]. +1 to: 1 by: 1 do: [:i | x := i ]. +[x := 2] value. +x yourself'; + assert: (debugger errorMessagePresenter value) equals: 'a Halt occurred (error 2709)'; + assert: (debugger frameListPresenter list first) equals: 'Executed Code @2 line 2'; + assert: (debugger documentPresenter view selection) equals: 'halt'; + debuggerDo: [debugger stepOver]; + assert: (debugger documentPresenter view selection) equals: '+ '; + debuggerDo: [debugger stepOver]; + assert: (debugger documentPresenter view selection) equals: '* '; + debuggerDo: [debugger stepOver]; + assert: (debugger documentPresenter view selection) equals: ':='; + debuggerDo: [debugger stepOver]; + assert: (debugger documentPresenter view selection) equals: '=='; + debuggerDo: [debugger stepOver]; + assert: (debugger documentPresenter view selection) equals: 'ifTrue:'; + debuggerDo: [debugger stepOver]; + assert: (debugger documentPresenter view selection) = ':='; + debuggerDo: [debugger stepOver]; + debuggerDo: [debugger stepOver]; + assert: (debugger documentPresenter view selection) = 'to:'; + debuggerDo: [debugger stepOver]; + assert: (debugger documentPresenter view selection) = ':='; + debuggerDo: [debugger stepOver]; + assert: (debugger documentPresenter view selection) equals: 'to:'; + debuggerDo: [debugger stepOver]; + debuggerDo: [debugger stepOver]; + assert: (debugger documentPresenter view selection) equals: 'value'; + debuggerDo: [debugger stepInto]; + assert: (debugger documentPresenter view selection) equals: ':='; + debuggerDo: [debugger stepOver]; + debuggerDo: [debugger stepOut]; + assert: (debugger documentPresenter view selection) equals: 'yourself'; + debuggerDo: [debugger resumeProcess]; + yourself. +! + +test3 + "browse stack class" + + | browser | + self + openDebuggerOn: '| x | +nil halt. +x := 1 -> 2. +x yourself'; + debuggerDo: [debugger stepOver]; + assert: debugger documentPresenter view selection equals: '->'; + debuggerDo: [debugger stepInto]; + debuggerDo: [debugger browseFrameMethod]; + assert: (browser := self systemBrowser) notNil; + assert: browser currentCard selectedClasses = #('Object'); + assert: browser currentCard selectedMethodName = '->'; + debuggerDo: [debugger resumeProcess]; + yourself. +! + +test4 + "browse variable class" + + | browser | + self + openDebuggerOn: '| x | +nil halt. +x := 1 -> 2. +x yourself'; + debuggerDo: [debugger stepOver]; + debuggerDo: [debugger stepOver]; + debuggerDo: [debugger stepOver]; + assert: (debugger variableListPresenter selectionByIndex: 2) notNil; + debuggerDo: [debugger browseObjectClass]; + assert: (browser := self systemBrowser) notNil; + assert: browser currentCard selectedClasses = #('Association'); + debuggerDo: [debugger resumeProcess]; + yourself. +! + +test5 + "browse implementors" + + | browser list | + self + openDebuggerOn: '| x | +nil halt. +x := 1 -> 2. +x yourself'; + debuggerDo: [debugger stepOver]; + assert: debugger documentPresenter view selection equals: '->'; + debuggerDo: [debugger stepInto]; + + debuggerDo: [debugger browseImplementors]; + assert: (browser := self methodListBrowser) notNil; assert: (list := browser primaryPresenter methodListPresenter primaryPresenter list) notEmpty; + assert: list size < 10; + + debuggerDo: [debugger resumeProcess]; + yourself. +! + +test6 + "browse senders" + + | browser list | + [ + 500 timesRepeat: [ + (Delay forMilliseconds: 10) wait. + SessionManager inputState prod. + ]. + ] forkAt: Processor userBackgroundPriority. + self + openDebuggerOn: '| x | +nil halt. +x := 1 -> 2. +x yourself'; + assert: debugger documentPresenter view selection equals: 'halt'; + debuggerDo: [debugger stepOver]; + assert: debugger documentPresenter view selection equals: '->'; + debuggerDo: [debugger stepInto]; + + debuggerDo: [debugger browseSenders]; + assert: (browser := self methodListBrowser) notNil; + assert: (list := browser primaryPresenter methodListPresenter primaryPresenter list) notEmpty; + assert: list size > 10; + + debuggerDo: [debugger resumeProcess]; + yourself. +! + +test7 + "set/clear breakpoints" + + | indicator | + self + openDebuggerOn: '| x | +nil halt. +x := 1 -> 2. +x yourself'; + assert: (indicator := debugger methodSourcePresenter documentPresenter view indicators at: 2) notNil; + assert: indicator range = (12 to: 15); + assert: indicator styleName = 8; + assert: indicator tag = 'step point #2'; + + debuggerDo: [debugger methodSourcePresenter setBreakAtStepPoint: 2]; + assert: (indicator := debugger methodSourcePresenter documentPresenter view indicators at: 2) notNil; + assert: indicator range = (12 to: 15); + assert: indicator styleName = 9; + assert: indicator tag = 'Break at step point #2'; + + debuggerDo: [debugger methodSourcePresenter clearBreakAtStepPoint: 2]; + assert: (indicator := debugger methodSourcePresenter documentPresenter view indicators at: 2) notNil; + assert: indicator range = (12 to: 15); + assert: indicator styleName = 8; + assert: indicator tag = 'step point #2'; + + debuggerDo: [debugger resumeProcess]; + yourself. +! + +test8 + "https://github.com/ericwinger/Jade/issues/20" + + self + assert: RowanDebugger allInstances isEmpty; + debuggerDo: [process := [session debugString: '#(abc def) do:[:symbol | symbol size]' fromContext: nil environment: 0] fork]; + getDebugger; + yourself. + self debuggerDo: [debugger resumeProcess]. +! + +testBug74 + "Open debugger on method with breakpoint" + + session executeString: '(Repository compiledMethodAt: #pageSize) setBreakAtStepPoint: 2'. + self + openDebuggerOn: 'SystemRepository pageSize'; + assert: debugger documentPresenter view selection equals: 'zeroArgPrim:50'; + debuggerDo: [debugger resumeProcess]; + yourself. +! + +testBug77 + + | string view | + string := '" +2 + 3 +x +" +| x | +x := 4 + 8. +x halt. +'. + self + openDebuggerOn: string; + assert: (view := debugger documentPresenter view) class equals: ScintillaView; + assert: (view selectionRange: (3 to: 7)) notNil; + "debuggerDo: [debugger jadeDisplay]; + assert: view selection equals: ' 5'; + halt;" + yourself. +! + +testBug82 + "Terminate a process other than the primary one" + + | confirmProcess | + gsProcess := session executeString: '[(Delay forSeconds: 9999) wait] fork asOop'. + self + openDebuggerOn: 'nil halt'; + assert: debugger _processList size equals: 2; + assert: debugger processListPresenter list size equals: 2; + assert: (debugger processListPresenter selectionByIndex: 2) notNil; + assert: (debugger _processList at: 2) oopType value equals: gsProcess; + yourself. + confirmProcess := [ + [ + ((View active printString subStrings: $') at: 2) = 'GemStone/S Process Termi...'. + ] whileFalse: [ + (Delay forMilliseconds: 100) wait. + ]. + View active + postMessage: 16r100 "WM_KEYDOWN" wParam: 13 "VK_RETURN" lParam: 0; + postMessage: 16r101 "WM_KEYUP" wParam: 13 "VK_RETURN" lParam: 0; + yourself. + ] fork. + [ + self + assert: debugger terminateProcess notNil; + assert: debugger _processList size equals: 1; + assert: debugger processListPresenter list size equals: 1; + debuggerDo: [debugger resumeProcess]; + yourself. + ] ensure: [ + confirmProcess terminate. + ].! + +testContextMenu + "https://github.com/ericwinger/Jade/issues/68" + + | error time view | + ShortcutMenuStatus reset. + self openDebuggerOn: 'nil halt'. + view := debugger documentPresenter view. + [ + | counter | + counter := 0. + [ShortcutMenuStatus status isNil] whileTrue: [(Delay forMilliseconds: 10) wait]. + self assert: ShortcutMenuStatus isOpen. + [ + counter := counter + 1. + (Delay forMilliseconds: 100) wait. + ShortcutMenuStatus isOpen and: [counter <= 10]. + ] whileTrue: [ + view + postMessage: 16r100 "WM_KEYDOWN" wParam: 27 "VK_ESCAPE" lParam: 0; + postMessage: 16r101 "WM_KEYUP" wParam: 27 "VK_ESCAPE" lParam: 0; + yourself. + ]. + Transcript show: ' +testContextMenu - counter = ' , counter printString. + ] fork. + view + postMessage: 16r204 "WM_RBUTTONDOWN" wParam: 0 lParam: 16r12C0064; " (300 @ 100) " + postMessage: 16r205 "WM_RBUTTONUP" wParam: 0 lParam: 16r12C0064; + yourself. + time := Time millisecondClockValue + 2000. + [ + SessionManager current inputState loopWhile: [ShortcutMenuStatus isClosed not and: [Time millisecondClockValue < time]]. + ] on: Error do: [:ex | + error := ex. + ex return. + ]. + self + assert: error isNil; + debuggerDo: [debugger resumeProcess]; + yourself. +! + +testErrorInPrintString + "https://github.com/ericwinger/Jade/issues/49" + + self + openDebuggerOn: '(ScaledDecimal _basicNew instVarAt: 1 put: 1; instVarAt: 2 put: nil; printString)'; + assert: debugger errorMessagePresenter value equals: 'a MessageNotUnderstood occurred (error 2010), a UndefinedObject does not understand #''_generality'''; + assert: (debugger frameListPresenter list at: 3) equals: 'ScaledDecimal >> asString @22 line 15'; + assert: (debugger frameListPresenter selectionByIndex: 3) notNil; + assert: debugger variableListPresenter list first value equals: '(ScaledDecimal printString error: a MessageNotUnderstood occurred (error 2010), a UndefinedObject does not understand #''_generality'')'; + debuggerDo: [[debugger _terminateProcess] fork]; + assert: (Delay forMilliseconds: 50) wait notNil; + assert: (debugger isNil or: [debugger view class == DeafObject]); + yourself. +! + +testSaveMethod + "https://github.com/ericwinger/Jade/issues/62" + + | number view | + number := Time millisecondClockValue. + session executeString: '(RowanFrameService compiledMethodAt: #testMethod) setBreakAtStepPoint: 1'. + self + openDebuggerOn: 'RowanFrameService new testMethod'; + assert: (view := debugger documentPresenter view) notNil; + assert: (view selection) equals: 'testMethod'; + assert: (view selectionRange: (14 to: 99)) selection first equals: $^; + assert: (view replaceSelection: '^' , number printString) notNil; + assert: debugger saveMethod notNil; + assert: (view selection) equals: 'testMethod'; + debuggerDo: [debugger resumeProcess]; + assert: (session executeString: 'RowanFrameService new testMethod') equals: number; + yourself.! ! +!JadeiteDebuggerTestCase categoriesFor: #closeDebuggers!public! ! +!JadeiteDebuggerTestCase categoriesFor: #debuggerDo:!public! ! +!JadeiteDebuggerTestCase categoriesFor: #getDebugger!public! ! +!JadeiteDebuggerTestCase categoriesFor: #methodListBrowser!public! ! +!JadeiteDebuggerTestCase categoriesFor: #openDebuggerOn:!public! ! +!JadeiteDebuggerTestCase categoriesFor: #setUp!public!running! ! +!JadeiteDebuggerTestCase categoriesFor: #systemBrowser!public! ! +!JadeiteDebuggerTestCase categoriesFor: #tearDown!public!running! ! +!JadeiteDebuggerTestCase categoriesFor: #terminateGsProcess!public!running! ! +!JadeiteDebuggerTestCase categoriesFor: #test1!public!tests! ! +!JadeiteDebuggerTestCase categoriesFor: #test2!public!tests! ! +!JadeiteDebuggerTestCase categoriesFor: #test3!public!tests! ! +!JadeiteDebuggerTestCase categoriesFor: #test4!public!tests! ! +!JadeiteDebuggerTestCase categoriesFor: #test5!public!tests! ! +!JadeiteDebuggerTestCase categoriesFor: #test6!public!tests! ! +!JadeiteDebuggerTestCase categoriesFor: #test7!public!tests! ! +!JadeiteDebuggerTestCase categoriesFor: #test8!public!tests! ! +!JadeiteDebuggerTestCase categoriesFor: #testBug74!public!tests! ! +!JadeiteDebuggerTestCase categoriesFor: #testBug77!public! ! +!JadeiteDebuggerTestCase categoriesFor: #testBug82!public!tests! ! +!JadeiteDebuggerTestCase categoriesFor: #testContextMenu!public!tests! ! +!JadeiteDebuggerTestCase categoriesFor: #testErrorInPrintString!public!tests! ! +!JadeiteDebuggerTestCase categoriesFor: #testSaveMethod!public!tests! ! + diff --git a/sources/Rowan UI Tests.pax b/sources/Rowan UI Tests.pax index 5daea072..c17cd517 100644 --- a/sources/Rowan UI Tests.pax +++ b/sources/Rowan UI Tests.pax @@ -6,11 +6,11 @@ package paxVersion: 1; package classNames add: #JadeiteAbstractTestCase; + add: #JadeiteDebuggerTestCase; add: #JadeiteDictionaryBrowserTestCase; add: #JadeiteInspectorTestCase; add: #JadeiteProjectBrowserTestCase; add: #JadeiteTestResource; - add: #RowanDebuggerTestCase; yourself. package methodNames @@ -42,6 +42,11 @@ TestCase subclass: #JadeiteAbstractTestCase classVariableNames: '' poolDictionaries: '' classInstanceVariableNames: ''! +JadeiteAbstractTestCase subclass: #JadeiteDebuggerTestCase + instanceVariableNames: 'debugger gsProcess process' + classVariableNames: '' + poolDictionaries: '' + classInstanceVariableNames: ''! JadeiteAbstractTestCase subclass: #JadeiteDictionaryBrowserTestCase instanceVariableNames: 'dictionaryBrowser' classVariableNames: '' @@ -57,11 +62,6 @@ JadeiteAbstractTestCase subclass: #JadeiteProjectBrowserTestCase classVariableNames: '' poolDictionaries: '' classInstanceVariableNames: ''! -JadeiteAbstractTestCase subclass: #RowanDebuggerTestCase - instanceVariableNames: 'debugger gsProcess process' - classVariableNames: '' - poolDictionaries: '' - classInstanceVariableNames: ''! TestResource subclass: #JadeiteTestResource instanceVariableNames: 'session transcript' classVariableNames: '' diff --git a/sources/RowanDebugger.cls b/sources/RowanDebugger.cls index 3798f3c5..dce3a99d 100755 --- a/sources/RowanDebugger.cls +++ b/sources/RowanDebugger.cls @@ -138,7 +138,7 @@ methodSourcePresenter ^codePane! onIdleEntered - "Support for automated testing so we know when UI is ready" + "Private - Support for automated testing so we know when UI is ready" | cachedClass cachedSession | cachedClass := self class. @@ -153,7 +153,7 @@ onIdleEntered super onIdleEntered.! onViewClosed - "copied from RowanSystemBrowserPresenter>>onViewClosed" + "Private - copied from RowanSystemBrowserPresenter>>onViewClosed" processList := processListPresenter list collect: [:each | GsProcess session: gciSession oopType: each oopType]. super onViewClosed. @@ -165,7 +165,7 @@ onViewClosed ! onViewOpened - "copied from RowanProjectsBrowserPresenter>>onViewOpened" + "Private - copied from RowanProjectsBrowserPresenter>>onViewOpened" super onViewOpened. self @@ -232,6 +232,11 @@ reportCompileError: anArrayOfArray in: methodSourcePresenter string := stream contents. self statusBarText: (string copyFrom: 1 to: string size - 2).! +restart + (gsProcess gsProcessForSession: gciSession) + trimStackToLevel: frameListPresenter selectionByIndex + frameListOffset. + self getProcessList.! + saveMethod | classService string | string := self getDocumentData reject: [:each | each == Character cr]. @@ -320,10 +325,10 @@ variableListPresenter !RowanDebugger categoriesFor: #_processList!public! ! !RowanDebugger categoriesFor: #_terminateProcess:!public! ! !RowanDebugger categoriesFor: #basicSelectedFrame!public! ! -!RowanDebugger categoriesFor: #browseFrameMethod!public! ! -!RowanDebugger categoriesFor: #browseImplementors!public! ! -!RowanDebugger categoriesFor: #browseObjectClass!public! ! -!RowanDebugger categoriesFor: #browseSenders!public! ! +!RowanDebugger categoriesFor: #browseFrameMethod!menu handlers!private! ! +!RowanDebugger categoriesFor: #browseImplementors!menu handlers!private! ! +!RowanDebugger categoriesFor: #browseObjectClass!menu handlers!private! ! +!RowanDebugger categoriesFor: #browseSenders!menu handlers!private! ! !RowanDebugger categoriesFor: #compilationWarningFrom:!compiling!public! ! !RowanDebugger categoriesFor: #createSchematicWiring!public! ! !RowanDebugger categoriesFor: #currentMethodSourceFrom:!compiling!public! ! @@ -333,18 +338,19 @@ variableListPresenter !RowanDebugger categoriesFor: #getProcessList!public! ! !RowanDebugger categoriesFor: #methodListSelection!Accessing!public! ! !RowanDebugger categoriesFor: #methodSourcePresenter!public! ! -!RowanDebugger categoriesFor: #onIdleEntered!public! ! -!RowanDebugger categoriesFor: #onViewClosed!public! ! -!RowanDebugger categoriesFor: #onViewOpened!public! ! +!RowanDebugger categoriesFor: #onIdleEntered!event handlers!private! ! +!RowanDebugger categoriesFor: #onViewClosed!event handlers!private! ! +!RowanDebugger categoriesFor: #onViewOpened!event handlers!private! ! !RowanDebugger categoriesFor: #processListPresenter!Accessing!public! ! !RowanDebugger categoriesFor: #queryCommand:!public! ! !RowanDebugger categoriesFor: #registerPresentersForUpdates!public! ! !RowanDebugger categoriesFor: #reportCompileError:in:!compiling!public! ! -!RowanDebugger categoriesFor: #saveMethod!compiling!public! ! +!RowanDebugger categoriesFor: #restart!menu handlers!private! ! +!RowanDebugger categoriesFor: #saveMethod!compiling!menu handlers!private! ! !RowanDebugger categoriesFor: #selectedFrame!public! ! -!RowanDebugger categoriesFor: #stepInto!public! ! -!RowanDebugger categoriesFor: #stepOut!public! ! -!RowanDebugger categoriesFor: #stepOver!public! ! +!RowanDebugger categoriesFor: #stepInto!menu handlers!private! ! +!RowanDebugger categoriesFor: #stepOut!menu handlers!private! ! +!RowanDebugger categoriesFor: #stepOver!menu handlers!private! ! !RowanDebugger categoriesFor: #updateMethodSource!public! ! !RowanDebugger categoriesFor: #variableDataPresenter!Accessing!public! ! !RowanDebugger categoriesFor: #variableListPresenter!Accessing!public! ! @@ -374,6 +380,16 @@ debuggerClass: aDebugger debuggerClass := aDebugger. ! +resource_Default_view + "Answer the literal data from which the 'Default view' resource can be reconstituted. + DO NOT EDIT OR RECATEGORIZE THIS METHOD. + + If you wish to modify this resource evaluate: + ViewComposer openOn: (ResourceIdentifier class: self selector: #resource_Default_view) + " + + ^#(#'!!STL' 4 788558 10 ##(Smalltalk.STBViewProxy) ##(Smalltalk.ShellView) 34 27 nil nil 8 #(13565952 65536) 416 nil 524550 ##(Smalltalk.ColorRef) 8 4278190080 328198 ##(Smalltalk.Point) 1601 1201 551 nil nil nil 416 852230 ##(Smalltalk.FramingLayout) 170 176 34 6 410 ##(Smalltalk.TextEdit) 34 16 nil 416 34 2 8 1140850816 1 608 721990 2 ##(Smalltalk.ValueHolder) nil false 1310726 ##(Smalltalk.EqualitySearchPolicy) nil nil nil 7 nil nil nil 608 nil 8 4294906255 852486 ##(Smalltalk.NullConverter) nil nil 3 983302 ##(Smalltalk.MessageSequence) 138 144 34 3 721670 ##(Smalltalk.MessageSend) #createAt:extent: 34 2 514 321 7 514 1245 39 608 850 #text: 34 1 8 'Static Text' 608 850 #setMarginWidths: 34 1 8 #(3 3) 608 983302 ##(Smalltalk.WINDOWPLACEMENT) 8 #[44 0 0 0 0 0 0 0 1 0 0 0 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 160 0 0 0 3 0 0 0 14 3 0 0 22 0 0 0] 8 #() 514 193 193 nil 27 1181766 2 ##(Smalltalk.FramingConstraints) 1180678 ##(Smalltalk.FramingCalculation) #fixedParentLeft 321 1138 #fixedParentRight -3 1138 #fixedParentTop 7 1138 #fixedViewTop 39 410 ##(Smalltalk.ToolbarA) 34 25 nil 416 34 2 8 1140853580 131137 1216 nil 466 8 4278190080 nil 519 nil nil nil 1216 466 8 4278190080 8 4294906693 nil 170 192 34 14 14793 1115910 ##(Smalltalk.ToolbarIconButton) 14793 nil 1216 1 1180998 4 ##(Smalltalk.CommandDescription) #showNextStatement 8 'Top Of Stack' 1 1 263494 3 ##(Smalltalk.Icon) nil true 1572870 ##(Smalltalk.ImageRelativeFileLocator) 8 'ShowNextStatement.ico' 2032142 ##(Smalltalk.STBExternalResourceLibraryProxy) 8 'dolphindr7.dll' nil 395334 3 ##(Smalltalk.Bitmap) nil true nil nil nil nil 3 514 33 33 1 14795 1394 14795 nil 1216 1 1426 #stepInto 8 'Step Into' 1 1 1474 nil true 1520 8 'StepInto.ico' 1568 1602 nil true nil nil nil nil 3 514 33 33 1 14797 1394 14797 nil 1216 1 1426 #stepOver 8 'Step Over' 1 1 1474 nil true 1520 8 'StepOver.ico' 1568 1602 nil true nil nil nil nil 3 514 33 33 1 14799 1394 14799 nil 1216 1 1426 #stepOut 8 'Step Out' 1 1 1474 nil true 1520 8 'StepOut.ico' 1568 1602 nil true nil nil nil nil 3 514 33 33 1 14801 1394 14801 nil 1216 1 1426 #runToCursor 8 'Run to Cursor' 1 1 1474 nil true 1520 8 'RunToCursor.ico' 1568 1602 nil true nil nil nil nil 3 514 33 33 1 14803 1394 14803 nil 1216 1 1426 #resumeProcess 8 'Go' 1 1 1474 nil true 1520 8 'Run.ico' 1568 1602 nil true nil nil nil nil 3 514 33 33 1 14805 1394 14805 nil 1216 1 1426 #restart 8 'Restart' 1 1 1474 nil true 1520 8 'Up.ico' 1568 1602 nil true nil nil nil nil 3 514 33 33 1 34 7 1408 1648 1760 1872 1984 2096 2208 170 176 34 14 2288 13 1728 3 1840 5 1952 7 1616 1 2064 9 2176 11 nil 1 nil 514 33 33 514 45 45 nil nil 786 138 144 34 2 850 #createAt:extent: 34 2 514 1 1 514 321 51 1216 850 #updateSizePosted 8 #() 1216 1026 8 #[44 0 0 0 0 0 0 0 1 0 0 0 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 0 0 0 0 0 0 0 0 160 0 0 0 25 0 0 0] 8 #() 1088 nil 27 1106 1152 1 1138 #fixedViewLeft 321 1184 1 1200 51 410 ##(Smalltalk.ContainerView) 34 15 nil 416 34 2 8 1140850688 131073 2624 nil nil nil 7 nil nil nil 2624 1180166 ##(Smalltalk.ProportionalLayout) 170 176 2528 true 170 192 34 2 410 ##(Smalltalk.ReferenceView) 34 14 nil 2624 34 2 8 1140850688 131073 2768 nil 466 8 4278190080 nil 7 nil nil nil 2768 1180166 ##(Smalltalk.ResourceIdentifier) ##(Smalltalk.MethodSourcePresenter) #resource_Default_view nil 786 138 144 34 1 850 #createAt:extent: 34 2 514 1 521 514 1569 513 2768 1026 8 #[44 0 0 0 0 0 0 0 1 0 0 0 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 0 0 0 0 4 1 0 0 16 3 0 0 4 2 0 0] 2528 1088 nil 27 8 'codePane' nil 786 138 144 34 1 850 #createAt:extent: 34 2 514 1 51 514 1569 1033 2624 1026 8 #[44 0 0 0 0 0 0 0 1 0 0 0 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 0 0 0 0 25 0 0 0 16 3 0 0 29 2 0 0] 34 3 410 ##(Smalltalk.ContainerView) 34 15 nil 2624 34 2 8 1140850688 131073 3216 nil 466 496 nil 7 nil nil nil 3216 2690 170 176 34 4 410 ##(Smalltalk.ContainerView) 34 15 nil 3216 34 2 8 1140850688 131073 3344 nil 466 496 nil 7 nil nil nil 3344 2690 170 176 34 2 410 ##(Smalltalk.ListView) 34 30 nil 3344 34 2 8 1140920397 1025 3472 590662 2 ##(Smalltalk.ListModel) 138 144 2528 nil 1310726 ##(Smalltalk.IdentitySearchPolicy) 466 496 nil 7 265030 4 ##(Smalltalk.Menu) nil true 34 2 984134 2 ##(Smalltalk.CommandMenuItem) 1 1426 #browseObjectClass 8 '&Browse Object Class' 1 1 nil nil nil 3682 1 1426 #inspectVariable 8 'Inspect' 1 1 nil nil nil 8 '' nil 134217729 nil nil nil nil nil nil nil 3472 nil 8 4294904479 ##(Smalltalk.BasicListAbstract) nil 1049926 1 ##(Smalltalk.IconImageManager) nil nil nil nil nil nil 138 144 34 3 920646 5 ##(Smalltalk.ListViewColumn) 8 'Variable' 201 #left ##(Smalltalk.BasicListAbstract) ##(Smalltalk.SortedCollection) 787814 3 ##(Smalltalk.BlockClosure) 0 nil 1180966 ##(Smalltalk.CompiledExpression) 2 1 3936 8 'doIt' 8 '[:each | each key value]' 8 #[30 105 226 0 142 106] #key 3952 7 257 nil nil 3472 nil 1 nil nil 3890 8 'Value' 313 #left ##(Smalltalk.BasicListAbstract) ##(Smalltalk.SortedCollection) 3938 0 459302 ##(Smalltalk.Context) 1 1 nil nil 3970 0 9 ##(Smalltalk.UndefinedObject) 8 'doIt' 34 2 8 '[:each | each value]' 34 1 138 ##(Smalltalk.PoolDictionary) 2528 8 #[252 1 0 1 1 5 0 17 229 32 142 106 105] 17 257 nil nil 3472 nil 3 nil nil 3890 8 'OOP' 181 #right 459270 ##(Smalltalk.Message) #displayString 8 #() 4274 #<= 4304 3938 0 nil 3970 3 1 ##(Smalltalk.UndefinedObject) 8 'doIt' 8 '[:each | each key key asNumber]' 8 #[31 105 226 0 158 159 106] #key #asNumber 4336 7 257 nil nil 3472 nil 1 nil nil #report 2528 nil 131169 nil 34 4 nil nil 514 1 1 nil 786 138 144 34 3 850 #createAt:extent: 34 2 514 1 1 514 701 333 3472 850 #contextMenu: 34 1 3648 3472 850 #text: 34 1 8 'Variable' 3472 1026 8 #[44 0 0 0 0 0 0 0 1 0 0 0 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 0 0 0 0 0 0 0 0 94 1 0 0 166 0 0 0] 8 #() 1088 nil 27 5 true 170 192 34 4 3472 8 'variableList' 410 ##(Smalltalk.MultilineTextEdit) 34 16 nil 3344 34 2 8 1143017796 1025 4736 nil 466 496 nil 7 nil nil nil 4736 nil 8 4294906255 754 nil nil 9 786 138 144 34 1 850 #createAt:extent: 34 2 514 1 343 514 701 169 4736 1026 8 #[44 0 0 0 0 0 0 0 1 0 0 0 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 0 0 0 0 171 0 0 0 94 1 0 0 255 0 0 0] 8 #() 1088 nil 27 8 'variableData' nil 786 138 144 34 1 850 #createAt:extent: 34 2 514 869 1 514 701 511 3344 1026 8 #[44 0 0 0 0 0 0 0 1 0 0 0 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 178 1 0 0 0 0 0 0 16 3 0 0 255 0 0 0] 34 3 3472 410 ##(Smalltalk.Splitter) 34 12 nil 3344 34 2 8 1140850688 1 5184 nil 466 496 nil 519 nil nil nil 5184 786 138 144 34 1 850 #createAt:extent: 34 2 514 1 333 514 701 11 5184 1026 8 #[44 0 0 0 0 0 0 0 1 0 0 0 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 0 0 0 0 166 0 0 0 94 1 0 0 171 0 0 0] 8 #() 1088 nil 27 4736 1088 nil 27 524806 ##(Smalltalk.Fraction) 253 311 410 ##(Smalltalk.ContainerView) 34 15 nil 3216 34 2 8 1140850688 131073 5456 nil nil nil 7 nil nil nil 5456 546 170 176 34 6 410 ##(Smalltalk.PushButton) 34 20 nil 5456 34 2 8 1140924416 1 5568 nil nil nil 7 nil nil nil 5568 nil 8 4294906371 1426 #terminateProcess 8 'Terminate' 1 1 nil nil false nil nil nil 786 138 144 34 3 850 #createAt:extent: 34 2 514 719 1 514 141 51 5568 850 #isEnabled: 8 #(false) 5568 850 #text: 34 1 8 'Terminate' 5568 1026 8 #[44 0 0 0 0 0 0 0 1 0 0 0 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 103 1 0 0 0 0 0 0 173 1 0 0 25 0 0 0] 8 #() 1088 nil 29 1106 1138 #fixedPreviousRight 1 1168 1 1184 1 1200 51 410 ##(Smalltalk.ComboBox) 34 17 nil 5456 34 2 8 1412498947 1025 5952 3538 138 144 2528 nil 3600 466 8 4278190080 nil 7 nil nil nil 5952 nil 8 4294904581 3938 0 nil 3970 2 1 ##(Smalltalk.UndefinedObject) 8 'doIt' 8 '[:each | each printString]' 8 #[30 105 226 0 106] #printString 6096 7 257 nil 2528 401 786 138 144 34 1 850 #createAt:extent: 34 2 514 1 1 514 719 53 5952 1026 8 #[44 0 0 0 0 0 0 0 1 0 0 0 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 0 0 0 0 0 0 0 0 103 1 0 0 26 0 0 0] 8 #() 1088 nil 27 1106 1152 1 1168 -139 1184 1 1200 47 410 ##(Smalltalk.ListBox) 34 17 nil 5456 34 2 8 1144062209 1025 6352 3538 138 144 2528 nil 3600 466 496 nil 7 3634 nil true 34 3 3682 1 1426 #browseFrameMethod 8 '&Browse Frame Method' 1 1 nil nil nil 3682 1 1426 #browseImplementors 8 'Browse &Implementors' 1 1 nil nil nil 3682 1 1426 #browseSenders 8 'Browse &Senders' 1 1 nil nil nil 8 '' nil 134217729 nil nil nil nil nil nil nil 6352 nil 8 4294906549 ##(Smalltalk.BasicListAbstract) 2528 false 786 138 144 34 3 850 #createAt:extent: 34 2 514 1 51 514 859 461 6352 850 #contextMenu: 34 1 6464 6352 850 #horizontalExtent: 8 #(0) 6352 1026 8 #[44 0 0 0 0 0 0 0 1 0 0 0 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 0 0 0 0 25 0 0 0 173 1 0 0 255 0 0 0] 8 #() 1088 nil 27 1106 1152 1 1168 1 1138 #fixedPreviousBottom 1 1138 #fixedParentBottom 1 170 192 34 4 5952 8 'processList' 6352 8 'frameList' nil 786 138 144 34 1 850 #createAt:extent: 34 2 514 1 1 514 859 511 5456 1026 8 #[44 0 0 0 0 0 0 0 1 0 0 0 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 0 0 0 0 0 0 0 0 173 1 0 0 255 0 0 0] 34 3 5952 5568 6352 1088 nil 27 3 false 170 192 2528 nil 786 138 144 34 1 850 #createAt:extent: 34 2 514 1 1 514 1569 511 3216 1026 8 #[44 0 0 0 0 0 0 0 1 0 0 0 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 0 0 0 0 0 0 0 0 16 3 0 0 255 0 0 0] 34 3 5456 410 ##(Smalltalk.Splitter) 34 12 nil 3216 34 2 8 1140850688 1 7344 nil 466 496 nil 519 nil nil nil 7344 786 138 144 34 1 850 #createAt:extent: 34 2 514 859 1 514 11 511 7344 1026 8 #[44 0 0 0 0 0 0 0 1 0 0 0 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 173 1 0 0 0 0 0 0 178 1 0 0 255 0 0 0] 8 #() 1088 nil 27 3344 1088 nil 27 410 ##(Smalltalk.Splitter) 34 12 nil 2624 34 2 8 1140850688 1 7584 nil 466 496 nil 519 nil nil nil 7584 786 138 144 34 1 850 #createAt:extent: 34 2 514 1 511 514 1569 11 7584 1026 8 #[44 0 0 0 0 0 0 0 1 0 0 0 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 0 0 0 0 255 0 0 0 16 3 0 0 4 1 0 0] 8 #() 1088 nil 27 2768 1088 nil 27 1106 1152 1 1168 1 1184 51 6928 1 170 192 34 4 608 8 'errorMessage' 1216 8 'toolbar' nil 461638 4 ##(Smalltalk.MenuBar) nil true 34 3 3634 nil true 34 1 3682 1 1426 #saveMethod 8 '&Save' 9383 1 nil nil nil 8 '&File' nil 134217729 nil nil 24357 nil nil 3634 nil true 34 6 3682 1 1426 #copyStack nil 1 1 nil nil nil 983366 1 ##(Smalltalk.DividerMenuItem) 4097 3682 1 1426 #jadeInspect 8 '&Inspect' 9379 1 nil nil nil 3682 1 1426 #jadeDisplay 8 '&Display' 9353 1 nil nil nil 3682 1 1426 #jadeExecute 8 '&Execute' 9355 1 nil nil nil 3682 1 1426 #jadeDebug 8 'Debu&g' 9359 1 nil nil nil 8 '&Edit' nil 134217729 nil nil 24369 nil nil 3634 nil true 34 7 3682 1 1426 #showNextStatement 8 'Top of Stack' 1 1 1474 nil true 1520 8 'ShowNextStatement.ico' 1568 nil nil 3682 1 1426 #stepInto nil 1 1 1474 nil true 1520 8 'StepInto.ico' 1568 nil nil 3682 1 1426 #stepOver nil 1 1 1474 nil true 1520 8 'StepOver.ico' 1568 nil nil 3682 1 1426 #stepOut nil 1 1 1474 nil true 1520 8 'StepOut.ico' 1568 nil nil 3682 1 1426 #runToCursor nil 1 1 1474 nil true 1520 8 'RunToCursor.ico' 1568 nil nil 3682 1 1426 #resumeProcess 8 'Resume' 1 1 1474 nil true 1520 8 'Run.ico' 1568 nil nil 3682 1 1426 #restart nil 1 1 1474 nil true 1520 8 'Up.ico' 1568 nil nil 8 '&Debug' nil 134217729 nil nil 24385 nil nil 8 '' nil 134217729 nil nil nil nil nil nil nil nil 1 1474 nil true 1520 8 'icons\GS32.ico' nil 1474 nil true 1520 8 'icons\GS16.ico' nil nil nil 1 nil nil 786 138 144 34 3 850 #createAt:extent: 34 2 514 7679 21 514 1601 1201 416 850 #text: 34 1 8 'Jade Debugger' 416 850 #updateMenuBar 2528 416 1026 8 #[44 0 0 0 0 0 0 0 0 0 0 0 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 14 0 0 10 0 0 0 31 18 0 0 98 2 0 0] 34 3 608 1216 2624 1088 nil 27 )! + semaphore "Support for automated testing so we know when UI is ready" @@ -396,6 +412,7 @@ signalSemaphore !RowanDebugger class categoriesFor: #aboutToShowErrorShellOn:!public! ! !RowanDebugger class categoriesFor: #debuggerClass!public! ! !RowanDebugger class categoriesFor: #debuggerClass:!public! ! +!RowanDebugger class categoriesFor: #resource_Default_view!public!resources-views! ! !RowanDebugger class categoriesFor: #semaphore!public! ! !RowanDebugger class categoriesFor: #semaphore:!public! ! !RowanDebugger class categoriesFor: #signalSemaphore!public! ! diff --git a/sources/RowanMethodService.cls b/sources/RowanMethodService.cls index ba778800..e8325e5a 100644 --- a/sources/RowanMethodService.cls +++ b/sources/RowanMethodService.cls @@ -42,6 +42,7 @@ appendToSourceMenu: aMenu presenter: methodSourcePresenter | stepPoint menuCommand messageSelector | stepPoint := self stepPointFromCursorIn: methodSourcePresenter. stepPoint isNil ifTrue: [^self]. + ('*Debug*' match: aMenu text) ifTrue: [^self]. "Don't add breakpoints to the Debug menu. Let's keep it in the context menu for consistency." aMenu addSeparator. menuCommand := self addBreakPointMenuAt: stepPoint