From: William Harold Newman Date: Sun, 19 Nov 2000 17:42:35 +0000 (+0000) Subject: 0.6.8.21: X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=8c66abea806a03de36af37eb6068718799617b92;p=sbcl.git 0.6.8.21: rewrote DEBUG-PROMPT to be less confusing when ILISP and SBCL fight and end up 8+ levels deep in the debugger, then relented and gave some advance warning of prompt change deleted unsupported *DEBUG-PROMPT* We don't really need an END-OF-THE-WORLD restart. The point was to make sure a naive user can get out with Ctrl-C. So mention (SB-EXT:QUIT) in entering-the-debugger message. reduced choice-of-output-stream chaos in debugger --- diff --git a/BUGS b/BUGS index f9b8719..a277e01 100644 --- a/BUGS +++ b/BUGS @@ -27,14 +27,15 @@ NOTES: There is also some information on bugs in the manual page and in the TODO file. Eventually more such information may move here. -The gaps in the number sequence belong to old bugs which have been -fixed. +The gaps in the number sequence belong to old bug descriptions which +have gone away (typically because they were fixed, but sometimes for +other reasons, e.g. because they were moved elsewhere). KNOWN BUGS OF NO SPECIAL CLASS: 2: - DEFSTRUCT should almost certainly overwrite the old LAYOUT information + DEFSTRUCT almost certainly should overwrite the old LAYOUT information instead of just punting when a contradictory structure definition is loaded. As it is, if you redefine DEFSTRUCTs in a way which changes their layout, you probably have to rebuild your entire diff --git a/NEWS b/NEWS index 0e694e6..6e371e9 100644 --- a/NEWS +++ b/NEWS @@ -536,18 +536,6 @@ changes in sbcl-0.6.9 relative to sbcl-0.6.8: into everyone's system when I do a "cvs update".) When no customize-target-features.lisp file exists, the target *FEATURES* list should be constructed the same way as before. -* fixed bug 1 (error handling before read-eval-print loop starts), and - redid debugger restarts and related debugger commands somewhat while - doing so: - ** The QUIT debugger command is gone, since it did something - rather different than the SB-EXT:QUIT command, and since it never - worked properly outside the main toplevel read/eval/print loop. - Invoking the new TOPLEVEL restart provides the same functionality. - ** The GO debugger command is also gone, since you can just invoke - the CONTINUE restart directly instead. - ** The TOP debugger command is also gone, since it's redundant with the - FRAME 0 command, and since it interfered with abbreviations for the - TOPLEVEL restart. * fixed bugs in DEFCONSTANT ANSI-compatibility: ** DEFCONSTANT now tests reassignments using EQL, not EQUAL, in order to warn about behavior which is undefined under the ANSI spec. Note: This @@ -568,6 +556,18 @@ changes in sbcl-0.6.9 relative to sbcl-0.6.8: incremented, because the old noncompliant DEFCONSTANT behavior involved calling functions which no longer exist, and because I also took the opportunity to chop an unsupported slot out of the DEBUG-SOURCE structure. +* fixed bug 1 (error handling before read-eval-print loop starts), and + redid debugger restarts and related debugger commands somewhat while + doing so: + ** The QUIT debugger command is gone, since it did something + rather different than the SB-EXT:QUIT command, and since it never + worked properly outside the main toplevel read/eval/print loop. + Invoking the new TOPLEVEL restart provides the same functionality. + ** The GO debugger command is also gone, since you can just invoke + the CONTINUE restart directly instead. + ** The TOP debugger command is also gone, since it's redundant with the + FRAME 0 command, and since it interfered with abbreviations for the + TOPLEVEL restart. * removed bug 21 from BUGS, since Martin Atzmueller points out that it doesn't seem to affect SBCL after all * The system now recovers better from non-PACKAGE values of the *PACKAGE* @@ -576,8 +576,8 @@ changes in sbcl-0.6.9 relative to sbcl-0.6.8: as required by ANSI. (thanks to Douglas Crosher's CMU CL patches, with some porting work by Martin Atzmueller) * Martin Atzmueller reviewed the CMU CL mailing lists and came back - with a boatload of other patches for SBCL, which he ported to - SBCL. Now that those have been applied, + with a boatload of patches which he ported to SBCL. Now that those + have been applied, ** The system tries to make sure that its low-priority messages are prefixed by semicolons, to help people who like to use syntax highlighting in their ILISP buffer. (This patch @@ -598,3 +598,10 @@ changes in sbcl-0.6.9 relative to sbcl-0.6.8: files, thanks to a patch originally from Douglas Crosher. * Martin Atzmueller also fixed ROOM, so that it no longer fails with an undefined function error. + +planned incompatible changes in 0.7.x: +* The debugger prompt sequence now goes "5]", "5[2]", "5[3]", etc. + as you get deeper into recursive calls to the debugger command loop, + instead of the old "5]", "5]]", "5]]]" sequence. (I was motivated + to do this when ILISP and SBCL got into arguments which left me + deeply nested in the debugger.) diff --git a/package-data-list.lisp-expr b/package-data-list.lisp-expr index 52f4296..5d63a32 100644 --- a/package-data-list.lisp-expr +++ b/package-data-list.lisp-expr @@ -341,9 +341,9 @@ debugger interface mixed with various low-level implementation stuff like *STACK-TOP-HINT*" :use ("CL" "SB!EXT" "SB!INT" "SB!SYS") :export ("*AUTO-EVAL-IN-FRAME*" "*DEBUG-CONDITION*" - "*DEBUG-PRINT-LENGTH*" "*DEBUG-PRINT-LEVEL*" "*DEBUG-READTABLE*" - "*DEBUG-PROMPT*" "*DEBUG-HELP-STRING*" "*FLUSH-DEBUG-ERRORS*" - "*IN-THE-DEBUGGER*" + "*DEBUG-PRINT-LENGTH*" "*DEBUG-PRINT-LEVEL*" + "*DEBUG-READTABLE*" "*DEBUG-HELP-STRING*" + "*FLUSH-DEBUG-ERRORS*" "*IN-THE-DEBUGGER*" "*TRACE-INDENTATION-STEP*" "*MAX-TRACE-INDENTATION*" "*TRACE-FRAME*" "*TRACE-PRINT-LENGTH*" "*TRACE-PRINT-LEVEL*" "*TRACED-FUNCTION-LIST*" diff --git a/src/code/debug.lisp b/src/code/debug.lisp index d147049..a8cb121 100644 --- a/src/code/debug.lisp +++ b/src/code/debug.lisp @@ -34,9 +34,8 @@ #!+sb-doc "This is T while in the debugger.") -(defvar *debug-command-level* 0 - #!+sb-doc - "Pushes and pops/exits inside the debugger change this.") +;;; nestedness inside debugger command loops +(defvar *debug-command-level* 0) (defvar *stack-top-hint* nil #!+sb-doc @@ -47,19 +46,22 @@ (defvar *current-frame* nil) -;;; the default for *DEBUG-PROMPT* -(defun debug-prompt () - (let ((*standard-output* *debug-io*)) - (terpri) - (prin1 (sb!di:frame-number *current-frame*)) - (dotimes (i *debug-command-level*) (princ "]")) - (princ " ") - (force-output))) - -(defparameter *debug-prompt* #'debug-prompt - #!+sb-doc - "a function of no arguments that prints the debugger prompt on *DEBUG-IO*") - +(defun debug-prompt (stream) + + ;; old behavior, will probably go away in sbcl-0.7.x + (format stream "~%~D" (sb!di:frame-number *current-frame*)) + (dotimes (i *debug-command-level*) + (write-char #\] stream)) + (write-char #\space stream) + + ;; planned new behavior, delayed since it will break ILISP + #+nil + (format stream + "~%~D~:[~;[~D~]] " + (sb!di:frame-number *current-frame*) + (> *debug-command-level* 1) + *debug-command-level*)) + (defparameter *debug-help-string* "The prompt is right square brackets, the number indicating how many recursive command loops you are in. @@ -614,14 +616,6 @@ reset to ~S." (with-standard-io-syntax (let* ((*debug-condition* condition) (*debug-restarts* (compute-restarts condition)) - ;; FIXME: The next two bindings seem flaky, violating the - ;; principle of least surprise. But in order to fix them, - ;; we'd need to go through all the i/o statements in the - ;; debugger, since a lot of them do their thing on - ;; *STANDARD-INPUT* and *STANDARD-OUTPUT* instead of - ;; *DEBUG-IO*. - (*standard-input* *debug-io*) ; in case of setq - (*standard-output* *debug-io*) ; '' '' '' '' ;; We want the i/o subsystem to be in a known, useful ;; state, regardless of where the debugger was invoked in ;; the program. WITH-STANDARD-IO-SYNTAX does some of that, @@ -642,22 +636,54 @@ reset to ~S." (*print-readably* nil) (*print-pretty* t) (*package* original-package)) + + ;; The initial output here goes to *ERROR-OUTPUT*, because the + ;; initial output is not interactive, just an error message, + ;; and when people redirect *ERROR-OUTPUT*, they could + ;; reasonably expect to see error messages logged there, + ;; regardless of what the debugger does afterwards. #!+sb-show (sb!conditions::show-condition *debug-condition* *error-output*) (format *error-output* - "~2&debugger invoked on ~S of type ~S:~% " - '*debug-condition* + "~2&debugger invoked on condition of type ~S:~% " (type-of *debug-condition*)) (princ-debug-condition-carefully *error-output*) (terpri *error-output*) - (let (;; FIXME: like the bindings of *STANDARD-INPUT* and - ;; *STANDARD-OUTPUT* above.. + + ;; After the initial error/condition/whatever announcement to + ;; *ERROR-OUTPUT*, we become interactive, and should talk on + ;; *DEBUG-IO* from now on. (KLUDGE: This is a normative + ;; statement, not a description of reality.:-| There's a lot of + ;; older debugger code which was written to do i/o on whatever + ;; stream was in fashion at the time, and not all of it has + ;; been converted to behave this way. -- WHN 2000-11-16) + (let (;; FIXME: The first two bindings here seem wrong, + ;; violating the principle of least surprise, and making + ;; it impossible for the user to do reasonable things + ;; like using PRINT to send output to the program's + ;; ordinary (possibly redirected-to-a-file) + ;; *STANDARD-OUTPUT*, or using PEEK-CHAR or some such + ;; thing on the program's ordinary (possibly also + ;; redirected) *STANDARD-INPUT*. + (*standard-input* *debug-io*) + (*standard-output* *debug-io*) + ;; This seems reasonable: e.g. if the user has redirected + ;; *ERROR-OUTPUT* to some log file, it's probably wrong + ;; to send errors which occur in interactive debugging to + ;; that file, and right to send them to *DEBUG-IO*. (*error-output* *debug-io*)) (unless (typep condition 'step-condition) - (show-restarts *debug-restarts* *error-output*)) + (format *debug-io* + "~%~@~2%" + '*debug-condition*) + (show-restarts *debug-restarts* *debug-io*) + (terpri *debug-io*)) (internal-debug)))))) -(defun show-restarts (restarts &optional (s *error-output*)) +(defun show-restarts (restarts s) (when restarts (format s "~&restarts:~%") (let ((count 0) @@ -681,18 +707,17 @@ reset to ~S." (push name names-used)))) (incf count))))) -;;; This calls DEBUG-LOOP, performing some simple initializations before doing -;;; so. INVOKE-DEBUGGER calls this to actually get into the debugger. -;;; SB!CONDITIONS::ERROR-ERROR calls this in emergencies to get into a debug -;;; prompt as quickly as possible with as little risk as possible for stepping -;;; on whatever is causing recursive errors. +;;; This calls DEBUG-LOOP, performing some simple initializations +;;; before doing so. INVOKE-DEBUGGER calls this to actually get into +;;; the debugger. SB!CONDITIONS::ERROR-ERROR calls this in emergencies +;;; to get into a debug prompt as quickly as possible with as little +;;; risk as possible for stepping on whatever is causing recursive +;;; errors. (defun internal-debug () (let ((*in-the-debugger* t) (*read-suppress* nil)) (unless (typep *debug-condition* 'step-condition) - (clear-input *debug-io*) - (format *debug-io* - "~&Within the debugger, you can type HELP for help.~%")) + (clear-input *debug-io*)) #!-mp (debug-loop) #!+mp (sb!mp:without-scheduling (debug-loop)))) @@ -736,7 +761,8 @@ reset to ~S." (with-simple-restart (abort "Reduce debugger level (to debug level ~D)." level) - (funcall *debug-prompt*) + (debug-prompt *debug-io*) + (force-output *debug-io*) (let ((input (sb!int:get-stream-command *debug-io*))) (cond (input (let ((cmd-fun (debug-command-p @@ -1124,7 +1150,7 @@ reset to ~S." (def-debug-command "RESTART" () (let ((num (read-if-available :prompt))) (when (eq num :prompt) - (show-restarts *debug-restarts*) + (show-restarts *debug-restarts* *debug-io*) (write-string "restart: ") (force-output) (setf num (read *standard-input*))) @@ -1163,8 +1189,8 @@ reset to ~S." (def-debug-command-alias "?" "HELP") (def-debug-command "ERROR" () - (format t "~A~%" *debug-condition*) - (show-restarts *debug-restarts*)) + (format *debug-io* "~A~%" *debug-condition*) + (show-restarts *debug-restarts* *debug-io*)) (def-debug-command "BACKTRACE" () (backtrace (read-if-available most-positive-fixnum))) diff --git a/src/code/describe.lisp b/src/code/describe.lisp index eb87312..09e84c0 100644 --- a/src/code/describe.lisp +++ b/src/code/describe.lisp @@ -83,7 +83,7 @@ (when (and *print-length* (> n *print-length*)) (format s "~:_...") (return)) - (format s "~:_(~S ~S)" k v))))) + (format s "~:_(~@<~S ~:_~S~:>)" k v))))) (defmethod describe-object ((condition condition) s) (sb-conditions::describe-condition condition s)) diff --git a/src/code/toplevel.lisp b/src/code/toplevel.lisp index 3c210e5..087a71a 100644 --- a/src/code/toplevel.lisp +++ b/src/code/toplevel.lisp @@ -65,21 +65,7 @@ (let ((caught (gensym "CAUGHT"))) `(let ((,caught (catch '%end-of-the-world (/show0 "inside CATCH '%END-OF-THE-WORLD") - (restart-case (progn ,@body) - ;; KLUDGE: I'd like to name this restart QUIT, - ;; but then people would hate me, since in CMU - ;; CL, even though they have essentially the - ;; same QUIT function as SBCL, the "QUIT" - ;; command in the debugger means to return to - ;; the toplevel, not to actually call QUIT. Oh - ;; well. -- WHN 2000-11-01 - (end-of-the-world () - :report (lambda (s) - (format s - "Terminate the current Lisp, ~ - like #'~S." - 'quit)) - (quit)))))) + ,@body))) (/show0 "back from CATCH '%END-OF-THE-WORLD, flushing output") (flush-standard-output-streams) (/show0 "calling UNIX-EXIT") diff --git a/version.lisp-expr b/version.lisp-expr index a81911e..27db04e 100644 --- a/version.lisp-expr +++ b/version.lisp-expr @@ -15,4 +15,4 @@ ;;; versions, and a string like "0.6.5.12" is used for versions which ;;; aren't released but correspond only to CVS tags or snapshots. -"0.6.8.20" +"0.6.8.21"