X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcode%2Ferror-error.lisp;h=cefeab5e3ed58bc30b8fb0b13cd18deb6157c8d2;hb=0e3c4b4db102bd204a30402d7e5a0de44aea57ce;hp=59274b5a4c33ccca5d4df0d582ef5c961d3fea73;hpb=a530bbe337109d898d5b4a001fc8f1afa3b5dc39;p=sbcl.git diff --git a/src/code/error-error.lisp b/src/code/error-error.lisp index 59274b5..cefeab5 100644 --- a/src/code/error-error.lisp +++ b/src/code/error-error.lisp @@ -9,35 +9,36 @@ (in-package "SB!IMPL") -(file-comment - "$Header$") - ;;; These specials are used by ERROR-ERROR to track the success of recovery ;;; attempts. (defvar *error-error-depth* 0) -(defvar *error-throw-up-count* 0) ;;; ERROR-ERROR can be called when the error system is in trouble and needs to ;;; punt fast. It prints a message without using FORMAT. If we get into this ;;; recursively, then we halt. (defun error-error (&rest messages) (let ((*error-error-depth* (1+ *error-error-depth*))) - (when (> *error-throw-up-count* 50) - (%primitive sb!c:halt) - (throw 'sb!impl::top-level-catcher nil)) (case *error-error-depth* (1) (2 (stream-cold-init-or-reset)) (3 - (incf *error-throw-up-count*) - (throw 'sb!impl::top-level-catcher nil)) + (/show0 "*ERROR-ERROR-DEPTH* too big, trying THROW") + (throw 'toplevel-catcher nil)) (t + (/show0 "*ERROR-ERROR-DEPTH* too big, trying HALT") (%primitive sb!c:halt) - (throw 'sb!impl::top-level-catcher nil))) + (/show0 "*ERROR-ERROR-DEPTH* too big, trying THROW") + (throw 'toplevel-catcher nil))) (with-standard-io-syntax (let ((*print-readably* nil)) - (dolist (item messages) - (princ item *terminal-io*)) - (sb!debug:internal-debug))))) + (dolist (item messages) + (princ item *terminal-io*)) + (terpri *terminal-io*) + (sb!debug:backtrace :stream *terminal-io*) + (force-output *terminal-io*) + (invoke-debugger + (coerce-to-condition "Maximum error nesting depth exceeded" nil + 'simple-error + 'error))))))