0.7.7.23:
authorChristophe Rhodes <csr21@cam.ac.uk>
Fri, 13 Sep 2002 16:28:40 +0000 (16:28 +0000)
committerChristophe Rhodes <csr21@cam.ac.uk>
Fri, 13 Sep 2002 16:28:40 +0000 (16:28 +0000)
Merge backend_cleanup_1_branch
... I hope this is right :-)

NEWS
doc/sbcl.1
package-data-list.lisp-expr
src/code/condition.lisp
src/code/debug.lisp
src/pcl/boot.lisp
tests/condition.pure.lisp [new file with mode: 0644]
version.lisp-expr

diff --git a/NEWS b/NEWS
index 0300b56..12d2d17 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1268,6 +1268,7 @@ changes in sbcl-0.7.8 relative to sbcl-0.7.7:
     (thanks to Alexey Dejneka)
   * fixed several bugs in PCL's error checking (thanks to Gerd
     Moellmann)
+  * fixed bug in printing of FILE-ERROR (thanks to Antonio Martinez)
 
 planned incompatible changes in 0.7.x:
 * When the profiling interface settles down, maybe in 0.7.x, maybe
index 908f9a1..942f0f8 100644 (file)
@@ -267,9 +267,11 @@ Supported runtime options are
 .TP 3
 .B --core <corefilename>
 Run the specified Lisp core file instead of the default. (See the FILES
-section.) Note that if the Lisp core file is a user-created core file, it may
-run a nonstandard toplevel which does not recognize the standard toplevel
-options.
+section for the standard core, or the system documentation for
+SB-INT:SAVE-LISP-AND-DIE for information about how to create a 
+custom core.) Note that if the Lisp core file is a user-created core
+file, it may run a nonstandard toplevel which does not recognize the
+standard toplevel options.
 .TP 3
 .B --noinform
 Suppress the printing of any banner or other informational message at
@@ -285,7 +287,7 @@ Runtime options, including any --end-runtime-options option,
 are stripped out of the command line before the
 Lisp toplevel logic gets a chance to see it.
 
-Supported toplevel options for the standard SBCL core are
+The toplevel options supported by the standard SBCL core are
 .TP 3
 .B --sysinit <filename>
 Load filename instead of the default system-wide initialization file.
index b074a2e..9445a75 100644 (file)
@@ -339,7 +339,7 @@ like *STACK-TOP-HINT* and unsupported stuff like *TRACED-FUN-LIST*."
              "*FLUSH-DEBUG-ERRORS*" "*IN-THE-DEBUGGER*"
              "*TRACE-INDENTATION-STEP*" "*MAX-TRACE-INDENTATION*"
              "*TRACE-FRAME*" "*TRACED-FUN-LIST*"
-             "ARG" "BACKTRACE" "INTERNAL-DEBUG" "VAR"
+             "ARG" "BACKTRACE" "BACKTRACE-AS-LIST" "INTERNAL-DEBUG" "VAR"
              "*PRINT-LOCATION-KIND*"
              "*ONLY-BLOCK-START-LOCATIONS*" "*STACK-TOP-HINT*"
              "*TRACE-VALUES*" "DO-DEBUG-COMMAND"
index bd9c545..9a3ae5e 100644 (file)
   ((pathname :reader file-error-pathname :initarg :pathname))
   (:report
    (lambda (condition stream)
-     (format stream
-            "~@<error on file ~_~S: ~2I~:_~?~:>"
-            (file-error-pathname condition)
-            ;; FIXME: ANSI's FILE-ERROR doesn't have FORMAT-CONTROL and 
-            ;; FORMAT-ARGUMENTS, and the inheritance here doesn't seem
-            ;; to give us FORMAT-CONTROL or FORMAT-ARGUMENTS either.
-            ;; So how does this work?
-            (serious-condition-format-control condition)
-            (serious-condition-format-arguments condition)))))
+     (format stream "error on file ~S" (file-error-pathname condition)))))
 
 (define-condition package-error (error)
   ((package :reader package-error-package :initarg :package)))
index 19f3896..ec3d3b2 100644 (file)
@@ -464,6 +464,20 @@ Other commands:
     (print-frame-call frame :number t))
   (fresh-line *standard-output*)
   (values))
+
+(defun backtrace-as-list (&optional (count most-positive-fixnum))
+  #!+sb-doc "Return a list representing the current BACKTRACE."
+  (do ((reversed-result nil)
+       (frame (if *in-the-debugger* *current-frame* (sb!di:top-frame))
+             (sb!di:frame-down frame))
+       (count count (1- count)))
+      ((or (null frame) (zerop count))
+       (nreverse reversed-result))
+    (push (frame-call-as-list frame) reversed-result)))
+
+(defun frame-call-as-list (frame)
+  (cons (sb!di:debug-fun-name (sb!di:frame-debug-fun frame))
+       (frame-args-as-list frame)))
 \f
 ;;;; frame printing
 
@@ -511,44 +525,51 @@ Other commands:
            (:copier nil))
   string)
 
-;;; Print FRAME with verbosity level 1. If we hit a &REST arg, then
-;;; print as many of the values as possible, punting the loop over
-;;; lambda-list variables since any other arguments will be in the
-;;; &REST arg's list of values.
-(defun print-frame-call-1 (frame)
+;;; Extract the function argument values for a debug frame.
+(defun frame-args-as-list (frame)
   (let ((debug-fun (sb!di:frame-debug-fun frame))
        (loc (sb!di:frame-code-location frame))
-       (reversed-args nil))
-
-    ;; Construct function arguments in REVERSED-ARGS.
+       (reversed-result nil))
     (handler-case
-       (dolist (ele (sb!di:debug-fun-lambda-list debug-fun))
-         (lambda-list-element-dispatch ele
-           :required ((push (frame-call-arg ele loc frame) reversed-args))
-           :optional ((push (frame-call-arg (second ele) loc frame)
-                            reversed-args))
-           :keyword ((push (second ele) reversed-args)
-                     (push (frame-call-arg (third ele) loc frame)
-                           reversed-args))
-           :deleted ((push (frame-call-arg ele loc frame) reversed-args))
-           :rest ((lambda-var-dispatch (second ele) loc
+       (progn
+         (dolist (ele (sb!di:debug-fun-lambda-list debug-fun))
+           (lambda-list-element-dispatch ele
+            :required ((push (frame-call-arg ele loc frame) reversed-result))
+            :optional ((push (frame-call-arg (second ele) loc frame)
+                             reversed-result))
+            :keyword ((push (second ele) reversed-result)
+                      (push (frame-call-arg (third ele) loc frame)
+                            reversed-result))
+            :deleted ((push (frame-call-arg ele loc frame) reversed-result))
+            :rest ((lambda-var-dispatch (second ele) loc
                     nil
                     (progn
-                      (setf reversed-args
+                      (setf reversed-result
                             (append (reverse (sb!di:debug-var-value
                                               (second ele) frame))
-                                    reversed-args))
+                                    reversed-result))
                       (return))
                     (push (make-unprintable-object
                            "unavailable &REST argument")
-                          reversed-args)))))
+                    reversed-result)))))
+         ;; As long as we do an ordinary return (as opposed to SIGNALing
+         ;; a CONDITION) from the DOLIST above:
+         (nreverse reversed-result))
       (sb!di:lambda-list-unavailable
        ()
-       (push (make-unprintable-object "lambda list unavailable")
-            reversed-args)))
+       :lambda-list-unavailable))))
+
+;;; Print FRAME with verbosity level 1. If we hit a &REST arg, then
+;;; print as many of the values as possible, punting the loop over
+;;; lambda-list variables since any other arguments will be in the
+;;; &REST arg's list of values.
+(defun print-frame-call-1 (frame)
+  (let ((debug-fun (sb!di:frame-debug-fun frame))
+       (loc (sb!di:frame-code-location frame)))
 
     (pprint-logical-block (*standard-output* nil :prefix "(" :suffix ")")
-      (let ((args (nreverse (mapcar #'ensure-printable-object reversed-args))))
+      (let ((args (mapcar #'ensure-printable-object
+                         (frame-args-as-list frame))))
        ;; Since we go to some trouble to make nice informative function
        ;; names like (PRINT-OBJECT :AROUND (CLOWN T)), let's make sure
        ;; that they aren't truncated by *PRINT-LENGTH* and *PRINT-LEVEL*.
@@ -992,6 +1013,10 @@ reset to ~S."
 ;;; potential DEBUG-VAR from the lambda-list, then the second value is
 ;;; T. If this returns a keyword symbol or a value from a rest arg,
 ;;; then the second value is NIL.
+;;;
+;;; FIXME: There's probably some way to merge the code here with
+;;; FRAME-ARGS-AS-LIST. (A fair amount of logic is already shared
+;;; through LAMBDA-LIST-ELEMENT-DISPATCH, but I suspect more could be.)
 (declaim (ftype (function (index list)) nth-arg))
 (defun nth-arg (count args)
   (let ((n count))
@@ -1008,8 +1033,7 @@ reset to ~S."
        :rest ((let ((var (second ele)))
                 (lambda-var-dispatch var (sb!di:frame-code-location
                                           *current-frame*)
-                  (error "unused &REST argument before n'th
-argument")
+                  (error "unused &REST argument before n'th argument")
                   (dolist (value
                            (sb!di:debug-var-value var *current-frame*)
                            (error
index 0954011..1c9b4fe 100644 (file)
@@ -239,7 +239,11 @@ bootstrapping.
   (flet ((ensure (arg ok)
            (unless ok
             (error
-             "invalid argument ~S in the generic function lambda list ~S"
+             ;; (s/invalid/non-ANSI-conforming/ because the old PCL
+             ;; implementation allowed this, so people got used to
+             ;; it, and maybe this phrasing will help them to guess
+             ;; why their program which worked under PCL no longer works.)
+             "~@<non-ANSI-conforming argument ~S ~_in the generic function lambda list ~S~:>"
              arg lambda-list))))
     (multiple-value-bind (required optional restp rest keyp keys allowp
                           auxp aux morep more-context more-count)
diff --git a/tests/condition.pure.lisp b/tests/condition.pure.lisp
new file mode 100644 (file)
index 0000000..a36bd71
--- /dev/null
@@ -0,0 +1,22 @@
+;;;; side-effect-free tests of the condition system
+
+;;;; This software is part of the SBCL system. See the README file for
+;;;; more information.
+;;;;
+;;;; While most of SBCL is derived from the CMU CL system, the test
+;;;; files (like this one) were written from scratch after the fork
+;;;; from CMU CL.
+;;;; 
+;;;; This software is in the public domain and is provided with
+;;;; absolutely no warranty. See the COPYING and CREDITS files for
+;;;; more information.
+
+(cl:in-package :cl-user)
+
+;;; Until 0.7.7.21, (MAKE-CONDITION 'FILE-ERROR :PATHNAME "FOO")
+;;; wasn't printable, because the REPORT function for FILE-ERROR
+;;; referred to unbound slots. This was reported and fixed by Antonio
+;;; Martinez (sbcl-devel 2002-09-10).
+(format t
+       "~&printable now: ~A~%"
+       (make-condition 'file-error :pathname "foo"))
index 7e2dbc1..7d3465a 100644 (file)
@@ -13,9 +13,9 @@
 ;;;
 ;;; Conventionally a string like "0.6.6", with three numeric fields,
 ;;; is used for released versions, and a string like "0.6.5.12", with
-;;; four numeric fields, is used for versions which aren't released
-;;; but correspond only to CVS tags or snapshots. (And occasionally
-;;; for internal versions, especially for internal versions off the
-;;; main CVS branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".)
+;;; four numeric fields, is used for CVS 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.7.7.20-backend-cleanup-1.10"
+"0.7.7.23"