1
0
mirror of https://github.com/janet-lang/janet synced 2025-10-12 06:17:43 +00:00

Add debugger to the core repl.

Debugger functions are prefixed by periods.
This commit is contained in:
Calvin Rose
2020-04-10 17:01:41 -05:00
parent 3b0e6357ad
commit e1f4cadf41
4 changed files with 174 additions and 6 deletions

View File

@@ -1,20 +1,18 @@
###
### A useful debugger library for Janet. Should be used
### inside a debug repl.
### inside a debug repl. This has been moved into the core.
###
(defn .fiber
"Get the current fiber being debugged."
[]
(if-let [entry (dyn '_fiber)]
(entry :value)
(dyn :fiber)))
(dyn :fiber))
(defn .stack
"Print the current fiber stack"
[]
(print)
(debug/stacktrace (.fiber) "")
(with-dyns [:err-color false] (debug/stacktrace (.fiber) ""))
(print))
(defn .frame