X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcode%2Fcold-error.lisp;h=f61708fd48c5562158bb2cdeaaefd4fc5e7a0ddf;hb=4e7866afc56e4eec4e33dc2d61bd4f0aeed72cfd;hp=96a5670a437c402b867dead80d0d98d05d4fddcf;hpb=56205f12c189933cdd59b900925a171d5e311651;p=sbcl.git diff --git a/src/code/cold-error.lisp b/src/code/cold-error.lisp index 96a5670..f61708f 100644 --- a/src/code/cold-error.lisp +++ b/src/code/cold-error.lisp @@ -110,14 +110,16 @@ (infinite-error-protect (let ((condition (coerce-to-condition datum arguments - 'simple-error 'error)) - (sb!debug:*stack-top-hint* (maybe-find-stack-top-hint))) + 'simple-error 'error))) (/show0 "done coercing DATUM to CONDITION") + (/show0 "signalling CONDITION from within ERROR") (let ((sb!debug:*stack-top-hint* nil)) - (/show0 "signalling CONDITION from within ERROR") (signal condition)) (/show0 "done signalling CONDITION within ERROR") - (invoke-debugger condition)))) + ;; Finding the stack top hint is pretty expensive, so don't do + ;; it until we know we need the debugger. + (let ((sb!debug:*stack-top-hint* (maybe-find-stack-top-hint))) + (invoke-debugger condition))))) (defun cerror (continue-string datum &rest arguments) (infinite-error-protect @@ -126,12 +128,12 @@ (let ((condition (coerce-to-condition datum arguments 'simple-error - 'cerror)) - (sb!debug:*stack-top-hint* (maybe-find-stack-top-hint))) + 'cerror))) (with-condition-restarts condition (list (find-restart 'continue)) (let ((sb!debug:*stack-top-hint* nil)) (signal condition)) - (invoke-debugger condition))))) + (let ((sb!debug:*stack-top-hint* (maybe-find-stack-top-hint))) + (invoke-debugger condition)))))) nil) ;;; like BREAK, but without rebinding *DEBUGGER-HOOK* to NIL, so that @@ -150,7 +152,8 @@ (defun break (&optional (datum "break") &rest arguments) #!+sb-doc "Print a message and invoke the debugger without allowing any possibility - of condition handling occurring." +of condition handling occurring." + (declare (optimize (sb!c::rest-conversion 0))) (let ((*debugger-hook* nil)) ; as specifically required by ANSI (apply #'%break 'break datum arguments)))