IEx v1.7.4 IEx.Pry View Source

The low-level API for prying sessions and setting up breakpoints.

Link to this section Summary

Functions

Sets up a breakpoint on the given module/function/arity matching the given args and guard

Returns all breakpoints

Returns a specification to start this module under a supervisor

Callback for IEx.pry/1

Removes all breakpoints on all modules

Removes breakpoints in the given module

Resets the breaks on a given breakpoint id

Resets the breaks for the given module, function and arity

Formats the location for whereami/3 prying

Link to this section Types

Link to this section Functions

Link to this function break!(module, function, arity, condition, breaks \\ 1) View Source

Raising variant of break/5.

Link to this function break(module, function, arity, condition, breaks \\ 1) View Source
break(module(), function(), arity(), Macro.t(), pos_integer()) ::
  {:ok, id()}
  | {:error,
     :recompilation_failed
     | :no_beam_file
     | :unknown_function_arity
     | :otp_20_is_required
     | :missing_debug_info
     | :outdated_debug_info
     | :non_elixir_module}
break(module(), function(), arity(), Macro.t(), pos_integer()) :: id()

Sets up a breakpoint on the given module/function/arity matching the given args and guard.

Returns all breakpoints.

Returns a specification to start this module under a supervisor.

See Supervisor.

Callback for IEx.pry/1.

You can invoke this function directly when you are not able to invoke IEx.pry/1 as a macro. This function expects the binding (from Kernel.binding/0) and the environment (from __ENV__/0).

Link to this function remove_breaks() View Source
remove_breaks() :: :ok

Removes all breakpoints on all modules.

This effectively loads the non-instrumented version of currently instrumented modules into memory.

Link to this function remove_breaks(module) View Source
remove_breaks(module()) :: :ok | {:error, :no_beam_file}

Removes breakpoints in the given module.

This effectively loads the non-instrumented version of the module into memory.

Link to this function reset_break(id) View Source
reset_break(id()) :: :ok | :not_found

Resets the breaks on a given breakpoint id.

Link to this function reset_break(module, function, arity) View Source
reset_break(module(), function(), arity()) :: :ok | :not_found

Resets the breaks for the given module, function and arity.

If the module is not instrumented or if the given function does not have a breakpoint, it is a no-op and it returns :not_found. Otherwise it returns :ok.

Link to this function whereami(file, line, radius) View Source

Formats the location for whereami/3 prying.

It receives the file, line and the snippet radius and returns {:ok, lines}, where lines is a list of chardata containing each formatted line, or :error.

The actual line is especially formatted in bold.