about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--trace.arc.t29
-rw-r--r--trace.mu13
2 files changed, 38 insertions, 4 deletions
diff --git a/trace.arc.t b/trace.arc.t
index e8668d29..cf886c4f 100644
--- a/trace.arc.t
+++ b/trace.arc.t
@@ -820,6 +820,32 @@ run: main 7: n")
 ; + run: main 5: l
 ; + run: main 6: m
 ; + run: main 7: n
+(run-code main14pre
+  (default-space:space-address <- new space:literal 30:literal/capacity)
+  (0:space-address/names:browser-state <- copy 3:space-address/raw/browser-state)
+;?   ($print first-index-on-page:integer/space:1) ;? 2
+;?   ($print (("\n" literal))) ;? 2
+  (first-index-on-page:integer/space:1 <- copy 1:literal)
+;?   ($print first-index-on-page:integer/space:1) ;? 2
+;?   ($print (("\n" literal))) ;? 2
+  (first-subindex-on-page:integer/space:1 <- copy -1:literal)
+  (last-index-on-page:integer/space:1 <- copy 1:literal)
+  (last-subindex-on-page:integer/space:1 <- copy 1:literal)
+  (expanded-index:integer/space:1 <- copy 1:literal)
+  (expanded-children:integer/space:1 <- copy 5:literal)
+  (to-top 0:space-address/browser-state 2:terminal-address/raw)
+  (print-page 0:space-address/browser-state 2:terminal-address/raw)
+  )
+(each routine completed-routines*
+  (awhen rep.routine!error
+    (prn "error - " it)))
+(when (~screen-contains memory*.4 17
+         (+ "- main/ 1 : d e f"
+            "   mem : 1 a     "
+            "   mem : 1 b     "
+            "                 "
+            "                 "))
+  (prn "F - page-up 3: initial print-page state"))
 (run-code main14
   (default-space:space-address <- new space:literal 30:literal/capacity)
   (0:space-address/names:browser-state <- copy 3:space-address/raw/browser-state)
@@ -835,6 +861,7 @@ run: main 7: n")
   (expanded-children:integer/space:1 <- copy 5:literal)
   (s:string-address <- new "K")
   (k:keyboard-address <- init-keyboard s:string-address)
+;?   ($start-tracing) ;? 1
   (process-key 3:space-address/raw/browser-state k:keyboard-address 2:terminal-address/raw)
   )
 (each routine completed-routines*
@@ -878,7 +905,7 @@ run: main 7: n")
   (expanded-children:integer/space:1 <- copy 5:literal)
   (s:string-address <- new "K")
   (k:keyboard-address <- init-keyboard s:string-address)
-  ($start-tracing)
+;?   ($start-tracing) ;? 1
   (process-key 3:space-address/raw/browser-state k:keyboard-address 2:terminal-address/raw)
   )
 (each routine completed-routines*
diff --git a/trace.mu b/trace.mu
index 67e826a2..60703d0c 100644
--- a/trace.mu
+++ b/trace.mu
@@ -417,6 +417,7 @@
     ; or screen ends
     (screen-done?:boolean <- greater-or-equal cursor-row:integer/space:1 screen-height:integer/space:1)
     (break-if screen-done?:boolean)
+;?     ($print (("screen not done\n" literal))) ;? 1
     ; continue printing trace lines
     (tr:instruction-trace-address <- index traces:instruction-trace-address-array-address/space:1/deref trace-index:integer)
     (last-index-on-page:integer/space:1 <- copy trace-index:integer)
@@ -435,6 +436,7 @@
   { begin
     (done?:boolean <- greater-or-equal cursor-row:integer/space:1 app-height:integer/space:1)
     (break-if done?:boolean)
+;?     ($print (("emptying line\n" literal))) ;? 1
     (clear-line screen:terminal-address)
     (down 0:space-address/browser-state screen:terminal-address)
     (loop)
@@ -453,15 +455,17 @@
   (first-full-index:integer <- copy first-index-on-page:integer/space:1)
   ; finish printing the last trace from the previous page
   { begin
+    (screen-done?:boolean <- greater-or-equal cursor-row:integer/space:1 screen-height:integer/space:1)
+    (break-if screen-done?:boolean)
     (partial-trace?:boolean <- equal first-index-on-page:integer/space:1 expanded-index:integer/space:1)
     (break-unless partial-trace?:boolean)
     (tr:instruction-trace-address <- index traces:instruction-trace-address-array-address/space:1/deref first-index-on-page:integer/space:1)
-    (ch:trace-address-array-address <- get tr:instruction-trace-address/deref children:offset)
     { begin
       (print-parent?:boolean <- equal first-subindex-on-page:integer/space:1 -1:literal)
       (break-unless print-parent?:boolean)
       (print-instruction-trace-parent screen:terminal-address tr:instruction-trace-address 0:space-address/browser-state)
     }
+    (ch:trace-address-array-address <- get tr:instruction-trace-address/deref children:offset)
     (i:integer <- max first-subindex-on-page:integer/space:1 0:literal)
     ; print any remaining data in the currently expanded trace
     { begin
@@ -484,9 +488,12 @@
     (first-full-index:integer <- add first-full-index:integer 1:literal)
   }
   ; more new lines
-;?   ($print (("AAA " literal))) ;? 1
+;?   ($print (("AAA " literal))) ;? 2
 ;?   ($print first-full-index:integer) ;? 1
-;?   ($print (("\n" literal))) ;? 1
+;?   ($print cursor-row:integer/space:1) ;? 1
+;?   ($print ((" " literal))) ;? 1
+;?   ($print screen-height:integer/space:1) ;? 1
+;?   ($print (("\n" literal))) ;? 2
   (print-traces-collapsed-from 0:space-address/browser-state screen:terminal-address first-full-index:integer)
 ])