# `IEx.Pry`
[🔗](https://github.com/elixir-lang/elixir/blob/6fd161d67d4e62a3d3cbc99b05483177c3172b24/lib/iex/lib/iex/pry.ex#L5)

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

# `break`

```elixir
@type break() :: {id(), module(), {function(), arity()}, pending :: non_neg_integer()}
```

# `break_error`

```elixir
@type break_error() ::
  :recompilation_failed
  | :no_beam_file
  | :unknown_function_arity
  | :missing_debug_info
  | :outdated_debug_info
  | :non_elixir_module
```

# `id`

```elixir
@type id() :: integer()
```

# `annotate_quoted`
*since 1.17.0* 

```elixir
@spec annotate_quoted(Macro.t(), Macro.t(), Macro.Env.t()) :: Macro.t()
```

Annotate quoted expression with line-by-line `IEx.Pry` debugging steps.

It expects the `quoted` expression to annotate, a boolean `condition` that controls
if pry should run or not (usually is simply the boolean `true`), and the
caller macro environment.

# `break`

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

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

# `break`

```elixir
@spec 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.

# `break!`

```elixir
@spec break!(module(), atom(), arity(), non_neg_integer()) :: id()
```

Raising variant of `break/4`.

# `break!`

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

Raising variant of `break/6`.

# `breaks`

```elixir
@spec breaks() :: [break()]
```

Returns all breakpoints.

# `pry`

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
`binding/0`) and the environment (from `__ENV__/0`).

# `remove_breaks`

```elixir
@spec remove_breaks() :: :ok
```

Removes all breakpoints on all modules.

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

# `remove_breaks`

```elixir
@spec 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.

# `reset_break`

```elixir
@spec reset_break(id()) :: :ok | :not_found
```

Resets the breaks on a given breakpoint ID.

# `reset_break`

```elixir
@spec 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`.

# `whereami`

```elixir
@spec whereami(String.t(), non_neg_integer(), pos_integer()) ::
  {:ok, IO.chardata()} | :error
```

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.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
