| else \ throw by signal handler with insufficient information |
else \ throw by signal handler with insufficient information |
| handler @ cell - \ beyond that we know nothing |
handler @ cell - \ beyond that we know nothing |
| then |
then |
| rp0 @ over - [ 10 cells ]L - 0 max ; \ the bottom 10 cells (and often |
backtrace-rp0 @ [ 2 cells ]L - over - 0 max ; |
| \ more) are uninteresting |
|
| |
|
| :noname ( -- ) |
:noname ( -- ) |
| backtrace-empty @ |
backtrace-empty @ |
| |
|
| : print-backtrace ( addr1 addr2 -- ) |
: print-backtrace ( addr1 addr2 -- ) |
| \G print a backtrace for the return stack addr1..addr2 |
\G print a backtrace for the return stack addr1..addr2 |
| |
cr ." Backtrace:" |
| swap u+do |
swap u+do |
| cr |
cr |
| i @ dup hex. ( return-addr? ) |
i @ dup hex. ( return-addr? ) |