class_enginedebugger.rst 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381
  1. :github_url: hide
  2. .. DO NOT EDIT THIS FILE!!!
  3. .. Generated automatically from Godot engine sources.
  4. .. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/EngineDebugger.xml.
  6. .. _class_EngineDebugger:
  7. EngineDebugger
  8. ==============
  9. **Inherits:** :ref:`Object<class_Object>`
  10. Exposes the internal debugger.
  11. .. rst-class:: classref-introduction-group
  12. Description
  13. -----------
  14. **EngineDebugger** handles the communication between the editor and the running game. It is active in the running game. Messages can be sent/received through it. It also manages the profilers.
  15. .. rst-class:: classref-reftable-group
  16. Methods
  17. -------
  18. .. table::
  19. :widths: auto
  20. +-------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  21. | |void| | :ref:`clear_breakpoints<class_EngineDebugger_method_clear_breakpoints>`\ (\ ) |
  22. +-------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  23. | |void| | :ref:`debug<class_EngineDebugger_method_debug>`\ (\ can_continue\: :ref:`bool<class_bool>` = true, is_error_breakpoint\: :ref:`bool<class_bool>` = false\ ) |
  24. +-------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  25. | :ref:`int<class_int>` | :ref:`get_depth<class_EngineDebugger_method_get_depth>`\ (\ ) |const| |
  26. +-------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  27. | :ref:`int<class_int>` | :ref:`get_lines_left<class_EngineDebugger_method_get_lines_left>`\ (\ ) |const| |
  28. +-------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  29. | :ref:`bool<class_bool>` | :ref:`has_capture<class_EngineDebugger_method_has_capture>`\ (\ name\: :ref:`StringName<class_StringName>`\ ) |
  30. +-------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  31. | :ref:`bool<class_bool>` | :ref:`has_profiler<class_EngineDebugger_method_has_profiler>`\ (\ name\: :ref:`StringName<class_StringName>`\ ) |
  32. +-------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  33. | |void| | :ref:`insert_breakpoint<class_EngineDebugger_method_insert_breakpoint>`\ (\ line\: :ref:`int<class_int>`, source\: :ref:`StringName<class_StringName>`\ ) |
  34. +-------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  35. | :ref:`bool<class_bool>` | :ref:`is_active<class_EngineDebugger_method_is_active>`\ (\ ) |
  36. +-------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  37. | :ref:`bool<class_bool>` | :ref:`is_breakpoint<class_EngineDebugger_method_is_breakpoint>`\ (\ line\: :ref:`int<class_int>`, source\: :ref:`StringName<class_StringName>`\ ) |const| |
  38. +-------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  39. | :ref:`bool<class_bool>` | :ref:`is_profiling<class_EngineDebugger_method_is_profiling>`\ (\ name\: :ref:`StringName<class_StringName>`\ ) |
  40. +-------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  41. | :ref:`bool<class_bool>` | :ref:`is_skipping_breakpoints<class_EngineDebugger_method_is_skipping_breakpoints>`\ (\ ) |const| |
  42. +-------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  43. | |void| | :ref:`line_poll<class_EngineDebugger_method_line_poll>`\ (\ ) |
  44. +-------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  45. | |void| | :ref:`profiler_add_frame_data<class_EngineDebugger_method_profiler_add_frame_data>`\ (\ name\: :ref:`StringName<class_StringName>`, data\: :ref:`Array<class_Array>`\ ) |
  46. +-------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  47. | |void| | :ref:`profiler_enable<class_EngineDebugger_method_profiler_enable>`\ (\ name\: :ref:`StringName<class_StringName>`, enable\: :ref:`bool<class_bool>`, arguments\: :ref:`Array<class_Array>` = []\ ) |
  48. +-------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  49. | |void| | :ref:`register_message_capture<class_EngineDebugger_method_register_message_capture>`\ (\ name\: :ref:`StringName<class_StringName>`, callable\: :ref:`Callable<class_Callable>`\ ) |
  50. +-------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  51. | |void| | :ref:`register_profiler<class_EngineDebugger_method_register_profiler>`\ (\ name\: :ref:`StringName<class_StringName>`, profiler\: :ref:`EngineProfiler<class_EngineProfiler>`\ ) |
  52. +-------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  53. | |void| | :ref:`remove_breakpoint<class_EngineDebugger_method_remove_breakpoint>`\ (\ line\: :ref:`int<class_int>`, source\: :ref:`StringName<class_StringName>`\ ) |
  54. +-------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  55. | |void| | :ref:`script_debug<class_EngineDebugger_method_script_debug>`\ (\ language\: :ref:`ScriptLanguage<class_ScriptLanguage>`, can_continue\: :ref:`bool<class_bool>` = true, is_error_breakpoint\: :ref:`bool<class_bool>` = false\ ) |
  56. +-------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  57. | |void| | :ref:`send_message<class_EngineDebugger_method_send_message>`\ (\ message\: :ref:`String<class_String>`, data\: :ref:`Array<class_Array>`\ ) |
  58. +-------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  59. | |void| | :ref:`set_depth<class_EngineDebugger_method_set_depth>`\ (\ depth\: :ref:`int<class_int>`\ ) |
  60. +-------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  61. | |void| | :ref:`set_lines_left<class_EngineDebugger_method_set_lines_left>`\ (\ lines\: :ref:`int<class_int>`\ ) |
  62. +-------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  63. | |void| | :ref:`unregister_message_capture<class_EngineDebugger_method_unregister_message_capture>`\ (\ name\: :ref:`StringName<class_StringName>`\ ) |
  64. +-------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  65. | |void| | :ref:`unregister_profiler<class_EngineDebugger_method_unregister_profiler>`\ (\ name\: :ref:`StringName<class_StringName>`\ ) |
  66. +-------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  67. .. rst-class:: classref-section-separator
  68. ----
  69. .. rst-class:: classref-descriptions-group
  70. Method Descriptions
  71. -------------------
  72. .. _class_EngineDebugger_method_clear_breakpoints:
  73. .. rst-class:: classref-method
  74. |void| **clear_breakpoints**\ (\ ) :ref:`🔗<class_EngineDebugger_method_clear_breakpoints>`
  75. Clears all breakpoints.
  76. .. rst-class:: classref-item-separator
  77. ----
  78. .. _class_EngineDebugger_method_debug:
  79. .. rst-class:: classref-method
  80. |void| **debug**\ (\ can_continue\: :ref:`bool<class_bool>` = true, is_error_breakpoint\: :ref:`bool<class_bool>` = false\ ) :ref:`🔗<class_EngineDebugger_method_debug>`
  81. Starts a debug break in script execution, optionally specifying whether the program can continue based on ``can_continue`` and whether the break was due to a breakpoint.
  82. .. rst-class:: classref-item-separator
  83. ----
  84. .. _class_EngineDebugger_method_get_depth:
  85. .. rst-class:: classref-method
  86. :ref:`int<class_int>` **get_depth**\ (\ ) |const| :ref:`🔗<class_EngineDebugger_method_get_depth>`
  87. **Experimental:** This method may be changed or removed in future versions.
  88. Returns the current debug depth.
  89. .. rst-class:: classref-item-separator
  90. ----
  91. .. _class_EngineDebugger_method_get_lines_left:
  92. .. rst-class:: classref-method
  93. :ref:`int<class_int>` **get_lines_left**\ (\ ) |const| :ref:`🔗<class_EngineDebugger_method_get_lines_left>`
  94. **Experimental:** This method may be changed or removed in future versions.
  95. Returns the number of lines that remain.
  96. .. rst-class:: classref-item-separator
  97. ----
  98. .. _class_EngineDebugger_method_has_capture:
  99. .. rst-class:: classref-method
  100. :ref:`bool<class_bool>` **has_capture**\ (\ name\: :ref:`StringName<class_StringName>`\ ) :ref:`🔗<class_EngineDebugger_method_has_capture>`
  101. Returns ``true`` if a capture with the given name is present otherwise ``false``.
  102. .. rst-class:: classref-item-separator
  103. ----
  104. .. _class_EngineDebugger_method_has_profiler:
  105. .. rst-class:: classref-method
  106. :ref:`bool<class_bool>` **has_profiler**\ (\ name\: :ref:`StringName<class_StringName>`\ ) :ref:`🔗<class_EngineDebugger_method_has_profiler>`
  107. Returns ``true`` if a profiler with the given name is present otherwise ``false``.
  108. .. rst-class:: classref-item-separator
  109. ----
  110. .. _class_EngineDebugger_method_insert_breakpoint:
  111. .. rst-class:: classref-method
  112. |void| **insert_breakpoint**\ (\ line\: :ref:`int<class_int>`, source\: :ref:`StringName<class_StringName>`\ ) :ref:`🔗<class_EngineDebugger_method_insert_breakpoint>`
  113. Inserts a new breakpoint with the given ``source`` and ``line``.
  114. .. rst-class:: classref-item-separator
  115. ----
  116. .. _class_EngineDebugger_method_is_active:
  117. .. rst-class:: classref-method
  118. :ref:`bool<class_bool>` **is_active**\ (\ ) :ref:`🔗<class_EngineDebugger_method_is_active>`
  119. Returns ``true`` if the debugger is active otherwise ``false``.
  120. .. rst-class:: classref-item-separator
  121. ----
  122. .. _class_EngineDebugger_method_is_breakpoint:
  123. .. rst-class:: classref-method
  124. :ref:`bool<class_bool>` **is_breakpoint**\ (\ line\: :ref:`int<class_int>`, source\: :ref:`StringName<class_StringName>`\ ) |const| :ref:`🔗<class_EngineDebugger_method_is_breakpoint>`
  125. Returns ``true`` if the given ``source`` and ``line`` represent an existing breakpoint.
  126. .. rst-class:: classref-item-separator
  127. ----
  128. .. _class_EngineDebugger_method_is_profiling:
  129. .. rst-class:: classref-method
  130. :ref:`bool<class_bool>` **is_profiling**\ (\ name\: :ref:`StringName<class_StringName>`\ ) :ref:`🔗<class_EngineDebugger_method_is_profiling>`
  131. Returns ``true`` if a profiler with the given name is present and active otherwise ``false``.
  132. .. rst-class:: classref-item-separator
  133. ----
  134. .. _class_EngineDebugger_method_is_skipping_breakpoints:
  135. .. rst-class:: classref-method
  136. :ref:`bool<class_bool>` **is_skipping_breakpoints**\ (\ ) |const| :ref:`🔗<class_EngineDebugger_method_is_skipping_breakpoints>`
  137. Returns ``true`` if the debugger is skipping breakpoints otherwise ``false``.
  138. .. rst-class:: classref-item-separator
  139. ----
  140. .. _class_EngineDebugger_method_line_poll:
  141. .. rst-class:: classref-method
  142. |void| **line_poll**\ (\ ) :ref:`🔗<class_EngineDebugger_method_line_poll>`
  143. Forces a processing loop of debugger events. The purpose of this method is just processing events every now and then when the script might get too busy, so that bugs like infinite loops can be caught.
  144. .. rst-class:: classref-item-separator
  145. ----
  146. .. _class_EngineDebugger_method_profiler_add_frame_data:
  147. .. rst-class:: classref-method
  148. |void| **profiler_add_frame_data**\ (\ name\: :ref:`StringName<class_StringName>`, data\: :ref:`Array<class_Array>`\ ) :ref:`🔗<class_EngineDebugger_method_profiler_add_frame_data>`
  149. Calls the ``add`` callable of the profiler with given ``name`` and ``data``.
  150. .. rst-class:: classref-item-separator
  151. ----
  152. .. _class_EngineDebugger_method_profiler_enable:
  153. .. rst-class:: classref-method
  154. |void| **profiler_enable**\ (\ name\: :ref:`StringName<class_StringName>`, enable\: :ref:`bool<class_bool>`, arguments\: :ref:`Array<class_Array>` = []\ ) :ref:`🔗<class_EngineDebugger_method_profiler_enable>`
  155. Calls the ``toggle`` callable of the profiler with given ``name`` and ``arguments``. Enables/Disables the same profiler depending on ``enable`` argument.
  156. .. rst-class:: classref-item-separator
  157. ----
  158. .. _class_EngineDebugger_method_register_message_capture:
  159. .. rst-class:: classref-method
  160. |void| **register_message_capture**\ (\ name\: :ref:`StringName<class_StringName>`, callable\: :ref:`Callable<class_Callable>`\ ) :ref:`🔗<class_EngineDebugger_method_register_message_capture>`
  161. Registers a message capture with given ``name``. If ``name`` is "my_message" then messages starting with "my_message:" will be called with the given callable.
  162. The callable must accept a message string and a data array as argument. The callable should return ``true`` if the message is recognized.
  163. \ **Note:** The callable will receive the message with the prefix stripped, unlike :ref:`EditorDebuggerPlugin._capture<class_EditorDebuggerPlugin_private_method__capture>`. See the :ref:`EditorDebuggerPlugin<class_EditorDebuggerPlugin>` description for an example.
  164. .. rst-class:: classref-item-separator
  165. ----
  166. .. _class_EngineDebugger_method_register_profiler:
  167. .. rst-class:: classref-method
  168. |void| **register_profiler**\ (\ name\: :ref:`StringName<class_StringName>`, profiler\: :ref:`EngineProfiler<class_EngineProfiler>`\ ) :ref:`🔗<class_EngineDebugger_method_register_profiler>`
  169. Registers a profiler with the given ``name``. See :ref:`EngineProfiler<class_EngineProfiler>` for more information.
  170. .. rst-class:: classref-item-separator
  171. ----
  172. .. _class_EngineDebugger_method_remove_breakpoint:
  173. .. rst-class:: classref-method
  174. |void| **remove_breakpoint**\ (\ line\: :ref:`int<class_int>`, source\: :ref:`StringName<class_StringName>`\ ) :ref:`🔗<class_EngineDebugger_method_remove_breakpoint>`
  175. Removes a breakpoint with the given ``source`` and ``line``.
  176. .. rst-class:: classref-item-separator
  177. ----
  178. .. _class_EngineDebugger_method_script_debug:
  179. .. rst-class:: classref-method
  180. |void| **script_debug**\ (\ language\: :ref:`ScriptLanguage<class_ScriptLanguage>`, can_continue\: :ref:`bool<class_bool>` = true, is_error_breakpoint\: :ref:`bool<class_bool>` = false\ ) :ref:`🔗<class_EngineDebugger_method_script_debug>`
  181. Starts a debug break in script execution, optionally specifying whether the program can continue based on ``can_continue`` and whether the break was due to a breakpoint.
  182. .. rst-class:: classref-item-separator
  183. ----
  184. .. _class_EngineDebugger_method_send_message:
  185. .. rst-class:: classref-method
  186. |void| **send_message**\ (\ message\: :ref:`String<class_String>`, data\: :ref:`Array<class_Array>`\ ) :ref:`🔗<class_EngineDebugger_method_send_message>`
  187. Sends a message with given ``message`` and ``data`` array.
  188. .. rst-class:: classref-item-separator
  189. ----
  190. .. _class_EngineDebugger_method_set_depth:
  191. .. rst-class:: classref-method
  192. |void| **set_depth**\ (\ depth\: :ref:`int<class_int>`\ ) :ref:`🔗<class_EngineDebugger_method_set_depth>`
  193. **Experimental:** This method may be changed or removed in future versions.
  194. Sets the current debugging depth.
  195. .. rst-class:: classref-item-separator
  196. ----
  197. .. _class_EngineDebugger_method_set_lines_left:
  198. .. rst-class:: classref-method
  199. |void| **set_lines_left**\ (\ lines\: :ref:`int<class_int>`\ ) :ref:`🔗<class_EngineDebugger_method_set_lines_left>`
  200. **Experimental:** This method may be changed or removed in future versions.
  201. Sets the current debugging lines that remain.
  202. .. rst-class:: classref-item-separator
  203. ----
  204. .. _class_EngineDebugger_method_unregister_message_capture:
  205. .. rst-class:: classref-method
  206. |void| **unregister_message_capture**\ (\ name\: :ref:`StringName<class_StringName>`\ ) :ref:`🔗<class_EngineDebugger_method_unregister_message_capture>`
  207. Unregisters the message capture with given ``name``.
  208. .. rst-class:: classref-item-separator
  209. ----
  210. .. _class_EngineDebugger_method_unregister_profiler:
  211. .. rst-class:: classref-method
  212. |void| **unregister_profiler**\ (\ name\: :ref:`StringName<class_StringName>`\ ) :ref:`🔗<class_EngineDebugger_method_unregister_profiler>`
  213. Unregisters a profiler with given ``name``.
  214. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  215. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  216. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  217. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  218. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  219. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
  220. .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`
  221. .. |void| replace:: :abbr:`void (No return value.)`