檢視原始碼 i (除錯器 v5.5)
除錯器/直譯器介面。
i
模組為圖形除錯器使用的一些函式,以及模組 int
(Erlang 直譯器)中的一些函式,提供簡短的形式。
此模組也提供顯示有關直譯處理程序和中斷點狀態資訊的功能。
只需提供對應的處理程序識別碼,即可附加到直譯處理程序。預設情況下,會顯示附加視窗。其他 Erlang 節點上的處理程序可以手動或自動附加。
此模組中的函式定義於 Erlang shell 中。也就是說,它們可以在沒有 i:
前綴的情況下呼叫。例如
1> ii(t).
{module,t}
2> iaa([init]).
true
摘要
函式
印出使用此模組中函式的說明。
附加到被除錯的處理程序 Pid
。
附加到被除錯的處理程序 Pid
。
等同於 ia(Pid)
,其中 Pid
是呼叫 shell 函式 pid(X, Y, Z)
的結果。
等同於 ia(Pid, Function)
,其中 Pid
是呼叫 shell 函式 pid(X, Y, Z)
的結果。
設定何時自動附加到被除錯的處理程序。
設定何時以及如何自動附加到被除錯的處理程序。
在 Module
中的 Line
處建立中斷點。
在函式 Module:Name/Arity
的每個子句的第一行建立中斷點。
將 Module
中 Line
處的中斷點的觸發動作設定為 Action
。
將 Module
中 Line
處的中斷點的條件測試設定為 Function
。
使 Module
中 Line
處的中斷點失效。
使 Module
中 Line
處的中斷點生效。
清除有關執行直譯碼的處理程序的資訊,方法是移除所有已終止處理程序的資訊。
在本機節點上直譯指定的模組。
列印所有已直譯的模組。
啟動新的圖形監視器視窗。
在所有已知節點上直譯指定的模組。
停止在所有已知節點上直譯指定的模組。
印出所有已直譯處理程序的目前狀態。
印出所有現有的中斷點。
印出 Module
中所有現有的中斷點。
停止在本機節點上直譯指定的模組。
刪除所有已直譯模組中的所有中斷點。
刪除 Module
中的所有中斷點。
刪除 Module
中 Line
處的中斷點。
刪除函式 Module:Name/Arity
的每個子句的第一行的中斷點。
設定如何在堆疊中儲存呼叫框架。
傳回直譯器(除錯器)的目前版本。
函式
-spec help() -> ok.
印出使用此模組中函式的說明。
-spec ia(Pid) -> ok | no_proc when Pid :: pid().
附加到被除錯的處理程序 Pid
。
此處理程序會開啟「附加處理程序」視窗。
-spec ia(Pid, Function) -> ok | no_proc when Pid :: pid(), Function :: {Module, Name}, Module :: module(), Name :: atom().
附加到被除錯的處理程序 Pid
。
直譯器會呼叫 spawn(Module, Name, [Pid])
(並忽略結果)。
等同於 ia(Pid)
,其中 Pid
是呼叫 shell 函式 pid(X, Y, Z)
的結果。
-spec ia(X, Y, Z, Function) -> ok | no_proc when X :: integer(), Y :: integer(), Z :: integer(), Function :: {Module, Name}, Module :: module(), Name :: atom().
等同於 ia(Pid, Function)
,其中 Pid
是呼叫 shell 函式 pid(X, Y, Z)
的結果。
附加的處理程序預期會呼叫非官方函式 int:attached(Pid)
,並且能夠處理來自直譯器的訊息。如需範例,請參閱 dbg_wx_trace.erl
。
-spec iaa(Flags) -> true when Flags :: [init | break | exit].
設定何時自動附加到被除錯的處理程序。
除錯器提供一個函式,可為此處理程序開啟「附加處理程序」視窗。
如需更多資訊,請參閱 int:auto_attach/2。
-spec iaa(Flags, Function) -> true when Flags :: [init | break | exit], Function :: {Module, Name, Args}, Module :: module(), Name :: atom(), Args :: [term()].
設定何時以及如何自動附加到被除錯的處理程序。
如需更多資訊,請參閱 int:auto_attach/2。
在 Module
中的 Line
處建立中斷點。
-spec ib(Module, Name, Arity) -> ok | {error, function_not_found} when Module :: module(), Name :: atom(), Arity :: integer().
在函式 Module:Name/Arity
的每個子句的第一行建立中斷點。
-spec iba(Module, Line, Action) -> ok when Module :: module(), Line :: integer(), Action :: enable | disable | delete.
將 Module
中 Line
處的中斷點的觸發動作設定為 Action
。
-spec ibc(Module, Line, Function) -> ok when Module :: module(), Line :: integer(), Function :: {Module, Name}, Name :: atom().
將 Module
中 Line
處的中斷點的條件測試設定為 Function
。
條件測試是透過呼叫 Module:Name(Bindings)
來執行,其中 Bindings
是目前的變數繫結。此函式必須傳回 true
(中斷) 或 false
(不要中斷)。若要擷取變數 Var
的值,請使用 int:get_binding(Var, Bindings)。
使 Module
中 Line
處的中斷點失效。
使 Module
中 Line
處的中斷點生效。
-spec ic() -> ok.
清除有關執行直譯碼的處理程序的資訊,方法是移除所有已終止處理程序的資訊。
-spec ii(AbsModules | AbsModule) -> Result when AbsModules :: [AbsModule, ...], AbsModule :: Module | File, Module :: module(), File :: file:name_all(), Result :: AbsModuleResult | AbsModulesResult, AbsModuleResult :: {module, Module} | error, AbsModulesResult :: ok.
在本機節點上直譯指定的模組。
如果
AbsModule :: Module | File
,則Result :: {module, Module} | error
。- 如果
AbsModules :: [AbsModule]
,則Result :: ok
。
如需更多資訊,請參閱 int:i/1
。
-spec il() -> ok.
列印所有已直譯的模組。
模組會連同對應原始碼檔案的完整路徑名稱一起列印。
-spec im() -> pid().
啟動新的圖形監視器視窗。
這是監視器視窗,也是除錯器的主要視窗。所有除錯器和直譯器的功能都可從監視器視窗存取。此視窗會顯示已執行或正在執行直譯模組的所有處理程序的狀態。
-spec ini(AbsModules | AbsModule) -> Result when AbsModules :: [AbsModule], AbsModule :: Module | File, Module :: module(), File :: file:name_all(), Result :: AbsModuleResult | AbsModulesResult, AbsModuleResult :: {module, Module} | error, AbsModulesResult :: ok.
在所有已知節點上直譯指定的模組。
如果
AbsModule :: Module | File
,則Result :: {module, Module} | error
。- 如果
AbsModules :: [AbsModule]
,則Result :: ok
。
如需更多資訊,請參閱 int:ni/1
。
-spec inq(AbsModule) -> ok when AbsModule :: Module | File, Module :: module(), File :: file:name_all().
停止在所有已知節點上直譯指定的模組。
-spec ip() -> ok.
印出所有已直譯處理程序的目前狀態。
-spec ipb() -> ok.
印出所有現有的中斷點。
-spec ipb(Module) -> ok when Module :: module().
印出 Module
中所有現有的中斷點。
-spec iq(AbsModule) -> ok when AbsModule :: Module | File, Module :: module(), File :: file:name_all().
停止在本機節點上直譯指定的模組。
-spec ir() -> ok.
刪除所有已直譯模組中的所有中斷點。
-spec ir(Module) -> ok when Module :: module().
刪除 Module
中的所有中斷點。
刪除 Module
中 Line
處的中斷點。
-spec ir(Module, Name, Arity) -> ok | {error, function_not_found} when Module :: module(), Name :: atom(), Arity :: integer().
刪除函式 Module:Name/Arity
的每個子句的第一行的中斷點。
-spec ist(Flag) -> true when Flag :: all | no_tail | false.
設定如何在堆疊中儲存呼叫框架。
如需更多資訊,請參閱 int:stack_trace/1。
-spec iv() -> atom().
傳回直譯器(除錯器)的目前版本。