1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-28 16:00:22 +02:00

debug-trap-handler ephemeral trap enhancement

* module/system/repl/error-handling.scm (call-with-error-handling): If
  the given index is false, assume this was an ephemeral trap, and don't
  print a welcome message or reference the trap by index.
This commit is contained in:
Andy Wingo 2010-10-05 21:50:57 +02:00
parent 586aff5a27
commit ee02e238a3

View file

@ -72,13 +72,17 @@
;; invoking the start-stack thunk has its own frame
;; too.
0 (and tag 1)))
(error-msg (format #f "Trap ~d: ~a" trap-idx trap-name))
(error-msg (if trap-idx
(format #f "Trap ~d: ~a" trap-idx trap-name)
trap-name))
(debug (make-debug stack 0 error-msg)))
(with-saved-ports
(lambda ()
(format #t "~a~%" error-msg)
(format #t "Entering a new prompt. ")
(format #t "Type `,bt' for a backtrace or `,q' to continue.\n")
(if trap-idx
(begin
(format #t "~a~%" error-msg)
(format #t "Entering a new prompt. ")
(format #t "Type `,bt' for a backtrace or `,q' to continue.\n")))
((@ (system repl repl) start-repl) #:debug debug)))))
(define (null-trap-handler frame trap-idx trap-name)