Tools__BreakpointService.st
changeset 11601 6500e91de9e8
parent 11569 39989f33ca9d
child 11607 3cd59e465a6a
--- a/Tools__BreakpointService.st	Wed Jul 18 10:56:46 2012 +0200
+++ b/Tools__BreakpointService.st	Wed Jul 18 11:56:53 2012 +0200
@@ -28,10 +28,10 @@
 "{ NameSpace: Tools }"
 
 CodeViewService subclass:#BreakpointService
-	instanceVariableNames:'breakpoints currentMethod'
-	classVariableNames:''
-	poolDictionaries:''
-	category:'Interface-CodeView'
+        instanceVariableNames:'breakpoints currentMethod'
+        classVariableNames:''
+        poolDictionaries:''
+        category:'Interface-CodeView'
 !
 
 !BreakpointService class methodsFor:'documentation'!
@@ -64,6 +64,12 @@
 "
 ! !
 
+!BreakpointService class methodsFor:'others'!
+
+version_CVS
+    ^ '$Header: /cvs/stx/stx/libtool/Tools__BreakpointService.st,v 1.14 2012-07-18 09:56:53 vrany Exp $'
+! !
+
 !BreakpointService methodsFor:'accessing'!
 
 breakpoints
@@ -194,12 +200,17 @@
     (method notNil and:[method hasPrimitiveCode not]) ifTrue:[
         "/ be careful: if the text has been edited/modified, do not compile
         textView modified ifTrue:[
-            self halt
+            self breakPoint: #cg.
+            self breakPoint: #jv.
+            ^self.
         ] ifFalse:[
             "/ prepare to get reachable bpts
             breakpoints do:[:bp | bp isReached:false].
 
             class := method mclass.
+            class isNil ifTrue:[
+                class := codeView classHolder value.
+            ].
             selector := method selector.
             Class withoutUpdatingChangesDo:[
                 compiler := ByteCodeCompilerWithBreakpointSupport new.
@@ -214,9 +225,17 @@
                             silent:true 
                             foldConstants:true
                             ifFail:[ self halt ].
+                selector isNil ifTrue:[
+                    "/May happen as the selector is not stored in the method but
+                    "/searches through method's mclass methodDictionary.
+                    "/Following should be save as breakpoint is not installed when
+                    "/the code is modified...
+                    selector := compiler selector.
+                ].
 
-                (class primAddSelector:selector withMethod:newMethod) ifFalse:[
-                    self halt.
+                (class primAddSelector: selector withMethod:newMethod) ifFalse:[
+                    self breakPoint: #cg.
+                    self breakPoint: #jv.
                     ^ self
                 ].
                 codeView methodHolder value:newMethod.
@@ -234,6 +253,7 @@
     ]
 
     "Created: / 05-07-2011 / 21:33:13 / cg"
+    "Modified: / 18-07-2012 / 10:53:22 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 setOrToggleBreakpointAtLine:line 
@@ -303,7 +323,8 @@
 !BreakpointService class methodsFor:'documentation'!
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libtool/Tools__BreakpointService.st,v 1.13 2012-06-08 07:38:21 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libtool/Tools__BreakpointService.st,v 1.14 2012-07-18 09:56:53 vrany Exp $'
+
 !
 
 version_SVN