Error formatting macro: pagetree: java.lang.NullPointerException
Skip to end of metadata
Go to start of metadata
You are viewing an old version of this page. View the current version. Compare with Current  |   View Page History

I have had success debugging Clojure code with JSwat, specifically, version 3.16 on Mac OS X. You can start Clojure under JSwat, but with limited input capabilities. Better is to attach JSwat to a running instance of Clojure. You have to start Java with these flags to support remote debugging:

When Clojure starts it will print something like:

Then in JSwat choose Attach... and put localhost for Host and the socket address for Port. In JSwat, open up some Clojure file you have loaded, (including boot.clj) and you can set breakpoints in Clojure source. Breakpoints, call stack, local variable views and step debugging (within Clojure code and from Clojure to Java and back) all work. You can also attach to Clojure when it is started as the inferior Lisp in Emacs. Best of all, if you change a .clj file and reload it, JSwat will pick up the changed file and you can set breakpoints etc in the new code without stopping and restarting JSwat or Clojure.

Labels: