mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-30 00:40:20 +02:00
tracing at repl
* module/system/repl/command.scm (option, trace): Integrate tracing (via ,trace or ,tr).
This commit is contained in:
parent
9eaa8fef80
commit
737caee88d
1 changed files with 9 additions and 10 deletions
|
@ -29,7 +29,7 @@
|
||||||
#:use-module (system vm vm)
|
#:use-module (system vm vm)
|
||||||
#:autoload (system base language) (lookup-language language-reader)
|
#:autoload (system base language) (lookup-language language-reader)
|
||||||
#:autoload (system vm debug) (vm-debugger vm-backtrace)
|
#:autoload (system vm debug) (vm-debugger vm-backtrace)
|
||||||
#:autoload (system vm trace) (vm-trace vm-trace-on vm-trace-off)
|
#:autoload (system vm trace) (vm-trace vm-trace-on! vm-trace-off!)
|
||||||
#:autoload (system vm profile) (vm-profile)
|
#:autoload (system vm profile) (vm-profile)
|
||||||
#:use-module (ice-9 format)
|
#:use-module (ice-9 format)
|
||||||
#:use-module (ice-9 session)
|
#:use-module (ice-9 session)
|
||||||
|
@ -233,8 +233,9 @@ List/show/set options."
|
||||||
((trace)
|
((trace)
|
||||||
(let ((vm (repl-vm repl)))
|
(let ((vm (repl-vm repl)))
|
||||||
(if val
|
(if val
|
||||||
(apply vm-trace-on vm val)
|
(apply vm-trace-on! vm val)
|
||||||
(vm-trace-off vm))))))))
|
;; fixme: asymmetry
|
||||||
|
(vm-trace-off! vm))))))))
|
||||||
|
|
||||||
(define-meta-command (quit repl)
|
(define-meta-command (quit repl)
|
||||||
"quit
|
"quit
|
||||||
|
@ -386,13 +387,11 @@ Start debugger."
|
||||||
|
|
||||||
(define-meta-command (trace repl form . opts)
|
(define-meta-command (trace repl form . opts)
|
||||||
"trace FORM
|
"trace FORM
|
||||||
Trace execution.
|
Trace execution."
|
||||||
|
;; FIXME: doc, or somehow deal with them better
|
||||||
-s Display stack
|
(apply vm-trace
|
||||||
-l Display local variables
|
(repl-vm repl)
|
||||||
-b Bytecode level trace"
|
(make-program (repl-compile repl (repl-parse repl form)))
|
||||||
(apply vm-trace (repl-vm repl)
|
|
||||||
(repl-compile repl (repl-parse repl form))
|
|
||||||
opts))
|
opts))
|
||||||
|
|
||||||
(define-meta-command (step repl)
|
(define-meta-command (step repl)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue