master: Bind *PRINT-READABLY* to NIL when printing TRACE "returned" message
melisgl via Sbcl-commits <[email protected]> Sat, 30 May 2026 10:18:09 +0000
| Newsgroups | gmane.lisp.steel-bank.cvs |
|---|---|
| Message-ID | <[email protected]> |
The branch "master" has been updated in SBCL:
via 39ea7adbefe5d6d4b0cad3cfdf0b3dca349506b1 (commit)
from 92d060d08232f96d7e7b7a7a6729a87438f5a72b (commit)
- Log -----------------------------------------------------------------
commit 39ea7adbefe5d6d4b0cad3cfdf0b3dca349506b1
Author: Gabor Melis <[email protected]>
Date: Fri May 29 09:54:56 2026 +0200
Bind *PRINT-READABLY* to NIL when printing TRACE "returned" message
It was already bound to NIL for the "call" message.
---
NEWS | 2 ++
src/code/ntrace.lisp | 3 ++-
tests/trace.impure.lisp | 10 ++++++++++
3 files changed, 14 insertions(+), 1 deletion(-)
diff --git a/NEWS b/NEWS
index b7dc4366b..bdfc34262 100644
--- a/NEWS
+++ b/NEWS
@@ -3,6 +3,8 @@
changes relative to sbcl-2.6.5:
* minor incompatible change: FDEFINITION now returns the outermost wrapper
(added e.g. by TRACE, PROFILE) like SYMBOL-FUNCTION. (lp#799533)
+ * bug fix: TRACE no longer fails when trying to print a return value that
+ cannot be printed readble and *PRINT-READABLY* is true.
* documentation: SB-INTROSPECT is documented.
changes in sbcl-2.6.5 relative to sbcl-2.6.4:
diff --git a/src/code/ntrace.lisp b/src/code/ntrace.lisp
index 5f4934a54..fad1e26c2 100644
--- a/src/code/ntrace.lisp
+++ b/src/code/ntrace.lisp
@@ -360,7 +360,8 @@
(or (cdr entry)
(let ((cond (trace-info-condition-after info)))
(and cond (apply #'funcall (cdr cond) frame values)))))
- (let ((*current-level-in-print* 0)
+ (let ((*print-readably* nil)
+ (*current-level-in-print* 0)
(*standard-output* (make-string-output-stream))
(*in-trace* t))
(case (trace-info-report info)
diff --git a/tests/trace.impure.lisp b/tests/trace.impure.lisp
index 4722bad00..09a3a99c0 100644
--- a/tests/trace.impure.lisp
+++ b/tests/trace.impure.lisp
@@ -137,3 +137,13 @@
(let ((s (with-output-to-string (*trace-output*)
(g1))))
(assert (search "G1 returned INVOKED" s))))
+
+
+(defun echo (x)
+ x)
+
+(trace echo)
+
+;;; Check that this does not fail when printing *PACKAGE*.
+(let ((*print-readably* t))
+ (echo *package*))
-----------------------------------------------------------------------
hooks/post-receive
--
SBCL