X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcode%2Fsource-location.lisp;h=3d488d23c65ff5b6dc7424c7e9ebb55647d76d16;hb=65b5ab7e713d04e0d76bc0ee196374f6e57b922f;hp=d281ccfa1cd24dbf4594e64f5698e2f7d58ef89d;hpb=3c8b7b5089ae068f3dcdf84d7545562ac33e67be;p=sbcl.git diff --git a/src/code/source-location.lisp b/src/code/source-location.lisp index d281ccf..3d488d2 100644 --- a/src/code/source-location.lisp +++ b/src/code/source-location.lisp @@ -19,7 +19,7 @@ (when (and (boundp '*source-info*) *source-info*) (make-file-info-namestring *compile-file-pathname* - (source-info-file-info *source-info*))) + (sb!c:get-toplevelish-file-info *source-info*))) :type (or string null)) ;; Toplevel form index (toplevel-form-number @@ -36,11 +36,14 @@ #+sb-xc-host (let ((src (position "src" dir :test #'string= :from-end t))) - (if src - (format nil "SYS:~{~:@(~A~);~}~:@(~A~).LISP" - (subseq dir src) (pathname-name untruename)) - ;; FIXME: just output/stuff-groveled-from-headers.lisp - (namestring untruename))) + (cond + ((and src (not (string= (car (last dir)) "output"))) + (format nil "SYS:~{~:@(~A~);~}~:@(~A~).LISP" + (subseq dir src) (pathname-name untruename))) + (t (aver (string-equal (car (last dir)) "output")) + (aver (string-equal (pathname-name untruename) "stuff-groveled-from-headers")) + (aver (string-equal (pathname-type untruename) "lisp")) + "SYS:OUTPUT;STUFF-GROVELED-FROM-HEADERS.LISP"))) #-sb-xc-host (if (and dir (eq (first dir) :absolute)) (namestring untruename) @@ -50,11 +53,14 @@ #!+sb-source-locations (define-compiler-macro source-location (&environment env) - #+sb-xc-host (declare (ignore env)) - #-sb-xc-host - (unless (policy env (and (> space 1) - (> space debug))) - (make-definition-source-location))) + (declare (ignore env)) + #-sb-xc-host (make-definition-source-location)) + +;; We need a regular definition of SOURCE-LOCATION for calls processed +;; during LOAD on a source file while *EVALUATOR-MODE* is :INTERPRET. +#!+sb-source-locations +(setf (symbol-function 'source-location) + (lambda () (make-definition-source-location))) (/show0 "/Processing source location thunks") #!+sb-source-locations