Fork me on GitHub

So, I’ve been successfully using cider-debug-defun-at-point to allow me to debug functions. However, I’ve been trying to set breakpoints at certain locations within a function to allow me to skip noisy sections. This works fine in a toy project.

(ns test-dbg.core)

(defn foo
  "I don't do a whole lot."
  #dbg (println x "Hello, World!"))

(foo 3)
But doesn’t work in my work project when debugging a http request.
(defn- return-something
  [dep1 blah
  (when blah 
The function evaluates successfully but the breakpoint doesn’t invoke the debugger. I’ve tried #break too? What am I doing wrong?


The function is not called from the repl, right? I had the same problem and my guess is that cider does not get an answer from the repl for asynchronous function calls and thus does not know of the execution of the function. But that's just a guess as I didn't have the time to look into the implementation yet.


Yeah, I recall there was some sporadic issue with async evals, but I think it was fixed a while ago.


Tip: execute the function you want to debug manually or from a test.


@U02MWDCU3U6 before the function evals from a http request or instead of?


I do it instead of

👍 1
Dmitri Akatov11:09:25

It looks like this still does not work as of cider-nrepl 0.28.5 ? I mean starting to debug on an “asynchronous” call to a function marked for debugging (e.g. on an http request)?


Did you start the project from the same REPL you've connected CIDER to?


Yeah, same REPL :thumbsup:


That's pretty much the only thing you need to do for this to work.


So, after further investigation, I can now use #dbg in a function that I eval using C-x C-e . However, this does not work if I eval the function using C-c C-k which is what I was doing prior.


are you saving the buffer?


which functions do these key chords invoke? I’m assuming eval last expression and load-buffer?