sb-introspect:find-definition-sources-by-name: support globals.
authorStas Boukarev <stassats@gmail.com>
Tue, 15 Oct 2013 14:29:02 +0000 (18:29 +0400)
committerStas Boukarev <stassats@gmail.com>
Tue, 15 Oct 2013 14:29:02 +0000 (18:29 +0400)
(sb-ext:defglobal x ...) couldn't be found.

contrib/sb-introspect/introspect.lisp
contrib/sb-introspect/sb-introspect.asd
contrib/sb-introspect/test-driver.lisp
contrib/sb-introspect/test.lisp

index f4041fd..79706bb 100644 (file)
@@ -195,7 +195,8 @@ If an unsupported TYPE is requested, the function will return NIL.
      (case type
        ((:variable)
         (when (and (symbolp name)
-                   (eq (sb-int:info :variable :kind name) :special))
+                   (member (sb-int:info :variable :kind name)
+                           '(:global :special)))
           (translate-source-location (sb-int:info :source-location type name))))
        ((:constant)
         (when (and (symbolp name)
index d547cc6..62734d0 100644 (file)
@@ -63,8 +63,8 @@
          (make-pathname :directory (pathname-directory
                                     '#.(or *compile-file-pathname*
                                            *load-pathname*)))))
-    (multiple-value-bind (soft strict pending)
-        (funcall (intern "DO-TESTS" (find-package "SB-RT")))
+    (multiple-value-bind (soft strict #+sb-testing-contrib pending)
+        (funcall (find-symbol "DO-TESTS" "SB-RT"))
       (fresh-line)
       (unless strict
         #+sb-testing-contrib
index aa7bfc8..fe920f0 100644 (file)
     (matchp-name :function 'cl-user::loaded-as-source-fun 3)
   t)
 
+(deftest find-source-stuff.
+    (matchp-name :variable 'cl-user::**global** 29)
+  t)
+
 ;;; Check wrt. interplay of generic functions and their methods.
 
 (defgeneric xuuq (gf.a gf.b          &rest gf.rest &key gf.k-X))
index cd100c5..682074a 100644 (file)
@@ -74,3 +74,5 @@
 (eval-when (:compile-toplevel)
   (defun compile-time-too-fun ()
     :foo))
+
+(sb-ext:defglobal **global** 'value)