From df5b19cf30ba4fc5dea2758139040ee87f2e0372 Mon Sep 17 00:00:00 2001 From: rtoy <rtoy> Date: Fri, 22 Jan 2010 13:36:06 +0000 Subject: [PATCH] Fix handling of debug sources. When trying to read the source form from the source file, the file is opened using the default external format. This is not right if the file was compiled using a different external format, and we try to read it using the default format. compiler/debug-dump.lisp: o Set the INFO slot to the external format used to source files. code/debug-info.lisp: o Add comment that the INFO slot contains the external format for :FILES. (It was previously unused.) code/debug.lisp: o Open the source file with the same format as used to compile the file. --- code/debug-info.lisp | 4 +++- code/debug.lisp | 6 ++++-- compiler/debug-dump.lisp | 5 +++-- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/code/debug-info.lisp b/code/debug-info.lisp index 452e3f1ae..18b7bbe61 100644 --- a/code/debug-info.lisp +++ b/code/debug-info.lisp @@ -5,7 +5,7 @@ ;;; Carnegie Mellon University, and has been placed in the public domain. ;;; (ext:file-comment - "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/debug-info.lisp,v 1.28 2009/06/11 16:03:57 rtoy Rel $") + "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/debug-info.lisp,v 1.29 2010/01/22 13:36:06 rtoy Exp $") ;;; ;;; ********************************************************************** ;;; @@ -468,6 +468,8 @@ function (which would be useful info anyway). ;; If from :LISP, this is the function whose source is form 0. ;; If from :STREAM, this is whatever was the :SOURCE-INFO argument to ;; COMPILE-FROM-STREAM. + ;; If from :FILE, this is the external format used to read from the + ;; file while compiling (info nil)) diff --git a/code/debug.lisp b/code/debug.lisp index 370f61532..7e5e061d1 100644 --- a/code/debug.lisp +++ b/code/debug.lisp @@ -5,7 +5,7 @@ ;;; Carnegie Mellon University, and has been placed in the public domain. ;;; (ext:file-comment - "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/debug.lisp,v 1.67 2009/09/15 15:47:10 rtoy Rel $") + "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/debug.lisp,v 1.68 2010/01/22 13:36:06 rtoy Exp $") ;;; ;;; ********************************************************************** ;;; @@ -1479,7 +1479,9 @@ See the CMU Common Lisp User's Manual for more information. (pathname name))) (setq *cached-readtable* nil) (when *cached-source-stream* (close *cached-source-stream*)) - (setq *cached-source-stream* (open name :if-does-not-exist nil)) + (setq *cached-source-stream* + (open name :if-does-not-exist nil + :external-format (or (c::debug-source-info d-source) :default))) (unless *cached-source-stream* (error "Source file no longer exists:~% ~A." (namestring name))) (format t "~%; File: ~A~%" (namestring name))) diff --git a/compiler/debug-dump.lisp b/compiler/debug-dump.lisp index 97bf78d92..2e2b70ec4 100644 --- a/compiler/debug-dump.lisp +++ b/compiler/debug-dump.lisp @@ -5,7 +5,7 @@ ;;; Carnegie Mellon University, and has been placed in the public domain. ;;; (ext:file-comment - "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/debug-dump.lisp,v 1.47 2004/04/06 20:44:01 rtoy Rel $") + "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/debug-dump.lisp,v 1.48 2010/01/22 13:36:06 rtoy Exp $") ;;; ;;; ********************************************************************** ;;; @@ -310,7 +310,8 @@ otherwise the truename." :start-positions (unless (eq *byte-compile* 't) (coerce-to-smallest-eltype - (file-info-positions x))))) + (file-info-positions x))) + :info (source-info-external-format info))) (name (file-info-name x))) (etypecase name ((member :stream :lisp) -- GitLab