X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcode%2Fdebug.lisp;h=76a87d8610c9e9551db8bd5dc938c9a5e70fa547;hb=842c9ee088e4b85cc0ef4ba9ce69797b6f26e677;hp=df913ba4d90a87dc7c54046b3e319f689d898d48;hpb=492dce07cf27b3cbee8ce4800c938fcb884aa53e;p=sbcl.git diff --git a/src/code/debug.lisp b/src/code/debug.lisp index df913ba..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,18 +1099,21 @@ 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*) - (let* ((exp (debug-read *debug-io*)) - (cmd-fun (debug-command-p exp restart-commands))) - (with-simple-restart (abort - "~@" - level) + (with-simple-restart (abort + "~@" + level) + (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)) ((consp cmd-fun)