DebugView.st
branchjv
changeset 12265 f1b3696cf042
parent 12262 d25ef6bb0ef3
child 12268 cb43ab66c093
--- a/DebugView.st	Tue Jul 24 18:17:26 2012 +0100
+++ b/DebugView.st	Wed Jul 25 10:51:30 2012 +0100
@@ -34,7 +34,7 @@
 		DebuggingDebugger DebuggingDebugger2
 		DefaultDebuggerBackgroundColor InitialNChainShown IgnoredHalts
 		ShowThreadID LastIgnoreHaltNTimes LastIgnoreHaltDuration
-		LastExtent LastOrigin RememberedCallChain'
+		LastExtent LastOrigin RememberedCallChain DebuggingDebugger3'
 	poolDictionaries:''
 	category:'Interface-Debugger'
 !
@@ -792,10 +792,19 @@
                (MenuItem
                   enabled: canShowMore
                   label: 'Show More WalkBack'
-                  itemValue: showMore
+                  itemValue: showMoreWalkback
                   translateLabel: true
                 )
                (MenuItem
+                  enabled: canShowMore
+                  label: 'Show Full WalkBack'
+                  itemValue: showFullWalkback
+                  translateLabel: true
+                )
+               (MenuItem
+                  label: '-'
+                )
+               (MenuItem
                   label: 'Show Verbose WalkBack'
                   itemValue: toggleVerboseWalkback
                   translateLabel: true
@@ -988,15 +997,18 @@
                   label: 'Browse Receivers Class Hierarchy'
                   itemValue: browseClassHierarchy
                   translateLabel: true
+                  isVisible: false
                 )
                (MenuItem
                   enabled: canBrowseFullClassProtocol
                   label: 'Browse Receivers Full Protocol'
                   itemValue: browseFullClassProtocol
                   translateLabel: true
+                  isVisible: false
                 )
                (MenuItem
                   label: '-'
+                  isVisible: false
                 )
                (MenuItem
                   enabled: canBrowseProcessesApplication
@@ -1221,7 +1233,7 @@
         nil
       )
 
-    "Modified: / 18-07-2012 / 17:18:32 / cg"
+    "Modified: / 23-07-2012 / 12:41:03 / cg"
 ! !
 
 !DebugView class methodsFor:'misc'!
@@ -3082,18 +3094,20 @@
 
 stepInterrupt
     DebuggingDebugger == true ifTrue:[
-        'stepIRQ' printCR.
-        thisContext sender fullPrint.
+        'stepIRQ' print.
+        "/ ' in ' print. thisContext sender fullPrint.
+        '' printCR.
     ].
     Processor yield.
     self stepOrNext
 
-    "Modified: / 13.1.1998 / 21:14:11 / cg"
+    "Modified: / 20-07-2012 / 14:06:54 / cg"
 !
 
 stepOrNext
-    |where here con s isWrap method wrappedMethod originalMethodOfWrappedMethod originalMethodsContext
-     inBlock subBlockLeft ignore contextBelow lastWrappedContext
+    |where here con s isWrap method wrappedMethod 
+     originalMethodOfWrappedMethod originalMethodsContext
+     inBlock subBlockLeft ignore contextBelow wrapContext
      leftWrap enteredWrap anyStepBlocks
      oneMore initiallyShown inBlockBelow receiver processName|
 
@@ -3101,6 +3115,7 @@
     "/ DebuggingDebugger := false
     "/ DebuggingDebugger2 := true
     "/ DebuggingDebugger2 := false
+    "/ DebuggingDebugger3 := false
     "/ '' printCR
 
     processName := (Processor activeProcess nameOrId),' [',Processor activeProcess id printString,']'.
@@ -3141,11 +3156,16 @@
     here := here sender.        "the interrupted context"
 
     DebuggingDebugger2 == true ifTrue:[
-        '*******' printCR.
+        '***************************' printCR.
         'here in ' print.
         inWrap ifTrue:['(wrap) ' print.].
         ((ObjectMemory addressOf:here) printStringRadix:16) print. ' ' print.
         here selector printCR.
+        'stepping in ' print. 
+        steppedContext notNil ifTrue:[    
+            ((ObjectMemory addressOf:steppedContext) printStringRadix:16) print. ' ' print.
+        ].
+        steppedContext printCR.
     ].
 
     "/ kludge an bug-workaround;
@@ -3205,7 +3225,7 @@
     ].
 
     "
-     kludge to hide breakpoint wrappers in the context list:
+     kludge to hide breakpoint wrappers in the context list and when single stepping:
          check if we are in a wrapper method's hidden setup-sequence
          if so, ignore the interrupt and continue single sending.
          Assume we are in a wrappers setup code, if there is another context above,
@@ -3219,59 +3239,79 @@
     inWrap ifTrue:[
         "/ situation1:
         "/   valueWithReceiver or other
-        "/   foo (wrapped)
+        "/   foo (wrapped)                 <- wrapContext
         "/
         "/ situation2:
-        "/   foo (original)
+        "/   foo (original)                <- originalMethodsContext
         "/   valueWithReceiver
-        "/   foo (wrapped)
+        "/   foo (wrapped)                 <- wrapContext
         "/
         "/ situation3:
         "/   other
-        "/   foo (original)
+        "/   foo (original)                <- originalMethodsContext
         "/   valueWithReceiver
-        "/   foo (wrapped)
+        "/   foo (wrapped)                 <- wrapContext
+        "/
+        "/ situation4:
+        "/   ... many-contexts ... (more than 8)
+        "/   possibly foo (original)  
+        "/   valueWithReceiver or other
+        "/   foo (wrapped)                 
         "/
 
         "/ search for the wrapped method's context and extract the original method 
         where := here.
         8 timesRepeat:[
-            originalMethodOfWrappedMethod isNil ifTrue:[
+            wrapContext isNil ifTrue:[
                 where notNil ifTrue:[
+                    DebuggingDebugger2 ifTrue:[ 
+                        ((ObjectMemory addressOf:where) printStringRadix:16) print. ' ' print.
+                        where printCR 
+                    ].
                     where isBlockContext ifFalse:[
                         method := where method.
                         (method notNil and:[method isWrapped]) ifTrue:[
                             originalMethodOfWrappedMethod := method originalMethod.
-                            lastWrappedContext := where.
+                            wrappedMethod := method.
+                            wrapContext := where.
                         ].
                     ].
                     where := where sender
                 ]
             ]
         ].
+        DebuggingDebugger2 ifTrue:[ 
+            'wrap-context is: ' print.
+            wrapContext notNil ifTrue:[    
+                ((ObjectMemory addressOf:wrapContext) printStringRadix:16) print. ' ' print.
+            ].
+            wrapContext printCR 
+        ].
         originalMethodOfWrappedMethod isNil ifTrue:[
             'oops no wrap?' errorPrintCR.
-            inWrap := false.
-        ].
-    ].
-    inWrap ifTrue:[
+        ].
+    ].
+
+    (inWrap and:[ originalMethodOfWrappedMethod notNil ]) ifTrue:[
         isWrap := false.
-        wrappedMethod := nil.
-        DebuggingDebugger2 ifTrue:[ '----------->' print. originalMethodOfWrappedMethod printCR ].
+        "/ DebuggingDebugger2 ifTrue:[ '----------->' print. originalMethodOfWrappedMethod printCR ].
         where := here.
         8 timesRepeat:[
-            wrappedMethod isNil ifTrue:[
+            originalMethodsContext isNil ifTrue:[
                 where notNil ifTrue:[
+                    DebuggingDebugger2 ifTrue:[ 
+                        ((ObjectMemory addressOf:where) printStringRadix:16) print. ' ' print.
+                        where printCR 
+                    ].
                     where isBlockContext ifFalse:[
                         method := where method.
                         method == originalMethodOfWrappedMethod ifTrue:[
-                            wrappedMethod := method.
+                            originalMethodsContext := here.
                             where == here ifTrue:[
                                 "/ situation2
                                 DebuggingDebugger2 ifTrue:[ 's2' printCR ].
                                 isWrap := true.
-                                originalMethodsContext := here.
-                                "/ here setSender:(lastWrappedContext sender). --- leads to a crash
+                                "/ here setSender:(wrapContext sender). --- leads to a crash
                             ] ifFalse: [
                                 "/ situation3
                                 DebuggingDebugger2 ifTrue:[ 's3' printCR ].
@@ -3279,17 +3319,41 @@
                                 isWrap := false. 
                             ].
                             steppedContext := where
+"/                        ] ifFalse:[
+"/                            where selector == wrapContext selector ifTrue:[
+"/                                where receiver == wrapContext receiver ifTrue:[
+"/                                    '!!!!!!!!!!!!!!!!!!!!!!!!' printCR.
+"/                                    method printCR.
+"/                                    method originalMethod printCR.
+"/                                    originalMethodOfWrappedMethod printCR.
+"/                                    '!!!!!!!!!!!!!!!!!!!!!!!!' printCR.
+"/                                ].
+"/                            ].
                         ].
                         where := where sender
                     ].
                 ].
             ].
         ].
-        wrappedMethod isNil ifTrue:[
-            "/ situation1
-            DebuggingDebugger2 ifTrue:[ 's1' printCR ].
-            isWrap := true.
-            steppedContext := here
+        DebuggingDebugger2 ifTrue:[ 
+            'original method-context is: ' print.
+            originalMethodsContext notNil ifTrue:[
+                ((ObjectMemory addressOf:originalMethodsContext) printStringRadix:16) print. ' ' print.
+            ].
+            originalMethodsContext printCR 
+        ].
+        originalMethodsContext isNil ifTrue:[
+            originalMethodOfWrappedMethod isNil ifTrue:[
+                "/ situation4
+                DebuggingDebugger2 ifTrue:[ 's4' printCR ].
+                DebuggingDebugger2 ifTrue:[ steppedContext printCR ].
+                isWrap := false.
+            ] ifFalse:[
+                "/ situation1
+                DebuggingDebugger2 ifTrue:[ 's1' printCR ].
+                isWrap := true.
+                "/ steppedContext := wrapContext
+            ].
         ].
     ].
 
@@ -3672,7 +3736,7 @@
     con := nil
 
     "Created: / 14-10-1996 / 12:53:39 / cg"
-    "Modified (comment): / 18-07-2012 / 15:37:38 / cg"
+    "Modified: / 20-07-2012 / 15:26:26 / cg"
 ! !
 
 !DebugView methodsFor:'menu & button actions'!
@@ -3801,19 +3865,20 @@
 browseImplementingClass
     "browse the implementing class (of the selected context's message)"
 
-    |mthd who sel cls home|
-
-    selectedContext isNil ifTrue:[^ self].
-
-    mthd := selectedContext method.
+    |con mthd who sel cls home|
+
+    con := selectedContext ? actualContext.
+    con isNil ifTrue:[^ self].
+
+    mthd := con method.
     mthd notNil ifTrue:[
-        who := selectedContext method who.
+        who := mthd who.
         who notNil ifTrue:[
             cls := who methodClass.
             sel := who methodSelector.
         ] ifFalse:[
             "might have been re-accepted"
-            (home := selectedContext methodHome) notNil ifTrue:[
+            (home := con methodHome) notNil ifTrue:[
                 (sel := home selector) notNil ifTrue:[
                     cls := home receiver class 
                             whichClassImplements:selectedContext selector.
@@ -3826,13 +3891,13 @@
     ].
     cls isNil ifTrue:[
         "/ class not found - try receiver
-        cls := selectedContext receiver class
+        cls := con receiver class
     ].
 
     cls browserClass openInClass:cls selector:sel.
 
     "Created: / 22-11-1995 / 21:27:01 / cg"
-    "Modified: / 01-03-2012 / 14:21:11 / cg"
+    "Modified: / 19-07-2012 / 11:27:32 / cg"
 !
 
 browseImplementors
@@ -3842,8 +3907,12 @@
         ^ self showError:'** select a context first **'
     ].
     "/ selectedContext receiver class browserClass
-    UserPreferences systemBrowserClass
-         browseImplementorsOf:selectedContext selector.
+    self withWaitCursorDo:[
+        UserPreferences systemBrowserClass
+             browseImplementorsOf:selectedContext selector.
+    ]
+
+    "Modified: / 19-07-2012 / 11:44:03 / cg"
 !
 
 browseImplementorsOf
@@ -3862,12 +3931,15 @@
     selector := Dialog
                     requestSelector:'Selector to browse implementors of:'
                     initialAnswer:initial.
-    selector size == 0 ifFalse:[
-        UserPreferences systemBrowserClass
-            browseImplementorsMatching:selector.
+
+    selector notEmptyOrNil ifTrue:[
+        self withWaitCursorDo:[
+            UserPreferences systemBrowserClass
+                browseImplementorsMatching:selector.
+        ]
     ]
 
-    "Modified: / 6.2.2000 / 01:05:14 / cg"
+    "Modified: / 19-07-2012 / 11:43:52 / cg"
 !
 
 browseProcessesApplication
@@ -3894,14 +3966,19 @@
 
     selectedContext isNil ifTrue:[^ self].
 
-    cls := selectedContext receiver class.
-    sel := selectedContext selector.
+    selectedContext isCheapBlockContext ifTrue:[
+        cls := selectedContext method mclass.
+        sel := selectedContext method selector.
+    ] ifFalse:[
+        cls := selectedContext receiver class.
+        sel := selectedContext selector.
+    ].
     (cls includesSelector:sel) ifFalse:[
         sel := nil
     ].
     cls browserClass openInClass:cls selector:sel.
 
-    "Modified: / 3.2.1998 / 20:23:36 / cg"
+    "Modified: / 19-07-2012 / 11:29:48 / cg"
 !
 
 browseSenders
@@ -3910,8 +3987,12 @@
     selectedContext isNil ifTrue:[
         ^ self showError:'** select a context first **'
     ].
-    UserPreferences systemBrowserClass
-        browseAllCallsOn:selectedContext selector.
+    self withWaitCursorDo:[
+        UserPreferences systemBrowserClass
+            browseAllCallsOn:selectedContext selector.
+    ]
+
+    "Modified: / 19-07-2012 / 11:43:02 / cg"
 !
 
 browseSendersOf
@@ -3930,12 +4011,15 @@
     selector := Dialog
                     requestSelector:'Selector to browse senders of:'
                     initialAnswer:initial.
-    selector size == 0 ifFalse:[
-        UserPreferences systemBrowserClass
-            browseAllCallsOn:selector asSymbol.
+
+    selector notEmptyOrNil ifTrue:[
+        self withWaitCursorDo:[
+            UserPreferences systemBrowserClass
+                browseAllCallsOn:selector asSymbol.
+        ]
     ]
 
-    "Modified: / 6.2.2000 / 01:05:29 / cg"
+    "Modified: / 19-07-2012 / 11:43:29 / cg"
 !
 
 clearRememberedCallchain
@@ -4760,8 +4844,8 @@
                     ('-'                                                        )
                     ('Browse Implementing Class'      browseImplementingClass )
                     ('Browse Receivers Class'             browseReceiversClass    )
-                    ('Browse Receivers Class Hierarchy'   browseClassHierarchy    )
-                    ('Browse Receivers Full Protocol'     browseFullClassProtocol )
+"/                    ('Browse Receivers Class Hierarchy'   browseClassHierarchy    )
+"/                    ('Browse Receivers Full Protocol'     browseFullClassProtocol )
                     ('Implementors'                     browseImplementors      )
                     ('Implementors Of...'               browseImplementorsOf    )
                     ('Senders'                          browseSenders           )
@@ -4805,7 +4889,7 @@
 
     ^ m.
 
-    "Modified: / 19-05-2010 / 11:49:56 / cg"
+    "Modified: / 19-07-2012 / 11:31:57 / cg"
 !
 
 notShowingSupportCode
@@ -4904,6 +4988,17 @@
     "Modified: / 17.11.2001 / 22:39:48 / cg"
 !
 
+showFullWalkback
+    "double the number of contexts shown"
+
+    contextArray notNil ifTrue:[
+        nChainShown := 9999.
+        self redisplayBacktrace.
+    ]
+
+    "Created: / 23-07-2012 / 12:24:02 / cg"
+!
+
 showMore
     "double the number of contexts shown"
 
@@ -4999,7 +5094,7 @@
 toggleShowSupportCode
     hideSupportCode ifTrue:[
         self showSupportCode
-    ] ifTrue:[
+    ] ifFalse:[
         self hideSupportCode
     ].
 
@@ -5015,6 +5110,66 @@
     ].
 
     "Modified: / 17.11.2001 / 20:07:45 / cg"
+!
+
+updateMenuItems
+    |m mthd cls mCls rCls|
+
+    "
+     enable/disable some menu items
+    "
+    m := contextView middleButtonMenu.
+    m notNil ifTrue:[
+        m disable:#removeBreakpoint.
+        m disable:#addBreakpoint.
+        canShowMore ifFalse:[
+            m disable:#showMore
+        ].
+
+        selectedContext notNil ifTrue:[
+            m enableAll:#(browseImplementors browseSenders inspectContext skip skipForReturn).
+
+            mthd := selectedContext method.
+            mthd notNil ifTrue:[
+                cls := mCls := mthd containingClass.
+                mthd isBreakpointed ifTrue:[
+                    m enable:#removeBreakpoint.
+                ] ifFalse:[
+                    m enable:#addBreakpoint.
+                ]
+            ].
+            (selectedContext isBlockContext and:[selectedContext home isNil]) ifTrue:[
+                "/ a cheap block's context
+            ] ifFalse:[
+                rCls := selectedContext receiver class.
+                cls isNil ifTrue:[
+                    cls := rCls
+                ].
+            ].
+            cls notNil ifTrue:[
+                m enableAll:#(browseImplementingClass browseReceiversClass browseClassHierarchy browseFullClassProtocol).
+                rCls == mCls ifTrue:[
+                    m disable:#browseReceiversClass
+                ].
+                mCls isNil ifTrue:[
+                    m disable:#browseImplementingClass
+                ]
+
+            ] ifFalse:[
+                m disableAll:#(browseImplementingClass browseReceiversClass browseClassHierarchy browseFullClassProtocol).
+            ].
+            mthd notNil ifTrue:[
+                m enableAll:#(browseImplementingClass).
+            ].
+            selectedContext isCheapBlockContext ifTrue:[
+                m disableAll:#(browseReceiversClass).
+            ].
+        ] ifFalse:[
+            m disableAll:#(browseImplementingClass browseReceiversClass browseClassHierarchy browseFullClassProtocol).
+        ]
+    ]
+
+    "Modified: / 19-07-2012 / 11:53:30 / cg"
 ! !
 
 !DebugView methodsFor:'menu & button actions-breakpoints'!
@@ -5526,54 +5681,6 @@
     "Modified: 20.10.1996 / 18:11:24 / cg"
 !
 
-updateMenuItems
-    |m mthd cls mCls rCls|
-
-    "
-     enable/disable some menu items
-    "
-    m := contextView middleButtonMenu.
-    m notNil ifTrue:[
-        m disable:#removeBreakpoint.
-        m disable:#addBreakpoint.
-        canShowMore ifFalse:[
-            m disable:#showMore
-        ].
-
-        selectedContext notNil ifTrue:[
-            m enableAll:#(browseImplementors browseSenders inspectContext skip skipForReturn).
-
-            mthd := selectedContext method.
-            mthd notNil ifTrue:[
-                cls := mCls := mthd containingClass.
-                mthd isBreakpointed ifTrue:[
-                    m enable:#removeBreakpoint.
-                ] ifFalse:[
-                    m enable:#addBreakpoint.
-                ]
-            ].
-            rCls := selectedContext receiver class.
-            cls isNil ifTrue:[
-                cls := rCls
-            ].
-            cls notNil ifTrue:[
-                m enableAll:#(browseImplementingClass browseReceiversClass browseClassHierarchy browseFullClassProtocol).
-                rCls == mCls ifTrue:[
-                    m disable:#browseReceiversClass
-                ].
-                mCls isNil ifTrue:[
-                    m disable:#browseImplementingClass
-                ]
-
-            ] ifFalse:[
-                m disableAll:#(browseImplementingClass browseReceiversClass browseClassHierarchy browseFullClassProtocol).
-            ].
-        ] ifFalse:[
-            m disableAll:#(browseImplementingClass browseReceiversClass browseClassHierarchy browseFullClassProtocol).
-        ]
-    ]
-!
-
 withNodeValueAtInterval:interval do:aBlock
     |node definingNode nm nmBold varIdx parentNode receiver con receiversNonMetaClass|
 
@@ -5858,12 +5965,12 @@
     |con mthd|
 
     (con := self selectedContext) notNil ifTrue:[
-        mthd := con methodHome method.
+        mthd := con method.
         ^ mthd notNil and:[mthd isWrapped]
     ].
     ^ false.
 
-    "Modified (format): / 17-07-2012 / 12:53:57 / cg"
+    "Modified: / 19-07-2012 / 11:36:28 / cg"
 !
 
 setOfHiddenCallingSelectors
@@ -6210,7 +6317,7 @@
             ].
 
             [
-                DebuggingDebugger == true ifTrue:[
+                DebuggingDebugger3 == true ifTrue:[
                     'showingContext1: (' print. con print.
                     ') --> ' print. (self showingContext1:con calling:calledContext) printCR.
                 ].
@@ -6220,7 +6327,7 @@
                 con := con sender.
             ].
 
-            DebuggingDebugger == true ifTrue:[
+            DebuggingDebugger3 == true ifTrue:[
                 'showingContext2: (' print. con print.
                 ') --> ' print. (self showingContext2:con nesting:count) printCR.
             ].
@@ -6386,7 +6493,7 @@
     ^ true
 
     "Created: / 14-12-1995 / 19:10:31 / cg"
-    "Modified: / 18-07-2012 / 16:52:38 / cg"
+    "Modified: / 20-07-2012 / 13:16:36 / cg"
 !
 
 setContextSkippingInterruptContexts:aContext
@@ -6431,7 +6538,7 @@
         senderRec := aContext sender receiver
     ].
 
-    DebuggingDebugger == true ifTrue:[
+    DebuggingDebugger3 == true ifTrue:[
         'showingContext1: (' print. aContext print.
         ') calling: (' print. calledContext print.
         ')' printCR.
@@ -6514,7 +6621,7 @@
     ^ true
 
     "Created: / 17-11-2001 / 22:24:06 / cg"
-    "Modified: / 08-12-2010 / 18:21:02 / cg"
+    "Modified: / 20-07-2012 / 13:16:47 / cg"
 !
 
 showingContext2:aContext nesting:nesting
@@ -7190,44 +7297,39 @@
     currentMethod := aMethodOrNil.
 !
 
-showSelection:lineNr
+showSelection:lineNr 
     "user clicked on a header line - show selected code in textView.
      Also sent to autoselect an interesting context on entry."
-
-    Notification
-        handle:
-            [:ex |
-                "/ ex suspendedContext fullPrintAll.
-                Transcript showCR:ex description.
-                "/ Transcript showCR:ex parameter.
-                ex proceed
-            ]
-        do:
-            [
-                Error
-                    handle:
-                        [:ex |
-                            |s con|
-
-                            ex signal isControlInterrupt
-                                ifTrue:[
-                                    'DebugView [info]: halt/break ignored - while showing selection in debugger' infoPrintCR.
-                                    ex proceed
-                                ].
-
-                            ('DebugView [info]: error at %1 when showing selection in debugger ignored' bindWith:ex suspendedContext) infoPrintCR.
-
-                            s := '' writeStream.
-                            s nextPutLine:'**** error in debugger, while extracting source'.
-                            s nextPutLine:'****'.
-                            s nextPutAll: '**** '; nextPutLine:(ex description "withCRs").
-                            s nextPutLine:'****'.
-                            con := ex suspendedContext.
-                            s nextPutAll: '**** '; nextPutLine:(con printString).
-                            con := con sender.
-                            HaltInterrupt ignoreIn:[
-                                con fullPrintAllOn:s.
-                            ].
+    
+    Notification 
+        handle:[:ex | 
+            "/ ex suspendedContext fullPrintAll.
+            Transcript showCR:ex description.
+            "/ Transcript showCR:ex parameter.
+            ex proceed
+        ]
+        do:[
+            Error 
+                handle:[:ex | 
+                    |s con|
+
+                    ex signal isControlInterrupt ifTrue:[
+                        'DebugView [info]: halt/break ignored - while showing selection in debugger' 
+                            infoPrintCR.
+                        ex proceed
+                    ].
+                    ('DebugView [info]: error at %1 when showing selection in debugger ignored' 
+                        bindWith:ex suspendedContext) infoPrintCR.
+                    s := '' writeStream.
+                    s nextPutLine:'**** error in debugger, while extracting source'.
+                    s nextPutLine:'****'.
+                    s nextPutLine:'**** ',(ex description).
+                    s nextPutLine:'****'.
+                    con := ex suspendedContext.
+                    s nextPutLine:'**** ',(con printString).
+                    con := con sender.
+                    HaltInterrupt ignoreIn:[ con fullPrintAllOn:s. ].
+                    
 "/                            [con notNil] whileTrue:[
 "/                                Error catch:[:ex |
 "/                                    s nextPutAll: '**** '; nextPutLine:(con printString).
@@ -7239,16 +7341,14 @@
 "/                                    con := con sender.
 "/                                ]
 "/                            ].
-                            codeView contents:(s contents).
-                            ex return.
-                        ]
-                    do:
-                        [
-                            self doShowSelection:lineNr
-                        ]
-            ]
-
-    "Modified: / 04-07-2006 / 14:50:06 / cg"
+                    
+                    codeView contents:(s contents).
+                    ex return.
+                ]
+                do:[ self doShowSelection:lineNr ]
+        ]
+
+    "Modified: / 19-07-2012 / 10:56:58 / cg"
 !
 
 showStackInspectorFor:con
@@ -7355,27 +7455,28 @@
                  A future new block calling scheme will fix this
                  (passing the block instead of the home as block argument).
                 "
-
-                "temporary kludge - peek into the sender context.
-                 If its a do-like method and there is a single block variable
-                 in the args or temporaries, that must be the one.
-                 This helps in some cases.
-                "
-                (sender := con sender) notNil ifTrue:[
-                    tryVars := false.
-                    (selSender := sender selector) notNil ifTrue:[
-                        ((selSender endsWith:'do:') or:[selSender endsWith:'Do:']) ifTrue:[
-                            tryVars := true.
+                (method := con method) isNil ifTrue:[
+                    "temporary kludge - peek into the sender context.
+                     If its a do-like method and there is a single block variable
+                     in the args or temporaries, that must be the one.
+                     This helps in some cases.
+                    "
+                    (sender := con sender) notNil ifTrue:[
+                        tryVars := false.
+                        (selSender := sender selector) notNil ifTrue:[
+                            ((selSender endsWith:'do:') or:[selSender endsWith:'Do:']) ifTrue:[
+                                tryVars := true.
+                            ]
+                        ].
+                        tryVars ifTrue:[
+                            possibleBlocks := sender argsAndVars select:[:v | v isBlock].
+                            possibleBlocks := possibleBlocks select:[:b | b home isNil].
+                            possibleBlocks size == 1 ifTrue:[
+                                method := possibleBlocks first method.
+                            ].
                         ]
                     ].
-                    tryVars ifTrue:[
-                        possibleBlocks := sender argsAndVars select:[:v | v isBlock].
-                        possibleBlocks := possibleBlocks select:[:b | b home isNil].
-                        possibleBlocks size == 1 ifTrue:[
-                            method := possibleBlocks first method.
-                        ].
-                    ]
-                ].
+                ]
             ] ifFalse:[
                 "fetch rec here - so we won't need context in doItAction"
                 rec := homeContext receiver.
@@ -7631,7 +7732,7 @@
             ].
             self setCurrentMethod:method.
 
-            selectedContext := homeContext.
+            selectedContext := homeContext ? con.
             actualContext := con
         ].
     ] ifFalse:[
@@ -7673,7 +7774,7 @@
 
     "Created: / 14-08-1997 / 20:15:00 / cg"
     "Modified: / 05-10-2011 / 11:55:14 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-    "Modified: / 18-07-2012 / 15:42:11 / cg"
+    "Modified: / 23-07-2012 / 12:23:49 / cg"
 ! !
 
 !DebugView::IgnoredHaltOrBreakpoint methodsFor:'accessing'!
@@ -7922,15 +8023,15 @@
 !DebugView class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libtool/DebugView.st,v 1.544 2012/07/18 15:21:08 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libtool/DebugView.st,v 1.548 2012/07/23 10:43:16 cg Exp $'
 !
 
 version_CVS
-    ^ '§Header: /cvs/stx/stx/libtool/DebugView.st,v 1.544 2012/07/18 15:21:08 cg Exp §'
+    ^ '§Header: /cvs/stx/stx/libtool/DebugView.st,v 1.548 2012/07/23 10:43:16 cg Exp §'
 !
 
 version_SVN
-    ^ '$Id: DebugView.st 8018 2012-07-18 17:00:57Z vranyj1 $'
+    ^ '$Id: DebugView.st 8022 2012-07-25 09:51:30Z vranyj1 $'
 ! !
 
 DebugView initialize!
\ No newline at end of file