master: find-definition-sources-by-name: find alien callbacks
stassats via Sbcl-commits <[email protected]>
| Newsgroups | gmane.lisp.steel-bank.cvs |
|---|---|
| Message-ID | <[email protected]> |
The branch "master" has been updated in SBCL:
via 1434677ca0825f78891e77a37a19064eb19046e3 (commit)
from 6d83d9db42532bafd4c912de25156144d9837d1e (commit)
- Log -----------------------------------------------------------------
commit 1434677ca0825f78891e77a37a19064eb19046e3
Author: Stas Boukarev <[email protected]>
Date: Thu Apr 30 15:17:13 2026 +0300
find-definition-sources-by-name: find alien callbacks
---
contrib/sb-introspect/introspect.lisp | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/contrib/sb-introspect/introspect.lisp b/contrib/sb-introspect/introspect.lisp
index d2bc8a07a..2b3536c92 100644
--- a/contrib/sb-introspect/introspect.lisp
+++ b/contrib/sb-introspect/introspect.lisp
@@ -223,6 +223,7 @@ Public definition TYPEs:
:SYMBOL-MACRO
:TYPE
:ALIEN-TYPE
+ :ALIEN-CALLBACK
:VARIABLE
:DECLARATION
@@ -406,6 +407,13 @@ will return NIL."
(let ((loc (info :source-location type name)))
(and loc
(translate-source-location loc))))
+ (:alien-callback
+ (let ((cb (gethash name sb-alien::*alien-callables*)))
+ (when cb
+ (let ((index (sb-alien::alien-callback-index cb)))
+ (when (and index
+ (array-in-bounds-p sb-alien::*alien-callback-functions* index))
+ (find-definition-source (aref sb-alien::*alien-callback-functions* index)))))))
((:source-transform)
(let* ((transform-fun
(or (info :function :source-transform name)
-----------------------------------------------------------------------
hooks/post-receive
--
SBCL