# IEx v1.10.3 IEx.Pry View Source

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

# Link to this section Summary

## Types

break()
break_error()
id()

## Functions

break(module, function, arity, breaks \\ 1)

Sets up a breakpoint on the given module/function/arity.

break(module, function, args, guard, env, breaks \\ 1)

Sets up a breakpoint on the given module/function/args with the given `guard`.

break!(module, function, arity, breaks \\ 1)

Raising variant of `break/4`.

break!(module, function, args, guard, env, breaks \\ 1)

Raising variant of `break/6`.

breaks()

Returns all breakpoints.

pry(binding, env)

Callback for `IEx.pry/0`.

remove_breaks()

Removes all breakpoints on all modules.

remove_breaks(module)

Removes breakpoints in the given module.

reset_break(id)

Resets the breaks on a given breakpoint ID.

reset_break(module, function, arity)

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

whereami(file, line, radius)

Formats the location for `whereami/3` prying.

# Link to this section Types

Link to this type

# break()

View Source

## Specs

    break() :: {id(), module(), {function(), arity()}, pending :: non_neg_integer()}

Link to this type

# break_error()

View Source

## Specs

    break_error() ::
      :recompilation_failed
      | :no_beam_file
      | :unknown_function_arity
      | :missing_debug_info
      | :outdated_debug_info
      | :non_elixir_module

Link to this type

# id()

View Source

## Specs

    id() :: integer()

# Link to this section Functions

Link to this function

# break(module, function, arity, breaks \\ 1)

View Source

## Specs

    break(module(), atom(), arity(), non_neg_integer()) ::
      {:ok, id()} | {:error, break_error()}

Sets up a breakpoint on the given module/function/arity.

Link to this function

# break(module, function, args, guard, env, breaks \\ 1)

View Source

## Specs

    break(
      module(),
      atom(),
      [Macro.t()],
      Macro.t(),
      Macro.Env.t(),
      non_neg_integer()
    ) :: {:ok, id()} | {:error, break_error()}

Sets up a breakpoint on the given module/function/args with the given `guard`.

It requires an `env` to be given to make the expansion of the guards.

Link to this function

# break!(module, function, arity, breaks \\ 1)

View Source

## Specs

    break!(module(), atom(), arity(), non_neg_integer()) :: id()

Raising variant of `break/4`.

Link to this function

# break!(module, function, args, guard, env, breaks \\ 1)

View Source

## Specs

    break!(
      module(),
      atom(),
      [Macro.t()],
      Macro.t(),
      Macro.Env.t(),
      non_neg_integer()
    ) :: id()

Raising variant of `break/6`.

Link to this function

# breaks()

View Source

## Specs

    breaks() :: [break()]

Returns all breakpoints.

Link to this function

# pry(binding, env)

View Source

Callback for `IEx.pry/0`.

You can invoke this function directly when you are not able to invoke `IEx.pry/0` 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

## Specs

    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

## Specs

    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

## Specs

    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

## Specs

    reset_break(module(), atom(), 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.