DebugView.st
changeset 13965 6213444511ae
parent 13934 ec9cc7cf19aa
child 14109 6269ce6fbb65
equal deleted inserted replaced
13964:3b15af5cb82a 13965:6213444511ae
  1762 "/            'DebugView [info]: ignored other interrupt while stepping' infoPrintCR.
  1762 "/            'DebugView [info]: ignored other interrupt while stepping' infoPrintCR.
  1763 "/            ^ self
  1763 "/            ^ self
  1764 "/        ].
  1764 "/        ].
  1765 "/    ].
  1765 "/    ].
  1766 
  1766 
  1767     iAmNew := drawableId isNil.
  1767     iAmNew := self drawableId isNil.
  1768 
  1768 
  1769     verboseBacktrace := UserPreferences current verboseBacktraceInDebugger.
  1769     verboseBacktrace := UserPreferences current verboseBacktraceInDebugger.
  1770 
  1770 
  1771     busy := cachable := true.
  1771     busy := cachable := true.
  1772     inspecting := false.
  1772     inspecting := false.
  1915         self cacheMyself.
  1915         self cacheMyself.
  1916         receiverInspector release.
  1916         receiverInspector release.
  1917         contextInspector release.
  1917         contextInspector release.
  1918 
  1918 
  1919         self unmap.
  1919         self unmap.
  1920         device flush.
  1920         self flush.
  1921 
  1921 
  1922         (exitAction == #abort) ifTrue:[ self exit_abort. "does not return" ].
  1922         (exitAction == #abort) ifTrue:[ self exit_abort. "does not return" ].
  1923         (exitAction == #abortAll) ifTrue:[ self exit_abortAll. "does not return" ].
  1923         (exitAction == #abortAll) ifTrue:[ self exit_abortAll. "does not return" ].
  1924         (exitAction == #return) ifTrue:[ self exit_return. "does not return" ].
  1924         (exitAction == #return) ifTrue:[ self exit_return. "does not return" ].
  1925         (exitAction == #restart) ifTrue:[ self exit_restart. "does not return" ].
  1925         (exitAction == #restart) ifTrue:[ self exit_restart. "does not return" ].
  1937     "/ stepping - window stays open
  1937     "/ stepping - window stays open
  1938     selectedContext := actualContext := firstContext := nil.
  1938     selectedContext := actualContext := firstContext := nil.
  1939 
  1939 
  1940     "/ restore the previous pointer grab
  1940     "/ restore the previous pointer grab
  1941     grabber notNil ifTrue:[
  1941     grabber notNil ifTrue:[
  1942         device grabPointerInView:grabber.
  1942         self graphicsDevice grabPointerInView:grabber.
  1943         grabber := nil.
  1943         grabber := nil.
  1944     ].
  1944     ].
  1945 
  1945 
  1946     (exitAction == #step) ifTrue:[
  1946     (exitAction == #step) ifTrue:[
  1947         "
  1947         "
  2330     continueButton label:(resources string:'Stop').
  2330     continueButton label:(resources string:'Stop').
  2331     w := w max:(continueButton preferredWidth).
  2331     w := w max:(continueButton preferredWidth).
  2332     continueButton preferredExtent:(w @ continueButton preferredHeight).
  2332     continueButton preferredExtent:(w @ continueButton preferredHeight).
  2333 
  2333 
  2334     aProcess state == #run ifTrue:[
  2334     aProcess state == #run ifTrue:[
  2335         device hasColors ifTrue:[
  2335         self graphicsDevice hasColors ifTrue:[
  2336             continueButton foregroundColor:Color red darkened.
  2336             continueButton foregroundColor:Color red darkened.
  2337         ].
  2337         ].
  2338         continueButton label:(resources string:'Stop').
  2338         continueButton label:(resources string:'Stop').
  2339         continueButton action:[self doStop].
  2339         continueButton action:[self doStop].
  2340     ] ifFalse:[
  2340     ] ifFalse:[
  2341         device hasColors ifTrue:[
  2341         self graphicsDevice hasColors ifTrue:[
  2342             continueButton foregroundColor:Color green darkened darkened.
  2342             continueButton foregroundColor:Color green darkened darkened.
  2343         ].
  2343         ].
  2344         continueButton label:(resources string:'Continue').
  2344         continueButton label:(resources string:'Continue').
  2345         continueButton action:[self doContinue].
  2345         continueButton action:[self doContinue].
  2346     ].
  2346     ].
  3354 
  3354 
  3355 reinitialize
  3355 reinitialize
  3356     "/ redefined - since the debugView runs on top of
  3356     "/ redefined - since the debugView runs on top of
  3357     "/ the debuggee, there would be no event loop for me.
  3357     "/ the debuggee, there would be no event loop for me.
  3358 
  3358 
  3359     drawableId notNil ifTrue:[
  3359     self drawableId notNil ifTrue:[
  3360         ^ self
  3360         ^ self
  3361     ].
  3361     ].
  3362     "physically create the view & subviews"
  3362     "physically create the view & subviews"
  3363     self recreate.
  3363     self recreate.
  3364 
       
  3365 !
  3364 !
  3366 
  3365 
  3367 releaseDebuggee
  3366 releaseDebuggee
  3368     "We have to be careful to release all refs to the debuggee,
  3367     "We have to be careful to release all refs to the debuggee,
  3369      because we may be in the cache.
  3368      because we may be in the cache.
  4617             ^ self
  4616             ^ self
  4618         ]
  4617         ]
  4619     ].
  4618     ].
  4620 
  4619 
  4621     inspecting ifTrue:[
  4620     inspecting ifTrue:[
  4622         device hasColors ifTrue:[
  4621         self graphicsDevice hasColors ifTrue:[
  4623             continueButton foregroundColor:Color red darkened.
  4622             continueButton foregroundColor:Color red darkened.
  4624         ].
  4623         ].
  4625         continueButton label:(resources string:'Stop').
  4624         continueButton label:(resources string:'Stop').
  4626         continueButton action:[self doStop].
  4625         continueButton action:[self doStop].
  4627 
  4626 
  5149 
  5148 
  5150 doStop
  5149 doStop
  5151     "stop the process (if its running, otherwise this is a no-op)"
  5150     "stop the process (if its running, otherwise this is a no-op)"
  5152 
  5151 
  5153     inspecting ifTrue:[
  5152     inspecting ifTrue:[
  5154         device hasColors ifTrue:[
  5153         self graphicsDevice hasColors ifTrue:[
  5155             continueButton foregroundColor:Color green darkened darkened.
  5154             continueButton foregroundColor:Color green darkened darkened.
  5156         ].
  5155         ].
  5157         continueButton label:(resources string:'Continue').
  5156         continueButton label:(resources string:'Continue').
  5158         continueButton action:[self doContinue].
  5157         continueButton action:[self doContinue].
  5159 
  5158 
  6235     shown ifTrue:[
  6234     shown ifTrue:[
  6236         exclusive ifTrue:[
  6235         exclusive ifTrue:[
  6237             "/ consider this a kludge:
  6236             "/ consider this a kludge:
  6238             "/ if exclusive, cannot use flash, since it suspends
  6237             "/ if exclusive, cannot use flash, since it suspends
  6239             "/ (but we cannot suspend here ...)
  6238             "/ (but we cannot suspend here ...)
  6240             codeView redrawInverted. device flush.
  6239             codeView redrawInverted. self flush.
  6241             OperatingSystem millisecondDelay:200.
  6240             OperatingSystem millisecondDelay:200.
  6242             codeView redraw
  6241             codeView redraw
  6243         ] ifFalse:[
  6242         ] ifFalse:[
  6244             codeView flash
  6243             codeView flash
  6245         ]
  6244         ]
  6759     cachable ~~ true ifTrue:[^ self].
  6758     cachable ~~ true ifTrue:[^ self].
  6760 
  6759 
  6761     "/
  6760     "/
  6762     "/ only cache if I am on the Display (i.e. the default screen)
  6761     "/ only cache if I am on the Display (i.e. the default screen)
  6763     "/
  6762     "/
  6764     device == Display ifTrue:[
  6763     self graphicsDevice == Display ifTrue:[
  6765         exclusive ifTrue:[
  6764         exclusive ifTrue:[
  6766             CachedExclusive := self
  6765             CachedExclusive := self
  6767         ] ifFalse:[
  6766         ] ifFalse:[
  6768             CachedDebugger := self
  6767             CachedDebugger := self
  6769         ].
  6768         ].
  7654 "/                    ex proceed
  7653 "/                    ex proceed
  7655 "/                ].
  7654 "/                ].
  7656 "/                self showError:ex description.
  7655 "/                self showError:ex description.
  7657 "/                ex proceed.
  7656 "/                ex proceed.
  7658 "/            ] do:[
  7657 "/            ] do:[
  7659                 device 
  7658                 self graphicsDevice
  7660                     dispatchModalWhile:[
  7659                     dispatchModalWhile:[
  7661                         Processor activeProcess state:#debug.
  7660                         Processor activeProcess state:#debug.
  7662                         haveControl].
  7661                         haveControl].
  7663 "/            ]
  7662 "/            ]
  7664         ].
  7663         ].
  7763             'DebugView [info]: caught exception - returning' infoPrintCR.
  7762             'DebugView [info]: caught exception - returning' infoPrintCR.
  7764             ex return.
  7763             ex return.
  7765         ] do:[
  7764         ] do:[
  7766             "/ make certain that sub-debuggers, inspectors etc.
  7765             "/ make certain that sub-debuggers, inspectors etc.
  7767             "/ come up on my device.
  7766             "/ come up on my device.
  7768             Screen currentScreenQuerySignal answer:device
  7767             Screen currentScreenQuerySignal answer:self graphicsDevice
  7769             do:[
  7768             do:[
  7770                 Dialog aboutToOpenBoxNotificationSignal
  7769                 Dialog aboutToOpenBoxNotificationSignal
  7771                     handle:[:ex | ex proceed ]
  7770                     handle:[:ex | ex proceed ]
  7772                     do:[
  7771                     do:[
  7773                         windowGroup
  7772                         windowGroup
  9064 ! !
  9063 ! !
  9065 
  9064 
  9066 !DebugView class methodsFor:'documentation'!
  9065 !DebugView class methodsFor:'documentation'!
  9067 
  9066 
  9068 version
  9067 version
  9069     ^ '$Header: /cvs/stx/stx/libtool/DebugView.st,v 1.645 2014-02-13 18:32:47 stefan Exp $'
  9068     ^ '$Header: /cvs/stx/stx/libtool/DebugView.st,v 1.646 2014-02-18 17:28:47 stefan Exp $'
  9070 !
  9069 !
  9071 
  9070 
  9072 version_CVS
  9071 version_CVS
  9073     ^ '$Header: /cvs/stx/stx/libtool/DebugView.st,v 1.645 2014-02-13 18:32:47 stefan Exp $'
  9072     ^ '$Header: /cvs/stx/stx/libtool/DebugView.st,v 1.646 2014-02-18 17:28:47 stefan Exp $'
  9074 !
  9073 !
  9075 
  9074 
  9076 version_SVN
  9075 version_SVN
  9077     ^ '$Id: DebugView.st,v 1.645 2014-02-13 18:32:47 stefan Exp $'
  9076     ^ '$Id: DebugView.st,v 1.646 2014-02-18 17:28:47 stefan Exp $'
  9078 ! !
  9077 ! !
  9079 
  9078 
  9080 
  9079 
  9081 DebugView initialize!
  9080 DebugView initialize!