Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit f007e7c

Browse files
committedJun 15, 2023
Use heuristic for instrumenting top level of #dbg
Using #dbg on a def/defn should skip the breakpoint since return value is uninteresting. Doing otherwise causes :continue to behave incorrectly on a top-level instrumented form, since the the toplevel breakpoint is registered as the first coor even if it never triggers.
1 parent 70a39f6 commit f007e7c

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed
 

‎src/cider/nrepl/middleware/debug.clj

+8-1
Original file line numberDiff line numberDiff line change
@@ -497,6 +497,13 @@ this map (identified by a key), and will `dissoc` it afterwards."}
497497
(breakpoint
498498
~form ~dbg-state ~original-form)))
499499

500+
(defmacro breakpoint-if-interesting-with-initial-debug-bindings
501+
{:style/indent 1}
502+
[form dbg-state original-form]
503+
`(with-initial-debug-bindings
504+
(breakpoint-if-interesting
505+
~form ~dbg-state ~original-form)))
506+
500507
(defmacro breakpoint-if-exception-with-initial-debug-bindings
501508
{:style/indent 1}
502509
[form dbg-state original-form]
@@ -627,7 +634,7 @@ this map (identified by a key), and will `dissoc` it afterwards."}
627634
`form` itself is also marked."
628635
[form]
629636
(ins/tag-form (ins/tag-form-recursively form #'breakpoint-if-interesting)
630-
#'breakpoint-with-initial-debug-bindings))
637+
#'breakpoint-if-interesting-with-initial-debug-bindings))
631638

632639
(defn break-on-exception-reader
633640
"#exn reader. Wrap `form` in try-catch and break only on exception"

0 commit comments

Comments
 (0)
Please sign in to comment.