Skip to content
Snippets Groups Projects
Commit e8fb8bb6 authored by ram's avatar ram
Browse files

Update FUN-DEFINED-FROM-PATHNAME to understand byte functions.

parent bb2a1da8
No related branches found
No related tags found
No related merge requests found
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
;;; Scott Fahlman or slisp-group@cs.cmu.edu. ;;; Scott Fahlman or slisp-group@cs.cmu.edu.
;;; ;;;
(ext:file-comment (ext:file-comment
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/hemlock/rompsite.lisp,v 1.1.1.29 1993/08/19 13:57:55 ram Exp $") "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/hemlock/rompsite.lisp,v 1.1.1.30 1993/09/14 12:18:59 ram Exp $")
;;; ;;;
;;; ********************************************************************** ;;; **********************************************************************
;;; ;;;
...@@ -709,21 +709,26 @@ ...@@ -709,21 +709,26 @@
;;; not defined in some file, then nil is returned. ;;; not defined in some file, then nil is returned.
;;; ;;;
(defun fun-defined-from-pathname (function) (defun fun-defined-from-pathname (function)
"Takes a symbol or function and returns the pathname for the file the function "Takes a symbol or function and returns the pathname for the file the
was defined in. If it was not defined in some file, nil is returned." function was defined in. If it was not defined in some file, nil is
(typecase function returned."
(symbol (fun-defined-from-pathname (fdefinition function))) (flet ((frob (code)
(compiled-function (let ((info (kernel:%code-debug-info code)))
(let ((info (kernel:%code-debug-info (when info
(kernel:function-code-header (let ((sources (c::debug-info-source info)))
(kernel:%function-self function))))) (when sources
(when info (let ((source (car sources)))
(let ((sources (c::compiled-debug-info-source info))) (when (eq (c::debug-source-from source) :file)
(when sources (c::debug-source-name source)))))))))
(let ((source (car sources))) (typecase function
(when (eq (c::debug-source-from source) :file) (symbol (fun-defined-from-pathname (fdefinition function)))
(c::debug-source-name source)))))))) (kernel:byte-closure
(t nil))) (fun-defined-from-pathname (kernel:byte-closure-function function)))
(kernel:byte-function
(frob (c::byte-function-component function)))
(function
(frob (kernel:function-code-header (kernel:%function-self function))))
(t nil))))
(defvar *editor-describe-stream* (defvar *editor-describe-stream*
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment