]> gitweb.factorcode.org Git - factor.git/blobdiff - basis/tools/walker/walker.factor
Merge OneEyed's patch
[factor.git] / basis / tools / walker / walker.factor
index f1a1e3c873857e58af53181c0e97099d1841df9f..f0d9a084b13677494a1df9859cbf6c5f9f5eb0df 100644 (file)
@@ -3,8 +3,8 @@
 USING: threads kernel namespaces continuations combinators
 sequences math namespaces.private continuations.private
 concurrency.messaging quotations kernel.private words
-sequences.private assocs models models.filter arrays accessors
-generic generic.standard definitions make ;
+sequences.private assocs models models.arrow arrays accessors
+generic generic.standard definitions make sbufs ;
 IN: tools.walker
 
 SYMBOL: show-walker-hook ! ( status continuation thread -- )
@@ -126,7 +126,7 @@ SYMBOL: +stopped+
     [
         2dup length = [ nip [ break ] append ] [
             2dup nth \ break = [ nip ] [
-                swap 1+ cut [ break ] swap 3append
+                swap 1+ cut [ break ] glue 
             ] if
         ] if
     ] change-frame ;
@@ -147,6 +147,7 @@ SYMBOL: +stopped+
     { (call-next-method) [ (step-into-call-next-method) ] }
 } [ "step-into" set-word-prop ] assoc-each
 
+! Never step into these words
 {
     >n ndrop >c c>
     continue continue-with
@@ -204,7 +205,7 @@ SYMBOL: +stopped+
                 ]
             } case
         ] handle-synchronous
-    ] [ ] while ;
+    ] while ;
 
 : step-back-msg ( continuation -- continuation' )
     walker-history tget
@@ -227,16 +228,16 @@ SYMBOL: +stopped+
                 { step-into-all [ step-into-all-loop ] }
                 { abandon [ drop f keep-running ] }
                 ! Pass quotation to debugged thread
-                { call-in [ nip keep-running ] }
+                { call-in [ keep-running ] }
                 ! Pass previous continuation to debugged thread
                 { step-back [ step-back-msg ] }
             } case f
         ] handle-synchronous
-    ] [ ] while ;
+    ] while ;
 
 : walker-loop ( -- )
     +running+ set-status
-    [ status +stopped+ eq? not ] [
+    [ status +stopped+ eq? ] [
         [
             {
                 ! ignore these commands while the thread is
@@ -255,7 +256,7 @@ SYMBOL: +stopped+
                 [ walker-suspended ]
             } case
         ] handle-synchronous
-    ] [ ] while ;
+    ] until ;
 
 : associate-thread ( walker -- )
     walker-thread tset