changes in sbcl-0.8.21 (0.9alpha.1?) relative to sbcl-0.8.20:
+ * incompatible change: the top level REPL now has only an ABORT
+ restart associated with it, not TOPLEVEL and ABORT as it used to.
+ TOP and TOPLEVEL are now available as debugger commands for
+ returning to the top level.
* incompatible change: forms evaluated in the REPL now use the
global optimization policy.
* incompatible change: user- and system-initialization files are
"COLD-FSET"
"!DEFUN-FROM-COLLECTED-COLD-INIT-FORMS"
+ ;; catch tags
+ "TOPLEVEL-CATCHER"
+
;; hooks for contrib/ stuff we're insufficiently sure
;; about to add to SB!EXT
"*REPL-PROMPT-FUN*"
to debugger.
Getting in and out of the debugger:
- RESTART invokes restart numbered as shown (prompt if not given).
- ERROR prints the error condition and restart cases.
+ TOPLEVEL, TOP exits debugger and returns to top level REPL
+ RESTART invokes restart numbered as shown (prompt if not given).
+ ERROR prints the error condition and restart cases.
+
The number of any restart, or its name, or a unique abbreviation for its
- name, is a valid command, and is the same as using RESTART to invoke
- that restart.
+ name, is a valid command, and is the same as using RESTART to invoke
+ that restart.
Changing frames:
UP up frame DOWN down frame
(unless (typep condition 'step-condition)
(when *debug-beginner-help-p*
(format *debug-io*
- "~%~@<You can type HELP for debugger help, or ~
+ "~%~@<Type HELP for debugger help, or ~
(SB-EXT:QUIT) to exit from SBCL.~:@>~2%"))
(show-restarts *debug-restarts* *debug-io*))
(internal-debug))
(incf max-name-len 3))
(dolist (restart restarts)
(let ((name (restart-name restart)))
+ ;; FIXME: maybe it would be better to display later names
+ ;; in parens instead of brakets, not just omit them fully.
+ ;; Call BREAK, call BREAK in the debugger, and tell me
+ ;; it's not confusing looking. --NS 20050310
(cond ((member name names-used)
(format s "~& ~2D: ~V@T~A~%" count max-name-len restart))
(t
(princ condition *debug-io*)
(/show0 "handling d-c by THROWing DEBUG-LOOP-CATCHER")
(throw 'debug-loop-catcher nil))))
- (fresh-line *debug-io*)
+ (terpri *debug-io*)
(print-frame-call *current-frame* *debug-io* :verbosity 2)
(loop
(catch 'debug-loop-catcher
(!def-debug-command-alias "D" "DOWN")
-;;; CMU CL had this command, but SBCL doesn't, since it's redundant
-;;; with "FRAME 0", and it interferes with abbreviations for the
-;;; TOPLEVEL restart.
-;;;(!def-debug-command "TOP" ()
-;;; (do ((prev *current-frame* lead)
-;;; (lead (sb!di:frame-up *current-frame*) (sb!di:frame-up lead)))
-;;; ((null lead)
-;;; (setf *current-frame* prev)
-;;; (print-frame-call prev *debug-io*))))
-
(!def-debug-command "BOTTOM" ()
(do ((prev *current-frame* lead)
(lead (sb!di:frame-down *current-frame*) (sb!di:frame-down lead)))
\f
;;;; commands for entering and leaving the debugger
-;;; CMU CL supported this QUIT debug command, but SBCL provides this
-;;; functionality with a restart instead. (The QUIT debug command was
-;;; removed because it's confusing to have "quit" mean two different
-;;; things in the system, "restart the top level REPL" in the debugger
-;;; and "terminate the Lisp system" as the SB-EXT:QUIT function.)
-;;;
-;;;(!def-debug-command "QUIT" ()
-;;; (throw 'sb!impl::toplevel-catcher nil))
-
-;;; CMU CL supported this GO debug command, but SBCL doesn't -- in
-;;; SBCL you just type the CONTINUE restart name instead (or "C" or
-;;; "RESTART CONTINUE", that's OK too).
-;;;(!def-debug-command "GO" ()
-;;; (continue *debug-condition*)
-;;; (error "There is no restart named CONTINUE."))
+(!def-debug-command "TOPLEVEL" ()
+ (throw 'toplevel-catcher nil))
+
+;;; make T safe
+(!def-debug-command-alias "TOP" "TOPLEVEL")
(!def-debug-command "RESTART" ()
(/show0 "doing RESTART debug-command")
(/show0 "*ERROR-THROW-UP-COUNT* too big, trying HALT")
(%primitive sb!c:halt)
(/show0 "*ERROR-THROW-UP-COUNT* too big, trying THROW")
- (throw 'sb!impl::toplevel-catcher nil))
+ (throw 'toplevel-catcher nil))
(case *error-error-depth*
(1)
(2
(3
(incf *error-throw-up-count*)
(/show0 "*ERROR-ERROR-DEPTH* too big, trying THROW")
- (throw 'sb!impl::toplevel-catcher nil))
+ (throw 'toplevel-catcher nil))
(t
(/show0 "*ERROR-ERROR-DEPTH* too big, trying HALT")
(%primitive sb!c:halt)
(/show0 "*ERROR-ERROR-DEPTH* too big, trying THROW")
- (throw 'sb!impl::toplevel-catcher nil)))
+ (throw 'toplevel-catcher nil)))
(with-standard-io-syntax
(let ((*print-readably* nil))
(defun sigquit-handler (signal code context)
(declare (ignore signal code context))
- (throw 'sb!impl::toplevel-catcher nil))
+ (throw 'toplevel-catcher nil))
(defun sb!kernel:signal-cold-init-or-reinit ()
#!+sb-doc
(init-file-name (posix-getenv "HOME")
".sbclrc"))))
- ;; We wrap all the pre-REPL user/system customized startup code
- ;; in a restart.
- ;;
- ;; (Why not wrap everything, even the stuff above, in this
- ;; restart? Errors above here are basically command line or
- ;; Unix environment errors, e.g. a missing file or a typo on
- ;; the Unix command line, and you don't need to get into Lisp
- ;; to debug them, you should just start over and do it right
- ;; at the Unix level. Errors below here are generally errors
- ;; in user Lisp code, and it might be helpful to let the user
- ;; reach the REPL in order to help figure out what's going
- ;; on.)
- (restart-case
- (progn
- (process-init-file sysinit-truename)
- (process-init-file userinit-truename)
- (process-eval-options (reverse reversed-evals)))
- (toplevel ()
- :report "Skip to toplevel READ/EVAL/PRINT loop."
- (/show0 "CONTINUEing from pre-REPL RESTART-CASE")
- (values)) ; (no-op, just fall through)
- (quit ()
- :report "Quit SBCL (calling #'QUIT, killing the process)."
- (/show0 "falling through to QUIT from pre-REPL RESTART-CASE")
- (quit))))
+ ;; This CATCH is needed for the debugger command TOPLEVEL to
+ ;; work.
+ (catch 'toplevel-catcher
+ ;; We wrap all the pre-REPL user/system customized startup
+ ;; code in a restart.
+ ;;
+ ;; (Why not wrap everything, even the stuff above, in this
+ ;; restart? Errors above here are basically command line
+ ;; or Unix environment errors, e.g. a missing file or a
+ ;; typo on the Unix command line, and you don't need to
+ ;; get into Lisp to debug them, you should just start over
+ ;; and do it right at the Unix level. Errors below here
+ ;; are generally errors in user Lisp code, and it might be
+ ;; helpful to let the user reach the REPL in order to help
+ ;; figure out what's going on.)
+ (restart-case
+ (progn
+ (process-init-file sysinit-truename)
+ (process-init-file userinit-truename)
+ (process-eval-options (reverse reversed-evals)))
+ (abort ()
+ :report "Skip to toplevel READ/EVAL/PRINT loop."
+ (/show0 "CONTINUEing from pre-REPL RESTART-CASE")
+ (values)) ; (no-op, just fall through)
+ (quit ()
+ :report "Quit SBCL (calling #'QUIT, killing the process)."
+ (/show0 "falling through to QUIT from pre-REPL RESTART-CASE")
+ (quit)))))
;; one more time for good measure, in case we fell out of the
;; RESTART-CASE above before one of the flushes in the ordinary
(handler-bind ((step-condition 'invoke-stepper))
(let ((*stepping* nil)
(*step* nil))
- ;; WITH-SIMPLE-RESTART doesn't actually restart its body as
- ;; some (like WHN for an embarrassingly long time
- ;; ca. 2001-12-07) might think, but instead drops control back
- ;; out at the end. So when a TOPLEVEL or outermost-ABORT
- ;; restart happens, we need this outer LOOP wrapper to grab
- ;; control and start over again. (And it also wraps CATCH
- ;; 'TOPLEVEL-CATCHER for similar reasons.)
(loop
(/show0 "about to set up restarts in TOPLEVEL-REPL")
- ;; There should only be one TOPLEVEL restart, and it's here,
- ;; so restarting at TOPLEVEL always bounces you all the way
- ;; out here.
- (with-simple-restart (toplevel
- "Restart at toplevel READ/EVAL/PRINT loop.")
- ;; We add a new ABORT restart for every debugger level, so
- ;; restarting at ABORT in a nested debugger gets you out to
- ;; the innermost enclosing debugger, and only when you're
- ;; in the outermost, unnested debugger level does
- ;; restarting at ABORT get you out to here.
+ ;; CLHS recommends that there should always be an
+ ;; ABORT restart; we have this one here, and one per
+ ;; debugger level.
(with-simple-restart
- (abort "~@<Reduce debugger level (leaving debugger, ~
- returning to toplevel).~@:>")
+ (abort "~@<Exit debugger, returning to top level.~@:>")
(catch 'toplevel-catcher
(sb!unix::reset-signal-mask)
;; In the event of a control-stack-exhausted-error, we
;; here that this is now possible.
(sb!kernel::protect-control-stack-guard-page 1)
(funcall repl-fun noprint)
- (critically-unreachable "after REPL")))))))))))
+ (critically-unreachable "after REPL"))))))))))
;;; Our default REPL prompt is the minimal traditional one.
(defun repl-prompt-fun (stream)
;;; checkins which aren't released. (And occasionally for internal
;;; versions, especially for internal versions off the main CVS
;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".)
-"0.8.20.14"
+"0.8.20.15"