DebugView.st
changeset 13394 f196d8ddec24
parent 13388 65c95fd29280
child 13398 8d20abbafdb8
--- a/DebugView.st	Wed Aug 28 14:57:01 2013 +0200
+++ b/DebugView.st	Wed Aug 28 16:49:40 2013 +0200
@@ -725,6 +725,11 @@
               (
                (MenuItem
                   enabled: isStoppedAtHaltOrBreakPointOrSelectedContextIsWrapped
+                  label: 'Forever (Until Ignoring is Stopped)'
+                  itemValue: ignoreHaltForever
+                )
+               (MenuItem
+                  enabled: isStoppedAtHaltOrBreakPointOrSelectedContextIsWrapped
                   label: 'For Some Time...'
                   itemValue: openIgnoreHaltUntilTimeElapsedDialog
                 )
@@ -735,8 +740,11 @@
                 )
                (MenuItem
                   enabled: isStoppedAtHaltOrBreakPointOrSelectedContextIsWrapped
-                  label: 'For this Receiver Class'
-                  itemValue: ignoreHaltForThisReceiverClass
+                  label: 'Until Shift-Key is Pressed'
+                  itemValue: ignoreHaltUntilShiftKeyIsPressed
+                )
+               (MenuItem
+                  label: '-'
                 )
                (MenuItem
                   enabled: isStoppedAtHaltOrBreakPointOrSelectedContextIsWrapped
@@ -745,13 +753,8 @@
                 )
                (MenuItem
                   enabled: isStoppedAtHaltOrBreakPointOrSelectedContextIsWrapped
-                  label: 'Until Shift-Key is Pressed'
-                  itemValue: ignoreHaltUntilShiftKeyIsPressed
-                )
-               (MenuItem
-                  enabled: isStoppedAtHaltOrBreakPointOrSelectedContextIsWrapped
-                  label: 'Forever (Until Ignoring is Stopped)'
-                  itemValue: ignoreHaltForever
+                  label: 'For this Receiver Class'
+                  itemValue: ignoreHaltForThisReceiverClass
                 )
                )
               nil
@@ -766,6 +769,11 @@
               (
                (MenuItem
                   enabled: isStoppedAtBreakPointWithParameter
+                  label: 'Forever (Reenable in BreakPoint-Browser)'
+                  itemValue: ignoreBreakpointsWithThisParameterForever
+                )
+               (MenuItem
+                  enabled: isStoppedAtBreakPointWithParameter
                   label: 'For Some Time...'
                   itemValue: openIgnoreBreakpointsWithThisParameterUntilTimeElapsedDialog
                 )
@@ -779,11 +787,6 @@
                   label: 'Until Shift-Key is Pressed'
                   itemValue: ignoreBreakpointsWithThisParameterUntilShiftKeyIsPressed
                 )
-               (MenuItem
-                  enabled: isStoppedAtBreakPointWithParameter
-                  label: 'Forever (Reenable in BreakPoint-Browser)'
-                  itemValue: ignoreBreakpointsWithThisParameterForever
-                )
                )
               nil
               nil
@@ -795,6 +798,10 @@
            (Menu
               (
                (MenuItem
+                  label: 'Forever (Until Ignoring is Stopped)'
+                  itemValue: ignoreAllHaltsForever
+                )
+               (MenuItem
                   label: 'For Some Time...'
                   itemValue: openIgnoreAllHaltsUntilTimeElapsedDialog
                 )
@@ -802,10 +809,6 @@
                   label: 'Until Shift-Key is Pressed'
                   itemValue: ignoreAllHaltsUntilShiftKeyIsPressed
                 )
-               (MenuItem
-                  label: 'Forever (Until Ignoring is Stopped)'
-                  itemValue: ignoreAllHaltsForever
-                )
                )
               nil
               nil
@@ -7673,27 +7676,20 @@
 !
 
 codeAccept:someCode
-    "user wants some code to be recompiled - must unwind stack since everything above
-     and including selected method cannot be continued."
-
-    ^ self codeAccept:someCode unwind:false "true" category:nil onCancel:nil
+    "user wants some code to be recompiled"
+
+    ^ self codeAccept:someCode unwind:false category:nil onCancel:nil
 
     "Modified: / 28-11-2006 / 19:49:04 / cg"
 !
 
 codeAccept:someCode inClass:aClass unwind:doUnwind category:category onCancel:cancelAction
-    "user wants some code to be recompiled - must unwind stack since everything above
-     and including selected method cannot be continued."
-
-    "
-     actually, this is not true, since the active methods will still be
-     executed correctly - however, the code shown in the debugger is no
-     longer in sync (showing the new code) with the executed code.
-     Therefore, we hide those contexts to avoid confusion ....
-     If you dont like this behavior, remove the 'inspecting ifFalse:' check below"
-
-    "walk up context chain and find highest context which is either the selected context,
-     or - if its a block-context - whose home is the selected context"
+    "user wants some code to be recompiled.
+     Optionally unwind stack to right above the changed method.
+     this is a leftover from times, when the debugger had no chance to
+     show the original code. Now, it can, and got a choice-field to select
+     between original and changed code. So the undwind option is not longer used
+     and probably completely obsolete now (aka: always called with doUnwind==false, these days)"
 
     |con top newMethod|
 
@@ -7713,9 +7709,8 @@
         ].
 
         "/
-        "/ provide the classes nameSpace on a query;
-        "/ in case we accept while in another nameSpace context,
-        "/ (but for a class which is somewhere else)
+        "/ provide the classes nameSpace and changefile-update answers;
+        "/ in case we accept while in another context, to not capture these settings again
         "/
         (Class updateChangeFileQuerySignal,
          Class updateChangeListQuerySignal,
@@ -7724,7 +7719,7 @@
             Class nameSpaceQuerySignal
             answer:(aClass nameSpace)
             do:[
-                "/ the compiler already cares for the package...
+                "/ the compiler nowadays already cares for the package...
 
 "/                Class packageQuerySignal
 "/                answer:(aClass package ? PackageId noProjectID)
@@ -7747,14 +7742,14 @@
         methodCodeToggle beVisible.
 
         inspecting ifFalse:[
-            "
-             if it worked, remove everything up to and including top
-             from context chain
-            "
             (newMethod notNil and:[newMethod ~~ #Error]) ifTrue:[
                 codeView modified:false.
 
                 doUnwind ifTrue:[
+                    "/ if it worked, and doUnwind is true,
+                    "/ remove everything up to and including top
+                    "/ from the context chain
+
                     selectedContext canReturn ifTrue:[
                         self setContext:(top "sender").
                         exitAction := #restart.
@@ -7764,18 +7759,7 @@
                         self setContext:(top sender).
                         exitAction := #return.
                     ].
-
-                    "
-                     continue/step is no longer possible
-                    "
-                    "/ continueButton disable.
-                    "/ canContinue := false.
                 ].
-
-                "/ contextView selection:1.
-
-                "/ self showSelection:1.
-                "/ contextView makeSelectionVisible. "/ scrollToLine:(selection - 1)
             ] ifFalse:[
                 ^ cancelAction value
             ]
@@ -7787,18 +7771,7 @@
 !
 
 codeAccept:someCode unwind:doUnwind category:givenCategoryOrNil onCancel:cancelAction
-    "user wants some code to be recompiled - must unwind stack since everything above
-     and including selected method cannot be continued."
-
-    "
-     actually, this is not true, since the active methods will still be
-     executed correctly - however, the code shown in the debugger is no
-     longer in sync (showing the new code) with the executed code.
-     Therefore, we hide those contexts to avoid confusion ....
-     If you dont like this behavior, remove the 'inspecting ifFalse:' check below"
-
-    "walk up context chain and find highest context which is either the selected context,
-     or - if its a block-context - whose home is the selected context"
+    "user wants some code to be recompiled"
 
     |sel implementorClass receiverClass method category|
 
@@ -8298,15 +8271,16 @@
             code isNil ifTrue:[
                 errMsg := nil.
                 method isNil ifTrue:[
-                    "/ fall back heuristics
+                    "/ fall back heuristics (see how this was called, fetch block from caller)
+                    sender := con sender.
                     con isBlockContext ifTrue:[
-                        ((sender := con sender) notNil
+                        (sender notNil
                         and:[((sender selector ? '') startsWith:'value')
                         and:[sender receiver isBlock]]) ifTrue:[
                             code := sender receiver source.
                         ]
                     ] ifFalse:[
-                        ((sender := con sender) notNil
+                        (sender notNil
                         and:[((sender selector ? '') startsWith:'valueWith')
                         and:[sender receiver isMethod]]) ifTrue:[
                             method := sender receiver.
@@ -8489,7 +8463,7 @@
                     [:theCode |
                          evaluatorClass
                              evaluate:theCode
-                             in:actualContext
+                             in:actualContext "/ (selectedContext ? actualContext)
                              receiver:rec
                              notifying:codeView
                              logged:true
@@ -8540,7 +8514,7 @@
 
     "Created: / 14-08-1997 / 20:15:00 / cg"
     "Modified: / 05-10-2011 / 11:55:14 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-    "Modified: / 23-07-2012 / 12:23:49 / cg"
+    "Modified: / 28-08-2013 / 15:13:02 / cg"
 ! !
 
 !DebugView::IgnoredHaltOrBreakpoint methodsFor:'accessing'!
@@ -8860,15 +8834,15 @@
 !DebugView class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libtool/DebugView.st,v 1.619 2013-08-27 16:50:05 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libtool/DebugView.st,v 1.620 2013-08-28 14:49:40 cg Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libtool/DebugView.st,v 1.619 2013-08-27 16:50:05 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libtool/DebugView.st,v 1.620 2013-08-28 14:49:40 cg Exp $'
 !
 
 version_SVN
-    ^ '$Id: DebugView.st,v 1.619 2013-08-27 16:50:05 cg Exp $'
+    ^ '$Id: DebugView.st,v 1.620 2013-08-28 14:49:40 cg Exp $'
 ! !