From 296162b9fe8ea26c92367cfb86965d3a57937aad Mon Sep 17 00:00:00 2001 From: William Harold Newman Date: Fri, 9 Jun 2006 17:07:37 +0000 Subject: [PATCH] 0.9.13.35: logged bug 403 added workaround for bug 403 when printing *DEBUG-CONDITION* --- BUGS | 34 +++++++++++++++++++++++++++++++--- NEWS | 6 +++++- src/code/debug.lisp | 23 ++++++++++++++++------- version.lisp-expr | 2 +- 4 files changed, 53 insertions(+), 12 deletions(-) diff --git a/BUGS b/BUGS index 01bae8d..f73845f 100644 --- a/BUGS +++ b/BUGS @@ -2129,9 +2129,6 @@ WORKAROUND: For some more details see comments for (define-alien-type-method (c-string :deport-gen) ...) in host-c-call.lisp. -401: "optimizer runaway on bad constant type specifiers in TYPEP" - (fixed in 0.9.12.12) - 402: "DECLAIM DECLARATION does not inform the PCL code-walker" reported by Vincent Arkesteijn: @@ -2148,3 +2145,34 @@ WORKAROUND: SB-PCL::*VAR-DECLARATIONS-WITHOUT-ARG*. (Assuming it is a variable declaration without argument). +403: FORMAT/PPRINT-LOGICAL-BLOCK of CONDITIONs ignoring *PRINT-CIRCLE* + In sbcl-0.9.13.34, + (defparameter *c* + (make-condition 'simple-error + :format-control "ow... ~S" + :format-arguments '(#1=(#1#)))) + (setf *print-circle* t *print-level* 4) + (format nil "~@<~A~:@>" *c*) + gives + "ow... (((#)))" + where I (WHN) believe the correct result is "ow... #1=(#1#)", + like the result from (PRINC-TO-STRING *C*). The question of + what the correct result is is complicated by the hairy text in + the Hyperspec "22.3.5.2 Tilde Less-Than-Sign: Logical Block", + Other than the difference in its argument, ~@<...~:> is + exactly the same as ~<...~:> except that circularity detection + is not applied if ~@<...~:> is encountered at top level in a + format string. + But because the odd behavior happens even without the at-sign, + (format nil "~<~A~:@>" (list *c*)) ; => "ow... (((#)))" + and because something seemingly similar can happen even in + PPRINT-LOGICAL-BLOCK invoked directly without FORMAT, + (pprint-logical-block (*standard-output* '(some nonempty list)) + (format *standard-output* "~A" '#1=(#1#))) + (which prints "(((#)))" to *STANDARD-OUTPUT*), I don't think + that the 22.3.5.2 trickiness is fundamental to the problem. + + My guess is that the problem is related to the logic around the MODE + argument to CHECK-FOR-CIRCULARITY, but I haven't reverse-engineered + enough of the intended meaning of the different MODE values to be + confident of this. diff --git a/NEWS b/NEWS index bc5a8ea..0583b27 100644 --- a/NEWS +++ b/NEWS @@ -12,7 +12,7 @@ changes in sbcl-0.9.14 relative to sbcl-0.9.13: additionally it just doesn't work in SBCL as currently implemented, thanks to optimizations (that are always valid for the other three SLOT-VALUEish functions, but not for the setter). - * minor incompatibale change: the :SB-LDB feature is now enabled by + * minor incompatible change: the :SB-LDB feature is now enabled by default, and DISABLE-DEBUGGER and ENABLE-DEBUGGER also affect the low-level debugger. * bug fix: class objects can be used as specializers in methods. @@ -35,6 +35,10 @@ changes in sbcl-0.9.14 relative to sbcl-0.9.13: * fixed some bugs revealed by Paul Dietz' test suite: ** MISC.641: LET-conversion were not supposed to work in late compilation stages. + * bug fix: The debugger now does a better job of respecting + (PUSH '(*PRINT-CIRCLE* . T) SB-DEBUG:*DEBUG-PRINT-VARIABLE-ALIST*) + when printing SB-DEBUG:*DEBUG-CONDITION*. (This is a debugger-only + workaround for bug 403.) changes in sbcl-0.9.13 relative to sbcl-0.9.12: * new feature: source path information is generated for macro-expansion diff --git a/src/code/debug.lisp b/src/code/debug.lisp index db912d1..c829c18 100644 --- a/src/code/debug.lisp +++ b/src/code/debug.lisp @@ -507,6 +507,21 @@ reset to ~S." (funcall-with-debug-io-syntax #'%invoke-debugger condition)) +(defun %print-debugger-invocation-reason (condition stream) + (format stream "~2&") + ;; Note: Ordinarily it's only a matter of taste whether to use + ;; FORMAT "~<...~:>" or to use PPRINT-LOGICAL-BLOCK directly, but + ;; until bug 403 is fixed, PPRINT-LOGICAL-BLOCK (STREAM NIL) is + ;; definitely preferred, because the FORMAT alternative was acting odd. + (pprint-logical-block (stream nil) + (format stream + "debugger invoked on a ~S~@[ in thread ~A~]: ~2I~_~A" + (type-of condition) + #!+sb-thread sb!thread:*current-thread* + #!-sb-thread nil + condition)) + (terpri stream)) + (defun %invoke-debugger (condition) (let ((*debug-condition* condition) @@ -518,13 +533,7 @@ reset to ~S." ;; when people redirect *ERROR-OUTPUT*, they could reasonably ;; expect to see error messages logged there, regardless of what ;; the debugger does afterwards.) - (format *error-output* - "~2&~@~%" - (type-of *debug-condition*) - #!+sb-thread sb!thread:*current-thread* - #!-sb-thread nil - *debug-condition*) + (%print-debugger-invocation-reason condition *error-output*) (error (condition) (setf *nested-debug-condition* condition) (let ((ndc-type (type-of *nested-debug-condition*))) diff --git a/version.lisp-expr b/version.lisp-expr index 0bbdf18..fafd8bd 100644 --- a/version.lisp-expr +++ b/version.lisp-expr @@ -17,4 +17,4 @@ ;;; 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.9.13.34" +"0.9.13.35" -- 1.7.10.4