From 737caee88dae8d442950efeee98ea83c1e7db7a4 Mon Sep 17 00:00:00 2001 From: Andy Wingo Date: Mon, 21 Dec 2009 23:13:05 +0100 Subject: [PATCH] tracing at repl * module/system/repl/command.scm (option, trace): Integrate tracing (via ,trace or ,tr). --- module/system/repl/command.scm | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/module/system/repl/command.scm b/module/system/repl/command.scm index 3e6e7793b..5fac6f6f3 100644 --- a/module/system/repl/command.scm +++ b/module/system/repl/command.scm @@ -29,7 +29,7 @@ #:use-module (system vm vm) #:autoload (system base language) (lookup-language language-reader) #: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) #:use-module (ice-9 format) #:use-module (ice-9 session) @@ -233,8 +233,9 @@ List/show/set options." ((trace) (let ((vm (repl-vm repl))) (if val - (apply vm-trace-on vm val) - (vm-trace-off vm)))))))) + (apply vm-trace-on! vm val) + ;; fixme: asymmetry + (vm-trace-off! vm)))))))) (define-meta-command (quit repl) "quit @@ -386,13 +387,11 @@ Start debugger." (define-meta-command (trace repl form . opts) "trace FORM -Trace execution. - - -s Display stack - -l Display local variables - -b Bytecode level trace" - (apply vm-trace (repl-vm repl) - (repl-compile repl (repl-parse repl form)) +Trace execution." + ;; FIXME: doc, or somehow deal with them better + (apply vm-trace + (repl-vm repl) + (make-program (repl-compile repl (repl-parse repl form))) opts)) (define-meta-command (step repl)