Table of Contents

Class EngineDebugger

Exposes the internal debugger.

Inheritance
EngineDebugger

Remarks

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.

Methods

clear_breakpoints

Clears all breakpoints.

void clear_breakpoints

debug(bool, bool)

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 debug(bool can_continue, bool is_error_breakpoint)

Parameters

can_continue bool
is_error_breakpoint bool

get_depth

Qualifiers: const

Returns the current debug depth.

int get_depth

get_lines_left

Qualifiers: const

Returns the number of lines that remain.

int get_lines_left

has_capture(StringName)

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

bool has_capture(StringName name)

Parameters

name StringName

has_profiler(StringName)

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

bool has_profiler(StringName name)

Parameters

name StringName

insert_breakpoint(int, StringName)

Inserts a new breakpoint with the given source and line.

void insert_breakpoint(int line, StringName source)

Parameters

line int
source StringName

is_active

Returns true if the debugger is active otherwise false.

bool is_active

is_breakpoint(int, StringName)

Qualifiers: const

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

bool is_breakpoint(int line, StringName source)

Parameters

line int
source StringName

is_profiling(StringName)

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

bool is_profiling(StringName name)

Parameters

name StringName

is_skipping_breakpoints

Qualifiers: const

Returns true if the debugger is skipping breakpoints otherwise false.

bool is_skipping_breakpoints

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 line_poll

profiler_add_frame_data(StringName, Array)

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

void profiler_add_frame_data(StringName name, Array data)

Parameters

name StringName
data Array

profiler_enable(StringName, bool, Array)

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

void profiler_enable(StringName name, bool enable, Array arguments)

Parameters

name StringName
enable bool
arguments Array

register_message_capture(StringName, 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_message_capture(StringName name, Callable callable)

Parameters

name StringName
callable Callable

register_profiler(StringName, EngineProfiler)

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

void register_profiler(StringName name, EngineProfiler profiler)

Parameters

name StringName
profiler EngineProfiler

remove_breakpoint(int, StringName)

Removes a breakpoint with the given source and line.

void remove_breakpoint(int line, StringName source)

Parameters

line int
source StringName

script_debug(ScriptLanguage, bool, bool)

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 script_debug(ScriptLanguage language, bool can_continue, bool is_error_breakpoint)

Parameters

language ScriptLanguage
can_continue bool
is_error_breakpoint bool

send_message(String, Array)

Sends a message with given message and data array.

void send_message(String message, Array data)

Parameters

message String
data Array

set_depth(int)

Sets the current debugging depth.

void set_depth(int depth)

Parameters

depth int

set_lines_left(int)

Sets the current debugging lines that remain.

void set_lines_left(int lines)

Parameters

lines int

unregister_message_capture(StringName)

Unregisters the message capture with given name.

void unregister_message_capture(StringName name)

Parameters

name StringName

unregister_profiler(StringName)

Unregisters a profiler with given name.

void unregister_profiler(StringName name)

Parameters

name StringName