Skip to content

Commit

Permalink
(fspec-definition-locations): Handle
Browse files Browse the repository at this point in the history
:top-level-form entries that appear in backtraces.
  • Loading branch information
Matthias Koeppe committed May 4, 2006
1 parent f64a9cd commit b909530
Showing 1 changed file with 18 additions and 9 deletions.
27 changes: 18 additions & 9 deletions swank-allegro.lisp
Expand Up @@ -400,16 +400,25 @@
(prin1-to-string (second fspec)))))))

(defun fspec-definition-locations (fspec)
(let ((defs (excl::find-source-file fspec)))
(if (null defs)
(list
(list (list nil fspec)
(list :error
(format nil "Unknown source location for ~A"
(fspec->string fspec)))))
(cond
((and (listp fspec)
(eql (car fspec) :top-level-form))
(destructuring-bind (top-level-form file position) fspec
(list
(list (list nil fspec)
(make-location (list :buffer file)
(list :position position))))))
(t
(let ((defs (excl::find-source-file fspec)))
(if (null defs)
(list
(list (list nil fspec)
(list :error
(format nil "Unknown source location for ~A"
(fspec->string fspec)))))
(loop for (fspec type file top-level) in defs
collect (list (list type fspec)
(find-fspec-location fspec type file top-level))))))
collect (list (list type fspec)
(find-fspec-location fspec type file top-level))))))))

(defimplementation find-definitions (symbol)
(fspec-definition-locations symbol))
Expand Down

0 comments on commit b909530

Please sign in to comment.