This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-02-14
Channels
- # announcements (11)
- # babashka (82)
- # beginners (51)
- # calva (11)
- # cider (3)
- # clj-kondo (62)
- # cljdoc (10)
- # cljs-dev (22)
- # clojure (75)
- # clojure-boston (1)
- # clojure-brasil (3)
- # clojure-czech (4)
- # clojure-europe (49)
- # clojure-france (10)
- # clojure-italy (16)
- # clojure-nl (5)
- # clojure-uk (9)
- # clojurescript (69)
- # community-development (33)
- # conjure (12)
- # core-async (6)
- # cursive (2)
- # datalevin (7)
- # datomic (6)
- # graalvm (13)
- # gratitude (2)
- # honeysql (3)
- # introduce-yourself (1)
- # lsp (37)
- # nextjournal (62)
- # off-topic (29)
- # pathom (1)
- # quil (2)
- # reitit (4)
- # releases (2)
- # sci (1)
- # shadow-cljs (28)
- # spacemacs (10)
- # sql (1)
- # tools-build (3)
- # vim (3)
Has anyone got suggestions on why I’m struggling to break using #dbg
or #break
work in Spacemacs + Cider? If I , d b
the same function, I can invoke, hit breakpoints, and debug successfully.
I have always used , d b
They both should sprinkle (invisible) break points throughout an expression.
I can try #dbg later today, but if it's not working the same then I assume it's a Cider issue
Is there an example you can share where it's not working?
I typically use , d b
but this this case need conditional breakpoint support hence trying #dbg
I’ve not got a non commercial project I’ve tried it on, but I think it will fail on all projects (I’ve never seen it work on a hand full of work projects). I’ll try at lunch on a toy project.
So I assume it's something like this. I'll also give it a try
(dotimes [i 10]
#dbg ^{:break/when (= i 7)}
(prn i))
The above code does break correctly when evaluating the dotimes expression (`, e f`)
Using #break without a condition also works in this basic example
(dotimes [i 10]
#break (= i 7)
(prn i))
So.... it also works for me in my own deps.edn
project, but not a more complex commercial project. Looks like I need to do into that a bit more. Thanks.
The only thing I can think of is that is not actually meeting the condition set with :break/when
, or that there is a subtle bug in the cider-debug code.
This has been a useful exercise for me, thanks. I've pushed some very simple examples to the Practicalli Spacemacs book
https://practical.li/spacemacs/debug-clojure/cider-debug.html
Sometimes there used to be problems with executions in other threads like a ring handler- I can try to check if it works for our app tomorrow
Cheers @U05254DQM, I had ruled out conditional syntax etc by simplifying and removing the conditional. @U06BE1L6T I have similar issues when using ring handlers, but my problem earlier was a single threaded app, with the function being tested invoked indirectly and directly on the same thread.