about summary refs log tree commit diff stats
path: root/shell/trace.mu
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2021-05-22 10:28:21 -0700
committerKartik K. Agaram <vc@akkartik.com>2021-05-22 10:28:21 -0700
commit7a04c8104d94ad6357a10218beed57bd783e3017 (patch)
treea351575630e74adba8f4ddc74a4a9dc1f3a9c8b6 /shell/trace.mu
parent6934f78e9792e051803adca3152d958382def0a9 (diff)
downloadmu-7a04c8104d94ad6357a10218beed57bd783e3017.tar.gz
shell: reduce trace depth in sandbox
We'll gradually make this more dynamic.
Diffstat (limited to 'shell/trace.mu')
-rw-r--r--shell/trace.mu16
1 files changed, 16 insertions, 0 deletions
diff --git a/shell/trace.mu b/shell/trace.mu
index 0398a099..43b19246 100644
--- a/shell/trace.mu
+++ b/shell/trace.mu
@@ -433,6 +433,22 @@ fn render-trace screen: (addr screen), _self: (addr trace), xmin: int, ymin: int
   var i/edx: int <- copy 0
   var max-addr/ebx: (addr int) <- get self, first-free
   var max/ebx: int <- copy *max-addr
+  # display trace depth (not in tests)
+  $render-trace:render-depth: {
+    compare max, 0
+    break-if-<=
+    var max-depth/edx: (addr int) <- get self, max-depth
+    {
+      var width/eax: int <- copy 0
+      var height/ecx: int <- copy 0
+      width, height <- screen-size screen
+      compare width, 0x80
+      break-if-< $render-trace:render-depth
+    }
+    set-cursor-position screen, 0x70/x, y
+    draw-text-rightward-from-cursor-over-full-screen screen, "trace depth: ", 0x17/fg, 0xc5/bg=blue-bg
+    draw-int32-decimal-wrapping-right-then-down-from-cursor-over-full-screen screen, *max-depth, 0x7/fg, 0xc5/bg=blue-bg
+  }
   $render-trace:loop: {
     compare i, max
     break-if->=