Browse Source

print call stack on all low-level errors

main
Kartik K. Agaram 1 year ago
parent
commit
0e9503d739
  1. 4
      108write.subx
  2. 5
      112read-byte.subx
  3. 5
      115write-byte.subx
  4. 5
      118parse-hex-int.subx
  5. 15
      120allocate.subx
  6. 5
      121new-stream.subx
  7. 10
      123slice.subx
  8. 10
      126write-int-decimal.subx
  9. 10
      309stream.subx

4
108write.subx

@ -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

5
112read-byte.subx

@ -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

5
115write-byte.subx

@ -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:

5
118parse-hex-int.subx

@ -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

15
120allocate.subx

@ -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.

5
121new-stream.subx

@ -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:

10
123slice.subx

@ -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:

10
126write-int-decimal.subx

@ -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

10
309stream.subx

@ -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

Loading…
Cancel
Save