1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-29 14:30:34 +02:00

backtraces on meta-commands too

* module/system/repl/repl.scm (call-with-backtrace): New helper.
  (start-repl): Use the helper, for normal expressions *and* for
  meta-commands.
This commit is contained in:
Andy Wingo 2008-08-09 14:30:52 +02:00
parent 707b812ef4
commit 67c4505e7a

View file

@ -90,6 +90,12 @@
(else
(apply bad-throw args))))
(define (call-with-backtrace thunk)
(catch #t
thunk
default-catch-handler
default-pre-unwind-handler))
(eval-case
((compile-toplevel)
(define-macro (start-stack tag expr)
@ -102,11 +108,13 @@
(let ((exp (prompting-meta-read repl)))
(cond
((eq? exp meta-command-token)
(meta-command repl (read-line)))
(call-with-backtrace
(lambda ()
(meta-command repl (read-line)))))
((eof-object? exp)
(throw 'quit))
(else
(catch #t
(call-with-backtrace
(lambda ()
(call-with-values (lambda ()
(run-hook before-eval-hook exp)
@ -116,9 +124,7 @@
(for-each (lambda (v)
(run-hook before-print-hook v)
(repl-print repl v))
l))))
default-catch-handler
default-pre-unwind-handler)))
l)))))))
(next-char #f) ;; consume trailing whitespace
(prompt-loop)))))