option to hide enumeration code impl.
authorClaus Gittinger <cg@exept.de>
Sun, 10 Jun 2012 20:55:58 +0200
changeset 11571 797d5fa9c634
parent 11570 4981b01822ff
child 11572 29a4d0eb6458
option to hide enumeration code impl.
DebugView.st
--- a/DebugView.st	Sun Jun 10 18:36:37 2012 +0200
+++ b/DebugView.st	Sun Jun 10 20:55:58 2012 +0200
@@ -28,7 +28,8 @@
 		canShowMore exitAbort reportButton setOfHiddenCallingSelectors
 		isStoppedAtHaltOrBreakPoint exceptionInfoLabel methodCodeToggle
 		methodCodeToggleSelectionHolder
-		isStoppedAtBreakPointWithParameter breakPointParameter'
+		isStoppedAtBreakPointWithParameter breakPointParameter
+		hideEnumerationCode'
 	classVariableNames:'CachedDebugger CachedExclusive OpenDebuggers MoreDebuggingDetail
 		DebuggingDebugger DefaultDebuggerBackgroundColor
 		InitialNChainShown IgnoredHalts ShowThreadID LastIgnoreHaltNTimes
@@ -794,6 +795,18 @@
                   isVisible: showingVerboseWalkback
                 )
                (MenuItem
+                  label: 'Show Enumeration Code (Implementation in Collection)'
+                  itemValue: showEnumerationCode
+                  translateLabel: true
+                  isVisible: notShowingEnumerationCode
+                )
+               (MenuItem
+                  label: 'Hide Enumeration Code (Implementation in Collection)'
+                  itemValue: hideEnumerationCode
+                  translateLabel: true
+                  isVisible: showingEnumerationCode
+                )
+               (MenuItem
                   label: '-'
                 )
                (MenuItem
@@ -1185,7 +1198,7 @@
         nil
       )
 
-    "Modified: / 23-03-2012 / 12:52:50 / cg"
+    "Modified: / 10-06-2012 / 20:53:55 / cg"
 ! !
 
 !DebugView class methodsFor:'misc'!
@@ -2463,6 +2476,7 @@
     font := font onDevice:device.
 
     verboseBacktrace := UserPreferences current verboseBacktraceInDebugger.
+    hideEnumerationCode := UserPreferences current hideEnumerationCodeInDebugger.
     ignoreBreakpoints := true.    "/ ignore halts/breakpoints in doIts of
                                   "/ the debugger
 
@@ -2586,7 +2600,7 @@
      Debugger newDebugger
     "
 
-    "Modified: / 01-03-2012 / 14:28:38 / cg"
+    "Modified: / 09-06-2012 / 15:28:57 / cg"
 !
 
 initializeAbortButtonIn:bpanel
@@ -4568,6 +4582,13 @@
     OperatingSystem exit
 !
 
+hideEnumerationCode
+    hideEnumerationCode := true.
+    self redisplayBacktrace.
+
+    "Created: / 10-06-2012 / 20:38:00 / cg"
+!
+
 inspectContext
     "launch an inspector on the currently selected context"
 
@@ -4681,6 +4702,12 @@
     "Modified: / 19-05-2010 / 11:49:56 / cg"
 !
 
+notShowingEnumerationCode
+    ^ hideEnumerationCode == true.
+
+    "Created: / 10-06-2012 / 20:32:55 / cg"
+!
+
 openAboutThisApplication
     "opens an about box for this application."
 
@@ -4760,6 +4787,13 @@
     "Modified: / 17.11.2001 / 22:39:48 / cg"
 !
 
+showEnumerationCode
+    hideEnumerationCode := false.
+    self redisplayBacktrace.
+
+    "Created: / 10-06-2012 / 20:37:25 / cg"
+!
+
 showMore
     "double the number of contexts shown"
 
@@ -4791,6 +4825,12 @@
     "Created: / 17.11.2001 / 20:13:53 / cg"
 !
 
+showingEnumerationCode
+    ^ hideEnumerationCode == false.
+
+    "Created: / 10-06-2012 / 20:32:45 / cg"
+!
+
 showingVerboseWalkback
     ^ verboseBacktrace == true.
 
@@ -4839,6 +4879,17 @@
     "Modified: 3.3.1997 / 20:56:32 / cg"
 !
 
+toggleShowEnumerationCode
+    hideEnumerationCode ifTrue:[
+        self showEnumerationCode
+    ] ifTrue:[
+        self hideEnumerationCode
+    ].
+
+    "Modified: / 17-11-2001 / 20:07:45 / cg"
+    "Created: / 10-06-2012 / 20:36:07 / cg"
+!
+
 toggleVerboseWalkback
     verboseBacktrace ifFalse:[
         self showVerboseWalkback
@@ -5915,6 +5966,18 @@
     "Created: / 21-05-2007 / 13:30:24 / cg"
 !
 
+is:aHomeContext inCallingChainOf:aContext
+    |con|
+
+    con := aContext.
+    [con notNil and:[con ~~ aHomeContext]] whileTrue:[
+        con := con sender
+    ].
+    ^ con notNil
+
+    "Created: / 10-06-2012 / 18:46:29 / cg"
+!
+
 setContext:aContext
     "show calling chain from aContext in the walk-back listview"
 
@@ -5928,7 +5991,7 @@
      Most complications here arise from filtering less-interesting contexts
      if not in verbose-context mode."
 
-    |con text method caller caller2 called called2 m count c cc
+    |con text method caller caller2 called called2 m count c cc sndr
      suspendContext calledBySuspendContext nm h calledContext|
 
     (contextArray size > 0 and:[aContext == (contextArray at:1)]) ifTrue:[
@@ -6073,6 +6136,24 @@
 "/                ].
             ].
 
+            "/ with hidden enumeration code, skip over internals of the enumeration
+            hideEnumerationCode == true ifTrue:[
+                (con isBlockContext
+                and:[ (h := con home) notNil
+                and:[ (self is:h inCallingChainOf:con) ]]) ifTrue:[
+                    c := con.
+                    [ c notNil and:[ 
+                        sndr := c sender.
+                        (sndr ~= h) and:[ c receiver isCollection ]] 
+                    ] whileTrue:[ 
+                        c := sndr 
+                    ].
+                    c notNil ifTrue:[
+                        con := h.
+                    ].
+                ].
+            ].
+
             "/
             "/ kludge: if its a wrapped method, then hide the wrap-call
             "/
@@ -6116,7 +6197,7 @@
             ] ifFalse:[
                 calledContext := con.
                 con := con sender
-            ]
+            ].
         ].
 
         "
@@ -6174,7 +6255,7 @@
     ^ true
 
     "Created: / 14-12-1995 / 19:10:31 / cg"
-    "Modified: / 06-03-2012 / 12:23:46 / cg"
+    "Modified: / 10-06-2012 / 20:52:49 / cg"
 !
 
 setContextSkippingInterruptContexts:aContext
@@ -7706,11 +7787,11 @@
 !DebugView class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libtool/DebugView.st,v 1.539 2012-03-23 11:54:22 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libtool/DebugView.st,v 1.540 2012-06-10 18:55:58 cg Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libtool/DebugView.st,v 1.539 2012-03-23 11:54:22 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libtool/DebugView.st,v 1.540 2012-06-10 18:55:58 cg Exp $'
 !
 
 version_SVN