Liking cljdoc? Tell your friends :D

cider.nrepl.middleware.debug

Expression-based debugger for clojure code

Expression-based debugger for clojure code
raw docstring

*debug-data-readers*clj

Reader macros like #dbg which cause code to be instrumented when present.

Reader macros like #dbg which cause code to be instrumented when present.
sourceraw docstring

*do-locals*clj

source

*skip-breaks*clj

Map used to determine whether to skip a breakpoint. Don't set or examine this directly, it is bound in the session binding map, use skip-breaks! and skip-breaks? instead. Its value is reset at the beginning each eval session.

Map used to determine whether to skip a breakpoint.
Don't set or examine this directly, it is bound in the session binding map,
use `skip-breaks!` and `skip-breaks?` instead. Its value is reset at the
beginning each eval session.
sourceraw docstring

*tmp-forms*clj

source

*tmp-locals*clj

source

apply-instrumented-maybeclj

(apply-instrumented-maybe var-fn args coor STATE__)

Apply var-fn or its instrumented version to args.

Apply var-fn or its instrumented version to args.
sourceraw docstring

breakclj

(break coor val locals STATE__)

Breakpoint function. Send the result of form and its coordinates to the client and wait for response with read-debug-command'.

Breakpoint function.
Send the result of form and its coordinates to the client and wait for
response with `read-debug-command`'.
sourceraw docstring

break-on-exception-readerclj

(break-on-exception-reader form)

#exn reader. Wrap form in try-catch and break only on exception

#exn reader. Wrap `form` in try-catch and break only on exception
sourceraw docstring

breakpointcljmacro

(breakpoint form {:keys [coor] :as dbg-state} original-form)

Wrap form in a breakpoint unconditionally.

Wrap form in a breakpoint unconditionally.
sourceraw docstring

breakpoint-if-exceptioncljmacro

(breakpoint-if-exception form dbg-state original-form)

Wrap form in a try-catch that has breakpoint on exception. Used as :breakfunction in tag-form.

Wrap form in a try-catch that has breakpoint on exception.
Used as :breakfunction in `tag-form`.
sourceraw docstring

breakpoint-if-exception-with-initial-debug-bindingscljmacro

(breakpoint-if-exception-with-initial-debug-bindings form
                                                     dbg-state
                                                     original-form)
source

breakpoint-if-interestingcljmacro

(breakpoint-if-interesting form dbg-state original-form)

Wrap form in a breakpoint if it looks interesting. Uninteresting forms are symbols that resolve to clojure.core (taking locals into account), and sexps whose head is present in irrelevant-return-value-forms. Used as :breakfunction in tag-form.

Wrap form in a breakpoint if it looks interesting.
Uninteresting forms are symbols that resolve to `clojure.core`
(taking locals into account), and sexps whose head is present in
`irrelevant-return-value-forms`. Used as :breakfunction in `tag-form`.
sourceraw docstring

breakpoint-if-interesting-with-initial-debug-bindingscljmacro

(breakpoint-if-interesting-with-initial-debug-bindings form
                                                       dbg-state
                                                       original-form)
source

breakpoint-readerclj

(breakpoint-reader form)

#break reader. Mark form for breakpointing.

#break reader. Mark `form` for breakpointing.
sourceraw docstring

breakpoint-with-initial-debug-bindingscljmacro

(breakpoint-with-initial-debug-bindings form dbg-state original-form)
source

debug-commandsclj

An unsorted set of commands supported by the debugger.

An unsorted set of commands supported by the debugger.
sourceraw docstring

debug-on-exception-readerclj

(debug-on-exception-reader form)

#dbgexn reader. Mark all forms in form for breakpointing on exception. form itself is also marked.

#dbgexn reader. Mark all forms in `form` for breakpointing on exception.
`form` itself is also marked.
sourceraw docstring

debug-readerclj

(debug-reader form)

#dbg reader. Mark all forms in form for breakpointing. form itself is also marked.

#dbg reader. Mark all forms in `form` for breakpointing.
`form` itself is also marked.
sourceraw docstring

debugger-messageclj

Message used to communicate with the client. Stored by the "init-debugger" op, and used by read-debug-input to ask for debug input through the :need-debug-input status.

Message used to communicate with the client. Stored by the
"init-debugger" op, and used by `read-debug-input` to ask for debug input through
the :need-debug-input status.
sourceraw docstring

debugger-sendclj

(debugger-send & r)

Send a response through debugger-message.

Send a response through debugger-message.
sourceraw docstring

expand-breakcljmacro

(expand-break form {:keys [coor]} original-form)

Internal macro to avoid code repetition in breakpoint-if-interesting.

Internal macro to avoid code repetition in `breakpoint-if-interesting`.
sourceraw docstring

handle-debugclj

(handle-debug handler {:keys [op input session] :as msg})
source

instrument-and-evalclj

(instrument-and-eval form)
source

instrument-var-for-step-inclj

(instrument-var-for-step-in v)

Attach an instrumented version of the function in v as metadata to v, leaving the contents of the var uninstrumented.

Attach an instrumented version of the function in `v` as metadata to `v`,
leaving the contents of the var uninstrumented.
sourceraw docstring

irrelevant-return-value-formsclj

Set of special-forms whose return value we don't care about. When instrumenting, these will not be wrapped in a breakpoint.

Set of special-forms whose return value we don't care about.
When instrumenting, these will not be wrapped in a breakpoint.
sourceraw docstring

looks-step-innable?clj

(looks-step-innable? form)
(looks-step-innable? &env form)

Decide whether a form looks like a call to a function that we could instrument and step into. You should prefer the second arity with the &env argument to handle a local shadowing correctly.

Decide whether a form looks like a call to a function that we could
instrument and step into.
You should prefer the second arity with the `&env` argument
to handle a local shadowing correctly.
sourceraw docstring

pr-shortclj

(pr-short x)

Like pr-str but limited in length and depth.

Like `pr-str` but limited in length and depth.
sourceraw docstring

source

(print-step-indented depth form value)
source

promisesclj

Map atom holding all unprocessed debug inputs. This is where the "debug" op stores replies received for debug input requests. read-debug-input will halt until it finds its input in this map (identified by a key), and will dissoc it afterwards.

Map atom holding all unprocessed debug inputs.
This is where the "debug" op stores replies received for debug
input requests. `read-debug-input` will halt until it finds its input in
this map (identified by a key), and will `dissoc` it afterwards.
sourceraw docstring

read-debug-commandclj

(read-debug-command coor value locals STATE__)

Read and take action on a debugging command. Ask for one of the following debug commands using read-debug-input:

next: Return value. continue: Skip the current breakpoint. continue-all: Skip breakpoints for the remainder of this eval session. in: Step into a function out: Skip breakpoints in the current sexp. here: Skip all breakpoints up till specified coordinate coord inspect: Inspect the current expression inspect-prompt: Prompt for an expression to evaluate and inspect it. locals: Inspect local variables. inject: Evaluate an expression and return it. eval: Evaluate an expression, display result, and prompt again. stacktrace: Print the current stacktrace, and prompt again. trace: Continue, printing intermediate expressions and their values. quit: Abort current eval session.

Response received can be any one of these values. It can also be a map whose :response entry is one of these values, which can thus be used to provide additional parameters. For instance, if this map has a :code entry, its value is used for operations such as :eval, which would otherwise interactively prompt for an expression.

Read and take action on a debugging command.
Ask for one of the following debug commands using `read-debug-input`:

  next: Return value.
  continue: Skip the current breakpoint.
  continue-all: Skip breakpoints for the remainder of this eval session.
  in: Step into a function
  out: Skip breakpoints in the current sexp.
  here: Skip all breakpoints up till specified coordinate `coord`
  inspect: Inspect the current expression
  inspect-prompt: Prompt for an expression to evaluate and inspect it.
  locals: Inspect local variables.
  inject: Evaluate an expression and return it.
  eval: Evaluate an expression, display result, and prompt again.
  stacktrace: Print the current stacktrace, and prompt again.
  trace: Continue, printing intermediate expressions and their values.
  quit: Abort current eval session.

Response received can be any one of these values. It can also be a map
whose :response entry is one of these values, which can thus be used to
provide additional parameters. For instance, if this map has a :code entry,
its value is used for operations such as :eval, which would otherwise
interactively prompt for an expression.
sourceraw docstring

safe-to-debug?clj

(safe-to-debug? ns)

Some namespaces are not safe to debug, because doing so can cause a stack overflow that crashes the nrepl process.

Some namespaces are not safe to debug, because doing so can cause a stack
overflow that crashes the nrepl process.
sourceraw docstring

sanitize-envclj

(sanitize-env env)

Turn a macro's &env into a map usable for binding.

Turn a macro's &env into a map usable for binding.
sourceraw docstring

skip-breaks!clj

(skip-breaks! mode)
(skip-breaks! mode coor code force?)

Set the value of skip-breaks for the top-level breakpoint. Additional arguments depend on mode, and should be:

  • empty for :all or :trace
  • coordinates, code, and force for :deeper or :before See skip-breaks?.
Set the value of *skip-breaks* for the top-level breakpoint.
Additional arguments depend on mode, and should be:
 - empty for :all or :trace
 - coordinates, code, and force for :deeper or :before
See `skip-breaks?`.
sourceraw docstring

skip-breaks?clj

(skip-breaks? coor STATE__)

True if the breakpoint at coordinates should be skipped.

The *skip-breaks* map stores a mode, coordinates, the code that it applies to, and a force? flag.

Behaviour depends on the mode:

  • :all - return true, skipping all breaks
  • :trace - return false, skip nothing
  • :deeper - return true if the given coordinates are deeper than the coordinates stored in *skip-breaks*, in the same code
  • :before - return true if the given coordinates represent a place before the coordinates in *skip-breaks*, in the same code

For :deeper and :before, if we are not in the same code (i.e. we have stepped into another instrumented function and code argument doesn't match old code in skip-breaks), then return the value of force?.

True if the breakpoint at coordinates should be skipped.

The `*skip-breaks*` map stores a `mode`, `coordinates`, the `code` that it
applies to, and a `force?` flag.

Behaviour depends on the `mode`:
 - :all - return true, skipping all breaks
 - :trace - return false, skip nothing
 - :deeper - return true if the given coordinates are deeper than the
             coordinates stored in `*skip-breaks*`, in the same code
 - :before - return true if the given coordinates represent a place before
             the coordinates in `*skip-breaks*`, in the same code

For :deeper and :before, if we are not in the same code (i.e. we have stepped
into another instrumented function and code argument doesn't match old code in
*skip-breaks*), then return the value of `force?`.
sourceraw docstring

step-in-to-next?clj

source

step-in?clj

(step-in? v coor code)

Return true if we can and should step in to the function in the var v. The "should" part is determined by the value in step-in-to-next?, which gets set to true by the user sending the "step in" command.

Return true if we can and should step in to the function in the var `v`.
The "should" part is determined by the value in `step-in-to-next?`, which
gets set to true by the user sending the "step in" command.
sourceraw docstring

try-if-letcljmacro

(try-if-let [sym val] success-expr error-expr)

Try binding sym to val end eval success-expr or error-expr on error. On error send an eval-error message through debugger-message channel.

Try binding `sym` to `val` end eval `success-expr` or `error-expr` on error.
On error send an eval-error message through `debugger-message` channel.
sourceraw docstring

with-initial-debug-bindingscljmacro

(with-initial-debug-bindings & body)

Let-wrap body with STATE__ map containing code, file, line, column etc. STATE__ is an anaphoric variable available to all breakpoint macros. Ends with __ to avid conflicts with user locals and to signify that it's an internal variable which is cleaned in `sanitize-env' along other clojure's temporaries.

Let-wrap `body` with STATE__ map containing code, file, line, column etc.
STATE__ is an anaphoric variable available to all breakpoint macros. Ends with
__ to avid conflicts with user locals and to signify that it's an internal
variable which is cleaned in `sanitize-env' along other clojure's
temporaries.
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close