From fe27d4f190a9079834bb794e7af6e330d95cbad9 Mon Sep 17 00:00:00 2001 From: Nikodemus Siivola Date: Tue, 10 May 2011 19:16:53 +0000 Subject: [PATCH] 1.0.48.6: %SIMPLE-EVAL and backtraces Functions from %SIMPLE-EVAL have names such as (EVAL (DEFMACRO FOO)), which looks pretty confusing in the backtrace. Replace that with #:EVAL-THUNK, which is more descriptive and less head-scratchy. Also, calls to SIMPLE-EVAL-IN-LEXENV and EVAL -- when they show up in backtraces -- have lisp forms as arguments. This causes pretty-printing to try and split things onto multiple lines, but *PRINT-LINES* tends to be 1 during backtracing. ...so bind *PRINT-PRETTY* to NIL when printing eval-frame arguments iff *PRINT-LINES* is 1 in order to have something useful show up the backtrace. --- NEWS | 2 ++ src/code/debug.lisp | 21 +++++++++++++++++---- version.lisp-expr | 2 +- 3 files changed, 20 insertions(+), 5 deletions(-) diff --git a/NEWS b/NEWS index 627b5e0..6fb5ce4 100644 --- a/NEWS +++ b/NEWS @@ -6,6 +6,8 @@ changes relative to sbcl-1.0.48: virtual source-file information, eg. overriding input-file of COMPILE-FILE when a temporary file is used for compilation. * enhancement: ASDF has been updated to version 2.015.1. + * enhancement: backtraces involving frames from the default evaluator + are more readable. changes in sbcl-1.0.48 relative to sbcl-1.0.47: * incompatible change: SB!KERNEL:INSTANCE-LAMBDA, deprecated for over five diff --git a/src/code/debug.lisp b/src/code/debug.lisp index ec41b0d..cca2e62 100644 --- a/src/code/debug.lisp +++ b/src/code/debug.lisp @@ -343,6 +343,12 @@ thread, NIL otherwise." ;; &AUX-BINDINGS appear in backtraces, so they are ;; left alone for now. --NS 2005-02-28 (case (first name) + ((eval) + ;; The name of an evaluator thunk contains + ;; the source context -- but that makes for a + ;; confusing frame name, since it can look like an + ;; EVAL call with a bogus argument. + (values '#:eval-thunk nil)) ((sb!c::xep sb!c::tl-xep) (clean-xep name args)) ((sb!c::&more-processor) @@ -397,10 +403,17 @@ thread, NIL otherwise." ;; 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. - (let ((args (ensure-printable-object args))) - (if (listp args) - (format stream "~{ ~_~S~}" args) - (format stream " ~S" args)))) + (let ((print-args (ensure-printable-object args)) + ;; Special case *PRINT-PRETTY* for eval frames: if + ;; *PRINT-LINES* is 1, turn off pretty-printing. + (*print-pretty* + (if (and (eql 1 *print-lines*) + (member name '(eval simple-eval-in-lexenv))) + nil + *print-pretty*))) + (if (listp print-args) + (format stream "~{ ~_~S~}" print-args) + (format stream " ~S" print-args)))) (when kind (format stream "[~S]" kind)))) (when (>= verbosity 2) diff --git a/version.lisp-expr b/version.lisp-expr index 2ac7701..2e2f4de 100644 --- a/version.lisp-expr +++ b/version.lisp-expr @@ -20,4 +20,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".) -"1.0.48.5" +"1.0.48.6" -- 1.7.10.4