EngineDebugger

继承: Object

Exposes the internal debugger.

描述

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.

方法

voidclear_breakpoints ( )
voiddebug ( can_continue: bool = true, is_error_breakpoint: bool = false )
intget_depth ( ) const1
intget_lines_left ( ) const1
boolhas_capture ( name: StringName )
boolhas_profiler ( name: StringName )
voidinsert_breakpoint ( line: int, source: StringName )
boolis_active ( )
boolis_breakpoint ( line: int, source: StringName ) const1
boolis_profiling ( name: StringName )
boolis_skipping_breakpoints ( ) const1
voidline_poll ( )
voidprofiler_add_frame_data ( name: StringName, data: Array )
voidprofiler_enable ( name: StringName, enable: bool, arguments: Array = [] )
voidregister_message_capture ( name: StringName, callable: Callable )
voidregister_profiler ( name: StringName, profiler: EngineProfiler )
voidremove_breakpoint ( line: int, source: StringName )
voidscript_debug ( language: ScriptLanguage, can_continue: bool = true, is_error_breakpoint: bool = false )
voidsend_message ( message: String, data: Array )
voidset_depth ( depth: int )
voidset_lines_left ( lines: int )
voidunregister_message_capture ( name: StringName )
voidunregister_profiler ( name: StringName )

方法说明

void clear_breakpoints ( )

Clears all breakpoints.


void debug ( can_continue: bool = true, is_error_breakpoint: bool = false )

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.


int get_depth ( ) const1

实验性: 未来版本中可能会修改或移除该方法。

Returns the current debug depth.


int get_lines_left ( ) const1

实验性: 未来版本中可能会修改或移除该方法。

Returns the number of lines that remain.


bool has_capture ( name: StringName )

Returns true if a capture with the given name is present otherwise false.


bool has_profiler ( name: StringName )

Returns true if a profiler with the given name is present otherwise false.


void insert_breakpoint ( line: int, source: StringName )

Inserts a new breakpoint with the given source and line.


bool is_active ( )

Returns true if the debugger is active otherwise false.


bool is_breakpoint ( line: int, source: StringName ) const1

Returns true if the given source and line represent an existing breakpoint.


bool is_profiling ( name: StringName )

Returns true if a profiler with the given name is present and active otherwise false.


bool is_skipping_breakpoints ( ) const1

Returns true if the debugger is skipping breakpoints otherwise false.


void line_poll ( )

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.


void profiler_add_frame_data ( name: StringName, data: Array )

Calls the add callable of the profiler with given name and data.


void profiler_enable ( name: StringName, enable: bool, arguments: Array = [] )

Calls the toggle callable of the profiler with given name and arguments. Enables/Disables the same profiler depending on enable argument.


void register_message_capture ( name: StringName, callable: Callable )

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.

The callable must accept a message string and a data array as argument. The callable should return true if the message is recognized.

Note: The callable will receive the message with the prefix stripped, unlike EditorDebuggerPlugin._capture. See the EditorDebuggerPlugin description for an example.


void register_profiler ( name: StringName, profiler: EngineProfiler )

Registers a profiler with the given name. See EngineProfiler for more information.


void remove_breakpoint ( line: int, source: StringName )

Removes a breakpoint with the given source and line.


void script_debug ( language: ScriptLanguage, can_continue: bool = true, is_error_breakpoint: bool = false )

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.


void send_message ( message: String, data: Array )

Sends a message with given message and data array.


void set_depth ( depth: int )

实验性: 未来版本中可能会修改或移除该方法。

Sets the current debugging depth.


void set_lines_left ( lines: int )

实验性: 未来版本中可能会修改或移除该方法。

Sets the current debugging lines that remain.


void unregister_message_capture ( name: StringName )

Unregisters the message capture with given name.


void unregister_profiler ( name: StringName )

Unregisters a profiler with given name.

2

本方法通常需要用户覆盖才能生效。

1

本方法无副作用,不会修改该实例的任何成员变量。

3

本方法除了能接受在此处描述的参数外,还能够继续接受任意数量的参数。

4

本方法用于构造某个类型。

5

调用本方法无需实例,可直接使用类名进行调用。

6

本方法描述的是使用本类型作为左操作数的有效运算符。

7

这个值是由下列位标志构成位掩码的整数。

8

无返回值。