Table of Contents

Class EngineDebuggerInstance

Namespace
Godot
Assembly
GodotSharp.dll

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.

[GodotClassName("EngineDebugger")]
public class EngineDebuggerInstance : GodotObject, IDisposable
Inheritance
EngineDebuggerInstance
Implements
Inherited Members

Methods

ClearBreakpoints()

Clears all breakpoints.

public void ClearBreakpoints()

Debug(bool, bool)

Starts a debug break in script execution, optionally specifying whether the program can continue based on canContinue and whether the break was due to a breakpoint.

public void Debug(bool canContinue = true, bool isErrorBreakpoint = false)

Parameters

canContinue bool
isErrorBreakpoint bool

GetDepth()

Returns the current debug depth.

public int GetDepth()

Returns

int

GetLinesLeft()

Returns the number of lines that remain.

public int GetLinesLeft()

Returns

int

HasCapture(StringName)

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

public bool HasCapture(StringName name)

Parameters

name StringName

Returns

bool

HasGodotClassMethod(in godot_string_name)

Check if the type contains a method with the given name. This method is used by Godot to check if a method exists before invoking it. Do not call or override this method.

protected override bool HasGodotClassMethod(in godot_string_name method)

Parameters

method godot_string_name

Name of the method to check for.

Returns

bool

HasGodotClassSignal(in godot_string_name)

Check if the type contains a signal with the given name. This method is used by Godot to check if a signal exists before raising it. Do not call or override this method.

protected override bool HasGodotClassSignal(in godot_string_name signal)

Parameters

signal godot_string_name

Name of the signal to check for.

Returns

bool

HasProfiler(StringName)

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

public bool HasProfiler(StringName name)

Parameters

name StringName

Returns

bool

InsertBreakpoint(int, StringName)

Inserts a new breakpoint with the given source and line.

public void InsertBreakpoint(int line, StringName source)

Parameters

line int
source StringName

InvokeGodotClassMethod(in godot_string_name, NativeVariantPtrArgs, out godot_variant)

Invokes the method with the given name, using the given arguments. This method is used by Godot to invoke methods from the engine side. Do not call or override this method.

protected override bool InvokeGodotClassMethod(in godot_string_name method, NativeVariantPtrArgs args, out godot_variant ret)

Parameters

method godot_string_name

Name of the method to invoke.

args NativeVariantPtrArgs

Arguments to use with the invoked method.

ret godot_variant

Value returned by the invoked method.

Returns

bool

IsActive()

Returns true if the debugger is active otherwise false.

public bool IsActive()

Returns

bool

IsBreakpoint(int, StringName)

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

public bool IsBreakpoint(int line, StringName source)

Parameters

line int
source StringName

Returns

bool

IsProfiling(StringName)

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

public bool IsProfiling(StringName name)

Parameters

name StringName

Returns

bool

IsSkippingBreakpoints()

Returns true if the debugger is skipping breakpoints otherwise false.

public bool IsSkippingBreakpoints()

Returns

bool

LinePoll()

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

public void LinePoll()

ProfilerAddFrameData(StringName, Array)

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

public void ProfilerAddFrameData(StringName name, Array data)

Parameters

name StringName
data Array

ProfilerEnable(StringName, bool, Array)

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

public void ProfilerEnable(StringName name, bool enable, Array arguments = null)

Parameters

name StringName
enable bool
arguments Array

RegisterMessageCapture(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.

Callable must accept a message string and a data array as argument. If the message and data are valid then callable must return true otherwise false.

public void RegisterMessageCapture(StringName name, Callable callable)

Parameters

name StringName
callable Callable

RegisterProfiler(StringName, EngineProfiler)

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

public void RegisterProfiler(StringName name, EngineProfiler profiler)

Parameters

name StringName
profiler EngineProfiler

RemoveBreakpoint(int, StringName)

Removes a breakpoint with the given source and line.

public void RemoveBreakpoint(int line, StringName source)

Parameters

line int
source StringName

ScriptDebug(ScriptLanguage, bool, bool)

Starts a debug break in script execution, optionally specifying whether the program can continue based on canContinue and whether the break was due to a breakpoint.

public void ScriptDebug(ScriptLanguage language, bool canContinue = true, bool isErrorBreakpoint = false)

Parameters

language ScriptLanguage
canContinue bool
isErrorBreakpoint bool

SendMessage(string, Array)

Sends a message with given message and data array.

public void SendMessage(string message, Array data)

Parameters

message string
data Array

SetDepth(int)

Sets the current debugging depth.

public void SetDepth(int depth)

Parameters

depth int

SetLinesLeft(int)

Sets the current debugging lines that remain.

public void SetLinesLeft(int lines)

Parameters

lines int

UnregisterMessageCapture(StringName)

Unregisters the message capture with given name.

public void UnregisterMessageCapture(StringName name)

Parameters

name StringName

UnregisterProfiler(StringName)

Unregisters a profiler with given name.

public void UnregisterProfiler(StringName name)

Parameters

name StringName