檢視原始碼 IEx.Pry (IEx v1.16.2)

用於 Prying 會話和設置斷點的低階 API。

摘要

函式

在指定的模組/函式/arity 上設置斷點。

在指定的模組/函式/args 上使用指定的 guard 設置斷點。

返回所有斷點。

IEx.pry/0 的回呼函式。

移除所有模組上的斷點。

移除指定模組中的斷點。

重置指定斷點 ID 上的斷點。

重置指定 module, functionarity 的斷點。

對於 whereami/3 的 prying,格式化位置。

類型

@type break() :: {id(), module(), {function(), arity()}, pending :: non_neg_integer()}
@type break_error() ::
  :recompilation_failed
  | :no_beam_file
  | :unknown_function_arity
  | :missing_debug_info
  | :outdated_debug_info
  | :non_elixir_module
@type id() :: integer()

函式

連結至此函式

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

檢視原始碼
@spec break(module(), atom(), arity(), non_neg_integer()) ::
  {:ok, id()} | {:error, break_error()}

在指定的模組/函式/arity 上設置斷點。

連結至此函式

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

檢視原始碼
@spec break(
  module(),
  atom(),
  [Macro.t()],
  Macro.t(),
  Macro.Env.t(),
  non_neg_integer()
) ::
  {:ok, id()} | {:error, break_error()}

在指定的模組/函式/args 上使用指定的 guard 設置斷點。

需要提供 env 來擴展 guards。

連結至此函式

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

檢視原始碼
@spec break!(module(), atom(), arity(), non_neg_integer()) :: id()

break/4 的引發變體。

連結至此函式

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

檢視原始碼
@spec break!(
  module(),
  atom(),
  [Macro.t()],
  Macro.t(),
  Macro.Env.t(),
  non_neg_integer()
) :: id()

break/6 的引發變體。

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

返回所有斷點。

IEx.pry/0 的回呼函式。

當您無法將IEx.pry/0作為巨集調用時,可以直接調用此函數。此函數需要綁定(從binding/0取得)和環境(從__ENV__/0取得)。

@spec remove_breaks() :: :ok

移除所有模組上的斷點。

這會將目前已儀器化模組的非儀器化版本有效載入記憶體。

@spec remove_breaks(module()) :: :ok | {:error, :no_beam_file}

移除指定模組中的斷點。

這會將模組的非儀器化版本有效載入記憶體。

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

重置指定斷點 ID 上的斷點。

連結至此函式

reset_break(module, function, arity)

檢視原始碼
@spec reset_break(module(), atom(), arity()) :: :ok | :not_found

重置指定 module, functionarity 的斷點。

如果module未儀器化,或給定的function沒有斷點,則此操作不會產生任何效果,並返回:not_found。否則返回:ok

連結至此函式

whereami(file, line, radius)

檢視原始碼

對於 whereami/3 的 prying,格式化位置。

它接收filelineradius片段,並返回{:ok, lines},其中lines是包含每個格式化行的chardata列表,或:error

實際行以粗體格式特別標註。