Files
godot-docs-l10n/classes/zh_Hans/class_editordebuggersession.rst

210 lines
9.9 KiB
ReStructuredText

:github_url: hide
.. _class_EditorDebuggerSession:
EditorDebuggerSession
=====================
**继承:** :ref:`RefCounted<class_RefCounted>` **<** :ref:`Object<class_Object>`
与编辑器调试器交互的类。
.. rst-class:: classref-introduction-group
描述
----
这个类不能直接实例化,必须通过 :ref:`EditorDebuggerPlugin<class_EditorDebuggerPlugin>` 来获取。
通过 :ref:`add_session_tab()<class_EditorDebuggerSession_method_add_session_tab>` 可以向会话 UI 添加标签,通过 :ref:`send_message()<class_EditorDebuggerSession_method_send_message>` 可以发送消息,通过 :ref:`toggle_profiler()<class_EditorDebuggerSession_method_toggle_profiler>` 可以切换 :ref:`EngineProfiler<class_EngineProfiler>`\ 。
.. rst-class:: classref-reftable-group
方法
----
.. table::
:widths: auto
+-------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| |void| | :ref:`add_session_tab<class_EditorDebuggerSession_method_add_session_tab>`\ (\ control\: :ref:`Control<class_Control>`\ ) |
+-------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`is_active<class_EditorDebuggerSession_method_is_active>`\ (\ ) |
+-------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`is_breaked<class_EditorDebuggerSession_method_is_breaked>`\ (\ ) |
+-------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`is_debuggable<class_EditorDebuggerSession_method_is_debuggable>`\ (\ ) |
+-------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| |void| | :ref:`remove_session_tab<class_EditorDebuggerSession_method_remove_session_tab>`\ (\ control\: :ref:`Control<class_Control>`\ ) |
+-------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| |void| | :ref:`send_message<class_EditorDebuggerSession_method_send_message>`\ (\ message\: :ref:`String<class_String>`, data\: :ref:`Array<class_Array>` = []\ ) |
+-------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| |void| | :ref:`set_breakpoint<class_EditorDebuggerSession_method_set_breakpoint>`\ (\ path\: :ref:`String<class_String>`, line\: :ref:`int<class_int>`, enabled\: :ref:`bool<class_bool>`\ ) |
+-------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| |void| | :ref:`toggle_profiler<class_EditorDebuggerSession_method_toggle_profiler>`\ (\ profiler\: :ref:`String<class_String>`, enable\: :ref:`bool<class_bool>`, data\: :ref:`Array<class_Array>` = []\ ) |
+-------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
信号
----
.. _class_EditorDebuggerSession_signal_breaked:
.. rst-class:: classref-signal
**breaked**\ (\ can_debug\: :ref:`bool<class_bool>`\ ) :ref:`🔗<class_EditorDebuggerSession_signal_breaked>`
当连接的远程实例进入中断状态时发出。如果 ``can_debug````true``\ ,则远程实例将进入调试循环。
.. rst-class:: classref-item-separator
----
.. _class_EditorDebuggerSession_signal_continued:
.. rst-class:: classref-signal
**continued**\ (\ ) :ref:`🔗<class_EditorDebuggerSession_signal_continued>`
当连接的远程实例退出中断状态时触发。
.. rst-class:: classref-item-separator
----
.. _class_EditorDebuggerSession_signal_started:
.. rst-class:: classref-signal
**started**\ (\ ) :ref:`🔗<class_EditorDebuggerSession_signal_started>`
当一个远程实例连接到该会话时触发(即该会话成为活动状态)。
.. rst-class:: classref-item-separator
----
.. _class_EditorDebuggerSession_signal_stopped:
.. rst-class:: classref-signal
**stopped**\ (\ ) :ref:`🔗<class_EditorDebuggerSession_signal_stopped>`
当一个远程实例从该会话中分离出来时(即该会话变为非活动状态)发出。
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
方法说明
--------
.. _class_EditorDebuggerSession_method_add_session_tab:
.. rst-class:: classref-method
|void| **add_session_tab**\ (\ control\: :ref:`Control<class_Control>`\ ) :ref:`🔗<class_EditorDebuggerSession_method_add_session_tab>`
将控件 ``control`` 添加到调试器底部面板的调试会话 UI 中。\ ``control`` 的节点名称会作为选项卡标题。
.. rst-class:: classref-item-separator
----
.. _class_EditorDebuggerSession_method_is_active:
.. rst-class:: classref-method
:ref:`bool<class_bool>` **is_active**\ (\ ) :ref:`🔗<class_EditorDebuggerSession_method_is_active>`
如果调试会话附加到了某个远程实例,则返回 ``true``\ 。
.. rst-class:: classref-item-separator
----
.. _class_EditorDebuggerSession_method_is_breaked:
.. rst-class:: classref-method
:ref:`bool<class_bool>` **is_breaked**\ (\ ) :ref:`🔗<class_EditorDebuggerSession_method_is_breaked>`
如果附加的远程实例正处于调试循环中,则返回 ``true``\ 。
.. rst-class:: classref-item-separator
----
.. _class_EditorDebuggerSession_method_is_debuggable:
.. rst-class:: classref-method
:ref:`bool<class_bool>` **is_debuggable**\ (\ ) :ref:`🔗<class_EditorDebuggerSession_method_is_debuggable>`
如果附加的远程实例可以调试,则返回 ``true``\ 。
.. rst-class:: classref-item-separator
----
.. _class_EditorDebuggerSession_method_remove_session_tab:
.. rst-class:: classref-method
|void| **remove_session_tab**\ (\ control\: :ref:`Control<class_Control>`\ ) :ref:`🔗<class_EditorDebuggerSession_method_remove_session_tab>`
将给定的控件 ``control`` 从底部调试器面板的调试会话 UI 中移除。
.. rst-class:: classref-item-separator
----
.. _class_EditorDebuggerSession_method_send_message:
.. rst-class:: classref-method
|void| **send_message**\ (\ message\: :ref:`String<class_String>`, data\: :ref:`Array<class_Array>` = []\ ) :ref:`🔗<class_EditorDebuggerSession_method_send_message>`
向原生实例发送给定的消息 ``message``\ ,还可以传入额外的数据 ``data``\ 。如何获取这些消息见 :ref:`EngineDebugger<class_EngineDebugger>`\ 。
.. rst-class:: classref-item-separator
----
.. _class_EditorDebuggerSession_method_set_breakpoint:
.. rst-class:: classref-method
|void| **set_breakpoint**\ (\ path\: :ref:`String<class_String>`, line\: :ref:`int<class_int>`, enabled\: :ref:`bool<class_bool>`\ ) :ref:`🔗<class_EditorDebuggerSession_method_set_breakpoint>`
根据 ``enabled`` 启用或禁用指定的断点,会据此更新“编辑器断点面板”。
.. rst-class:: classref-item-separator
----
.. _class_EditorDebuggerSession_method_toggle_profiler:
.. rst-class:: classref-method
|void| **toggle_profiler**\ (\ profiler\: :ref:`String<class_String>`, enable\: :ref:`bool<class_bool>`, data\: :ref:`Array<class_Array>` = []\ ) :ref:`🔗<class_EditorDebuggerSession_method_toggle_profiler>`
在所附加的远程实例上开关给定的 ``profiler``\ ,还可以传入额外的数据 ``data``\ 。详见 :ref:`EngineProfiler<class_EngineProfiler>`\ 。
.. |virtual| replace:: :abbr:`virtual (本方法通常需要用户覆盖才能生效。)`
.. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
.. |const| replace:: :abbr:`const (本方法无副作用,不会修改该实例的任何成员变量。)`
.. |vararg| replace:: :abbr:`vararg (本方法除了能接受在此处描述的参数外,还能够继续接受任意数量的参数。)`
.. |constructor| replace:: :abbr:`constructor (本方法用于构造某个类型。)`
.. |static| replace:: :abbr:`static (调用本方法无需实例,可直接使用类名进行调用。)`
.. |operator| replace:: :abbr:`operator (本方法描述的是使用本类型作为左操作数的有效运算符。)`
.. |bitfield| replace:: :abbr:`BitField (这个值是由下列位标志构成位掩码的整数。)`
.. |void| replace:: :abbr:`void (无返回值。)`