diff options
Diffstat (limited to 'shell')
-rw-r--r-- | shell/sandbox.mu | 2 | ||||
-rw-r--r-- | shell/trace.mu | 16 |
2 files changed, 17 insertions, 1 deletions
diff --git a/shell/sandbox.mu b/shell/sandbox.mu index d5cf6c8f..65dd6c4e 100644 --- a/shell/sandbox.mu +++ b/shell/sandbox.mu @@ -31,7 +31,7 @@ fn initialize-sandbox _self: (addr sandbox), fake-screen-and-keyboard?: boolean var trace-ah/eax: (addr handle trace) <- get self, trace allocate trace-ah var trace/eax: (addr trace) <- lookup *trace-ah - initialize-trace trace, 0x100/max-depth, 0x8000/lines, 0x80/visible + initialize-trace trace, 4/max-depth, 0x8000/lines, 0x80/visible var cursor-in-data?/eax: (addr boolean) <- get self, cursor-in-data? copy-to *cursor-in-data?, 1/true } 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->= |