1
0
mirror of https://github.com/janet-lang/janet synced 2024-06-28 08:03:16 +00:00

Remove .breakall and .clearall conditionally.

If disasm not available, these functions cannot be implemented.
This commit is contained in:
Calvin Rose 2020-05-12 08:50:37 -05:00
parent 00451777fe
commit c947bda604

View File

@ -2405,20 +2405,6 @@
(print)) (print))
(print)) (print))
(unless (get _env 'disasm)
(put _env '.disasm nil)
(put _env '.bytecode nil)
(put _env '.ppasm nil))
(put _env 'disasm-alias nil)
(defn .source
"Show the source code for the function being debugged."
[&opt n]
(def frame (.frame n))
(def s (frame :source))
(def all-source (slurp s))
(print "\n" all-source "\n"))
(defn .breakall (defn .breakall
"Set breakpoints on all instructions in the current function." "Set breakpoints on all instructions in the current function."
[&opt n] [&opt n]
@ -2437,6 +2423,22 @@
(debug/unfbreak fun i)) (debug/unfbreak fun i))
(print "Cleared " (length bytecode) " breakpoints in " fun)) (print "Cleared " (length bytecode) " breakpoints in " fun))
(unless (get _env 'disasm)
(put _env '.disasm nil)
(put _env '.bytecode nil)
(put _env '.breakall nil)
(put _env '.clearall nil)
(put _env '.ppasm nil))
(put _env 'disasm-alias nil)
(defn .source
"Show the source code for the function being debugged."
[&opt n]
(def frame (.frame n))
(def s (frame :source))
(def all-source (slurp s))
(print "\n" all-source "\n"))
(defn .break (defn .break
"Set breakpoint at the current pc." "Set breakpoint at the current pc."
[] []