diff options
author | Andy Wingo <wingo@pobox.com> | 2010-07-09 18:34:24 +0200 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2010-07-09 18:34:24 +0200 |
commit | 97b3800e881887eb6b344a6be6f49f123edb1000 (patch) | |
tree | 9c07fdcd94ed4648f0edb0ad71c80b7108955ea7 | |
parent | 3ae78d95e62e36078bb86e22450f2e7830ea2ddf (diff) | |
download | guile-97b3800e881887eb6b344a6be6f49f123edb1000.tar.gz |
tweaks to print-locals
* module/system/repl/debug.scm (print-locals): Run the before-print-hook
on the values, so we can hook into (ice-9 history) if available. Don't
bother printing binding indices. Give a little per-line-prefix.
-rw-r--r-- | module/system/repl/debug.scm | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/module/system/repl/debug.scm b/module/system/repl/debug.scm index f9b6af280..361498a1c 100644 --- a/module/system/repl/debug.scm +++ b/module/system/repl/debug.scm @@ -57,7 +57,7 @@ ret)) (define* (print-locals frame #:optional (port (current-output-port)) - #:key (width 72) (per-line-prefix "")) + #:key (width 72) (per-line-prefix " ")) (let ((bindings (frame-bindings frame))) (cond ((null? bindings) @@ -66,16 +66,14 @@ (format port "~aLocal variables:~%" per-line-prefix) (for-each (lambda (binding) - (format port "~a~4d ~a~:[~; (boxed)~] = ~v:@y\n" - per-line-prefix - (binding:index binding) - (binding:name binding) - (binding:boxed? binding) - width - (let ((x (frame-local-ref frame (binding:index binding)))) - (if (binding:boxed? binding) - (variable-ref x) - x)))) + (let ((v (let ((x (frame-local-ref frame (binding:index binding)))) + (if (binding:boxed? binding) + (variable-ref x) + x)))) + (display per-line-prefix port) + (run-hook before-print-hook v) + (format port "~a~:[~; (boxed)~] = ~v:@y\n" + (binding:name binding) (binding:boxed? binding) width v))) (frame-bindings frame)))))) (define* (print-frame frame #:optional (port (current-output-port)) |