print call stack on all low-level errors

This commit is contained in:
Kartik K. Agaram 2021-05-15 00:15:24 -07:00
parent 2d4fb39dac
commit 0e9503d739
9 changed files with 14 additions and 55 deletions

View File

@ -220,9 +220,7 @@ $_append-4:end:
$_append-4:abort:
(draw-text-wrapping-right-then-down-from-cursor-over-full-screen 0 "_append-4: stream full at " 3 0) # 3=cyan
(draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen 0 %eax 3 0)
{
eb/jump loop/disp8
}
(abort "")
# never gets here
# . . vim:nowrap:textwidth=0

View File

@ -39,10 +39,7 @@ $read-byte:end:
c3/return
$read-byte:abort:
(draw-text-wrapping-right-then-down-from-cursor-over-full-screen 0 "read-byte: empty stream" 3 0) # 3=cyan
{
eb/jump loop/disp8
}
(abort "read-byte: empty stream")
# never gets here
== data

View File

@ -43,10 +43,7 @@ $append-byte:end:
c3/return
$append-byte:abort:
(draw-text-wrapping-right-then-down-from-cursor-over-full-screen 0 "append-byte: out of space\n" 3 0) # 3=cyan
{
eb/jump loop/disp8
}
(abort "append-byte: out of space")
# never gets here
test-append-byte-single:

View File

@ -888,10 +888,7 @@ $from-hex-char:letter:
c3/return
$from-hex-char:abort:
(draw-text-wrapping-right-then-down-from-cursor-over-full-screen 0 "invalid hex char" 3 0) # 3=cyan
{
eb/jump loop/disp8
}
(abort "invalid hex char")
# never gets here
# . . vim:nowrap:textwidth=0

View File

@ -130,10 +130,7 @@ $allocate-raw:end:
c3/return
$allocate-raw:abort:
(draw-text-wrapping-right-then-down-from-cursor-over-full-screen 0 "allocate: failed" 3 0) # 3=cyan
{
eb/jump loop/disp8
}
(abort "allocate: failed")
# never gets here
test-allocate-raw-success:
@ -282,10 +279,7 @@ $lookup:abort:
(draw-text-wrapping-right-then-down-from-cursor-over-full-screen 0 " " 2 0)
40/increment-eax
(draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen 0 *eax 3 0)
(draw-text-wrapping-right-then-down-from-cursor-over-full-screen 0 " " 2 0)
{
eb/jump loop/disp8
}
(abort "\n")
# never gets here
test-lookup-success:
@ -554,10 +548,7 @@ allocate-region: # ad: (addr allocation-descriptor), n: int, out: (addr handle
# we bloat a potentially cold segment in RAM so we can abort with a single
# instruction.
$allocate-region:abort:
(draw-text-wrapping-right-then-down-from-cursor-over-full-screen 0 "allocate-region: failed to allocate" 3 0) # 3=cyan
{
eb/jump loop/disp8
}
(abort "allocate-region: failed to allocate")
# never gets here
# Claim the next 'n+4' bytes of memory and initialize the first 4 to n.

View File

@ -58,10 +58,7 @@ $new-stream:end:
c3/return
$new-stream:abort:
(draw-text-wrapping-right-then-down-from-cursor-over-full-screen 0 "new-stream: size too large" 3 0) # 3=cyan
{
eb/jump loop/disp8
}
(abort "new-stream: size too large")
# never gets here
test-new-stream:

View File

@ -848,10 +848,7 @@ $write-slice:end:
c3/return
$write-slice:abort:
(draw-text-wrapping-right-then-down-from-cursor-over-full-screen 0 "write-slice: out of space" 3 0) # 3=cyan
{
eb/jump loop/disp8
}
(abort "write-slice: out of space")
# never gets here
test-write-slice:
@ -970,10 +967,7 @@ $slice-to-string:end:
c3/return
$slice-to-string:abort:
(draw-text-wrapping-right-then-down-from-cursor-over-full-screen 0 "slice-to-string: out of space\n" 3 0) # 3=cyan
{
eb/jump loop/disp8
}
(abort "slice-to-string: out of space")
# never gets here
test-slice-to-string:

View File

@ -114,10 +114,7 @@ $write-int32-decimal:end:
c3/return
$write-int32-decimal:abort:
(draw-text-wrapping-right-then-down-from-cursor-over-full-screen 0 "write-int32-decimal: stream out of space" 3 0) # 3=cyan
{
eb/jump loop/disp8
}
(abort "write-int32-decimal: stream out of space")
# never gets here
test-write-int32-decimal:
@ -419,10 +416,7 @@ $to-decimal-digit:end:
c3/return
$to-decimal-digit:abort:
(draw-text-wrapping-right-then-down-from-cursor-over-full-screen 0 "to-decimal-digit: not a digit character" 3 0) # 3=cyan
{
eb/jump loop/disp8
}
(abort "to-decimal-digit: not a digit character")
# never gets here
# . . vim:nowrap:textwidth=0

View File

@ -98,10 +98,7 @@ $write-to-stream:end:
c3/return
$write-to-stream:abort:
(draw-text-wrapping-right-then-down-from-cursor-over-full-screen 0 "write-to-stream: stream full" 3 0) # 3=cyan
{
eb/jump loop/disp8
}
(abort "write-to-stream: stream full")
# never gets here
read-from-stream: # s: (addr stream _), out: (addr byte), n: int
@ -151,10 +148,7 @@ $read-from-stream:end:
c3/return
$read-from-stream:abort:
(draw-text-wrapping-right-then-down-from-cursor-over-full-screen 0 "read-from-stream: stream empty" 3 0) # 3=cyan
{
eb/jump loop/disp8
}
(abort "read-from-stream: stream empty")
# never gets here
stream-first: # s: (addr stream byte) -> result/eax: byte