EngineDebugger

package
v0.0.0-...-535787f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 16, 2025 License: MIT Imports: 25 Imported by: 0

Documentation

Overview

graphics.gd/classdb/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.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Advanced

func Advanced() class

Advanced exposes a 1:1 low-level instance of the class, undocumented, for those who know what they are doing.

func ClearBreakpoints

func ClearBreakpoints()

Clears all breakpoints.

func Debug

func Debug(is_error_breakpoint 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.

func DebugOptions

func DebugOptions(can_continue bool, is_error_breakpoint 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.

func GetDepth

func GetDepth() int

Returns the current debug depth.

func GetLinesLeft

func GetLinesLeft() int

Returns the number of lines that remain.

func HasCapture

func HasCapture(name string) bool

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

func HasProfiler

func HasProfiler(name string) bool

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

func InsertBreakpoint

func InsertBreakpoint(line int, source string)

Inserts a new breakpoint with the given 'source' and 'line'.

func IsActive

func IsActive() bool

Returns true if the debugger is active otherwise false.

func IsBreakpoint

func IsBreakpoint(line int, source string) bool

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

func IsProfiling

func IsProfiling(name string) bool

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

func IsSkippingBreakpoints

func IsSkippingBreakpoints() bool

Returns true if the debugger is skipping breakpoints otherwise false.

func LinePoll

func 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.

func ProfilerAddFrameData

func ProfilerAddFrameData(name string, data []any)

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

func ProfilerEnable

func ProfilerEnable(name string, enable bool, arguments []any)

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

func ProfilerEnableOptions

func ProfilerEnableOptions(name string, enable bool, arguments []any)

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

func RegisterMessageCapture

func RegisterMessageCapture(name string, callable func(message string, data []any) bool)

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 graphics.gd/classdb/EditorDebuggerPlugin.Instance.Capture. See the graphics.gd/classdb/EditorDebuggerPlugin description for an example.

func RegisterProfiler

func RegisterProfiler(name string, profiler EngineProfiler.Instance)

Registers a profiler with the given 'name'. See graphics.gd/classdb/EngineProfiler for more information.

func RemoveBreakpoint

func RemoveBreakpoint(line int, source string)

Removes a breakpoint with the given 'source' and 'line'.

func ScriptDebug

func ScriptDebug(language ScriptLanguage.Instance, is_error_breakpoint 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.

func ScriptDebugOptions

func ScriptDebugOptions(language ScriptLanguage.Instance, can_continue bool, is_error_breakpoint 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.

func SendMessage

func SendMessage(message string, data []any)

Sends a message with given 'message' and 'data' array.

func SetDepth

func SetDepth(depth int)

Sets the current debugging depth.

func SetLinesLeft

func SetLinesLeft(lines int)

Sets the current debugging lines that remain.

func UnregisterMessageCapture

func UnregisterMessageCapture(name string)

Unregisters the message capture with given 'name'.

func UnregisterProfiler

func UnregisterProfiler(name string)

Unregisters a profiler with given 'name'.

Types

type Extension

type Extension[T gdclass.Interface] struct{ gdclass.Extension[T, Instance] }

Extension can be embedded in a new struct to create an extension of this class. T should be the type that is embedding this Extension

func (*Extension[T]) AsObject

func (self *Extension[T]) AsObject() [1]gd.Object

type ID

type ID Object.ID

ID is a typed object ID (reference) to an instance of this class, use it to store references to objects with unknown lifetimes, as an ID will not panic on use if the underlying object has been destroyed.

func (ID) Instance

func (id ID) Instance() (Instance, bool)

type Instance

type Instance [1]gdclass.EngineDebugger

Instance of the class with convieniently typed arguments and results.

func (Instance) AsObject

func (self Instance) AsObject() [1]gd.Object

func (Instance) ID

func (self Instance) ID() ID

func (*Instance) SetObject

func (self *Instance) SetObject(obj [1]gd.Object) bool

func (Instance) Virtual

func (self Instance) Virtual(name string) reflect.Value

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL