1
0
mirror of https://github.com/janet-lang/janet synced 2025-10-23 03:37:40 +00:00

Add debug/step to single step a fiber.

Very useful for implementing debuggers.
This commit is contained in:
Calvin Rose
2019-11-25 18:14:34 -06:00
parent c3273e8751
commit 6988fd3cab
5 changed files with 76 additions and 4 deletions

View File

@@ -69,7 +69,8 @@
(def sourcemap (dasm 'sourcemap))
(var last-loc [-2 -2])
(print "\n function: " (dasm 'name) " [" (in dasm 'source "") "]")
(printf " constants: %.4Q\n" (dasm 'constants))
(when-let [constants (dasm 'constants)]
(printf " constants: %.4Q\n" constants))
(printf " slots: %.4Q\n\n" (frame :slots))
(def padding (string/repeat " " 20))
(loop [i :range [0 (length bytecode)]