Reputation: 947
I'm using IntelliJ Idea 10 with the La Closure plugin version 0.3.15 and Java 6 I've added Clojure 1.2 to a project.
The breakpoints I put on Java code get hit, but the ones I put on Clojure do not. in fact, if the debugger is stopped on a Java breakpoint, the breakpoints on Clojure code have an x in them and they have a warning that says, for example, No executable code found at line 4 in class at debugland$eval3.
I've tried putting breakpoints in Clojure core functions like println, but I still get the red x's. Would really, really appreciate any help on this. I've tried Idea 9 with both Clojure 1.1 and 1.2 with similar results.
Upvotes: 27
Views: 1512
Reputation: 17801
Not sure if this helps your particular case, as my project is pure clojure, but I wasn't really able to get the debugger to hit my breakpoints until I set up the clojure facet for my project (which strangely I could not figure out how to add to an existing project - I had to make a new project with the facet to start).
This blog goes through the steps, which worked for me:
http://blog.tomeklipski.com/2013/04/running-and-debugging-clojure-code-with.html
I am using IntelliJ IDEA 14.1.4 and La Clojure 0.7.82
Upvotes: 0
Reputation: 4586
I'm using Clojure 1.3 (built from github sources), LaClojure 0.3.74, and Sun Java 6u24 running on IDEA 10.0.3. My breakpoints seem to work as advertised (getting checkmarks in red dots), although you will get x's on breakpoints at non-evaluative code such as [] vs. function_name[]. For example:
(ns clojure.examples.hello
(:gen-class))
(defn hello <---- Get check breakpoints here.
[] <---- Get x breakpoints here, can't eval [] but hello[] is okay!!!
(let [a 12
b (/ a 2) <---- Get check breakpoints here.
c (* b 3)]
(if (< b a)
(println (str b "<" a)) <---- Get check breakpoints here.
(println (str a "<" b)))))
You might want to upgrade to the latest version of IDEA/LaClojure (Java 6uX and Clojure 1.2 should work fine), make sure IDEA knows where to find your clojure jars and which jdk to use (sounds like you know how to config a usable IDEA setup, so you're good there), and make sure you have bp's only in expressions that can be evaluated.
Upvotes: 2
Reputation: 1153
I believe what is happening is that Clojure is creating jvm primitives that Idea's debugger does not understand. This coud mean the the primitives are not the size or type that Idea normally recognizes. See here and here.
This likely can be fixed by making a catalog of the structures/primitives that Clojure uses when writing it's virtual machine code and switching to that when debugging Clojure. Unfortunately, this also means that you may have to wait for IntelliJ to fix the problem.
I've posted the question to Jetbrains Tech Support.
Upvotes: 1