DebugView.st
changeset 6132 ca1f04f5232b
parent 6129 4203bef24b27
child 6136 1ccda6229a32
--- a/DebugView.st	Fri Nov 12 12:02:14 2004 +0100
+++ b/DebugView.st	Fri Nov 12 13:06:00 2004 +0100
@@ -823,12 +823,17 @@
             ^ 2
         ].
 
+        "/ show the place of the send; not where the Signal was raised...
+        (sel == #subclassResponsibility) ifTrue:[
+            ^ 2
+        ].
+
         "/ show the place of the bad index; not where the Signal was raised...
         ( #(#notIndexed 
             #indexNotIntegerOrOutOfBounds: 
             #subscriptBoundsError:
             #elementBoundsError:
-            #subclassResponsibility
+            "/ #subclassResponsibility
         ) includes:sel) ifTrue:[
             idx := 2.
             [ idx <= 3 
@@ -5677,7 +5682,27 @@
                 lineNrInMethod == 0 ifTrue:[
                     (method notNil and:[method isJavaMethod]) ifTrue:[
                         lineNrInMethod := method lineNumber
-                    ]
+                    ].
+                    "/ guess lineNumber from sent-messages selector
+                    "/ kludge to fix lineNr-display of shared subclassResponsibility methods.
+                    lineNrInMethod == 0 ifTrue:[
+                        |conIdx sentContext messages|
+
+                        conIdx := contextArray identityIndexOf:con.
+                        conIdx > 1 ifTrue:[
+                            sentContext := contextArray at:conIdx-1.
+                            sentContext isBlockContext ifFalse:[
+                                (method notNil and:[code notNil]) ifTrue:[
+                                    messages := method messagesSent.
+                                    messages size == 1 ifTrue:[
+                                        sentContext selector == messages first ifTrue:[
+                                            lineNrInMethod := code asStringCollection findFirst:[:l | l includesString:sentContext selector].
+                                        ]
+                                    ]
+                                ].
+                            ].
+                        ].
+                    ].
                 ].
 
                 UserPreferences current syntaxColoring ifTrue:[
@@ -5841,7 +5866,7 @@
 !DebugView class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libtool/DebugView.st,v 1.375 2004-11-11 09:14:21 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libtool/DebugView.st,v 1.376 2004-11-12 12:06:00 cg Exp $'
 ! !
 
 DebugView initialize!