From 2ff86d91628328793e584d9980748ea1c917ad57 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Thu, 22 Apr 2021 10:13:19 -0700 Subject: better error message on trace overflow --- shell/trace.mu | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'shell') diff --git a/shell/trace.mu b/shell/trace.mu index 8585fe49..51c7feb6 100644 --- a/shell/trace.mu +++ b/shell/trace.mu @@ -100,8 +100,15 @@ fn trace _self: (addr trace), label: (addr array byte), message: (addr stream by var depth/ecx: (addr int) <- get self, curr-depth rewind-stream message { - compare *index-addr, 0x7ffe/lines + compare *index-addr, 0x7fff/lines break-if-< + clear-stream message + write message, "No space left in trace\n" + write message, "Please either:\n" + write message, " - find a smaller sub-computation to test,\n" + write message, " - allocate more space to the trace in initialize-sandbox\n" + write message, " (shell/sandbox.mu), or\n" + write message, " - move the computation to 'main' and run it using ctrl-s" initialize-trace-line 0/depth, "error", message, dest increment *index-addr return -- cgit 1.4.1-2-gfad0