X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fcode%2Fdebug.lisp;h=76a87d8610c9e9551db8bd5dc938c9a5e70fa547;hb=a3d4610158f227d53cb5eac287dd2661e975fc70;hp=150e3065b2ce6e644d462480f561c5eb69121f07;hpb=5ff7cae9ac087c5358e23310a4cf53baffc49e1e;p=sbcl.git diff --git a/src/code/debug.lisp b/src/code/debug.lisp index 150e306..76a87d8 100644 --- a/src/code/debug.lisp +++ b/src/code/debug.lisp @@ -1063,12 +1063,12 @@ and LDB (the low-level debugger). See also ENABLE-DEBUGGER." "When set, avoid calling INVOKE-DEBUGGER recursively when errors occur while executing in the debugger.") -(defun debug-read (stream) +(defun debug-read (stream eof-restart) (declare (type stream stream)) (let* ((eof-marker (cons nil nil)) (form (read stream nil eof-marker))) (if (eq form eof-marker) - (abort) + (invoke-restart eof-restart) form))) (defun debug-loop-fun () @@ -1099,17 +1099,20 @@ and LDB (the low-level debugger). See also ENABLE-DEBUGGER." '*flush-debug-errors*) (/show0 "throwing DEBUG-LOOP-CATCHER") (throw 'debug-loop-catcher nil))))) - ;; We have to bind LEVEL for the restart function created by - ;; WITH-SIMPLE-RESTART. + ;; We have to bind LEVEL for the restart function created + ;; by WITH-SIMPLE-RESTART, and we need the explicit ABORT + ;; restart that exists now so that EOF from read can drop + ;; one debugger level. (let ((level *debug-command-level*) - (restart-commands (make-restart-commands))) + (restart-commands (make-restart-commands)) + (abort-restart-for-eof (find-restart 'abort))) (flush-standard-output-streams) (debug-prompt *debug-io*) (force-output *debug-io*) (with-simple-restart (abort "~@" level) - (let* ((exp (debug-read *debug-io*)) + (let* ((exp (debug-read *debug-io* abort-restart-for-eof)) (cmd-fun (debug-command-p exp restart-commands))) (cond ((not cmd-fun) (debug-eval-print exp))