Hi all,
I've got a bunch of useful functions for general hacking with abcl. Hope they could be useful. Any suggestions on the best place for sending patches (if indeed they are useful enough). abcl contribs, slime contribs, or core abcl?
Yong
;; javap seems to be bundled/more widely available compared to the defaults
(defun disassemble-class-cmd (path) (with-accessors ((d pathname-directory) (n pathname-name)) (merge-pathnames path) (format nil "cd ~{/~a~}; javap -c ~a" (cdr d) n)))
(defun disassemble-class (path) (ext:run-shell-command (disassemble-class-cmd path)))
(setf system::*disassembler* #'disassemble-class-cmd)
(in-package :swank)
(defmethod menu-choices-for-presentation ((throwable java:java-exception)) "Java exception stack traces (different from Lisp stack traces) are also available." (list (list "printStackTrace" (lambda (choice object id) (declare (ignore choice id)) ;; TODO, print to an Emacs buffer instead (java:jcall "printStackTrace" *standard-output* (java:java-exception-cause object))))))
(in-package :swank-backend)
;; Not real frame local variables, but it at least exposes function ;; arguments for possible inspection
(defimplementation frame-locals (index) (loop for id upfrom 0 for item in (java:jcall "toLispList" (nth-frame index)) collect (let () ;; ((id id) (item item)) (list :name "??" :id id :value item))))
(defimplementation frame-var-value (index id) (elt (java:jcall "toLispList" (nth-frame index)) id))
On Mar 16, 2014, at 12:25, Theam Yong Chew senatorzergling@gmail.com wrote:
Hi all,
I've got a bunch of useful functions for general hacking with abcl. Hope they could be useful. Any suggestions on the best place for sending patches (if indeed they are useful enough). abcl contribs, slime contribs, or core abcl?
[…]
Interesting functionality!
I’ve started to move this part into SLIME, via [slime/easye][[1] for subsequent pull request, with the rest to follow as I get the time
(defimplementation frame-locals (index) (loop for id upfrom 0 for item in (java:jcall "toLispList" (nth-frame index)) collect (let () ;; ((id id) (item item)) (list :name "??" :id id :value item))))
(defimplementation frame-var-value (index id) (elt (java:jcall "toLispList" (nth-frame index)) id))
[1]: https://github.com/easye/slime/commit/a379d76ff78ed9ea43c040fbbb63fec49e9121...
armedbear-devel@common-lisp.net