about summary refs log tree commit diff stats
path: root/baremetal/shell/trace.mu
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2021-02-22 22:35:08 -0800
committerKartik K. Agaram <vc@akkartik.com>2021-02-22 22:35:08 -0800
commit0580b5074417d795289beb8f5edec3110a53c333 (patch)
tree25465d75bd2c5953ced6dea67af86e487dc73acb /baremetal/shell/trace.mu
parentfdc3df04300f20fac81792d1f5ee1e170a5644ec (diff)
downloadmu-0580b5074417d795289beb8f5edec3110a53c333.tar.gz
7789
Start adding some lines to the trace. Never shown yet.
Diffstat (limited to 'baremetal/shell/trace.mu')
-rw-r--r--baremetal/shell/trace.mu15
1 files changed, 10 insertions, 5 deletions
diff --git a/baremetal/shell/trace.mu b/baremetal/shell/trace.mu
index d3549f2a..b3a4666a 100644
--- a/baremetal/shell/trace.mu
+++ b/baremetal/shell/trace.mu
@@ -60,11 +60,15 @@ fn trace _self: (addr trace), label: (addr array byte), data: (addr stream byte)
   write-to-stream dest, line
 }
 
-fn error self: (addr trace), data: (addr array byte) {
-  var s: (stream byte 0x100)
-  var s-a/eax: (addr stream byte) <- address s
-  write s-a, data
-  trace self, "error", s-a
+fn trace-text self: (addr trace), label: (addr array byte), s: (addr array byte) {
+  var data-storage: (stream byte 0x100)
+  var data/eax: (addr stream byte) <- address data-storage
+  write data, s
+  trace self, label, data
+}
+
+fn error self: (addr trace), message: (addr array byte) {
+  trace-text self, "error", message
 }
 
 fn initialize-trace-line depth: int, label: (addr array byte), data: (addr stream byte), _out: (addr trace-line) {
@@ -137,6 +141,7 @@ fn render-trace screen: (addr screen), _self: (addr trace), xmin: int, ymin: int
       var x/eax: int <- copy xmin
       x, y <- draw-text-wrapping-right-then-down screen, "...", xmin, ymin, xmax, ymax, x, y, 9/fg=trace, bg
       y <- increment
+      already-hiding-lines? <- copy 1/true
     }
     loop
   }