about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2015-03-04 00:21:49 -0800
committerKartik K. Agaram <vc@akkartik.com>2015-03-04 00:21:49 -0800
commitd0faca5759703794e0d7ad9f2deb6fec1e30efd9 (patch)
tree0a18c7b95e88a8876ba40e49d37b978f929a86d6
parentf3e3c0b49fc2864433bc326fe3a6685d9f5d58dd (diff)
downloadmu-d0faca5759703794e0d7ad9f2deb6fec1e30efd9.tar.gz
860
A new intermediate test might help.
-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)
 ])
 
ef='#n337'>337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412