EditorDebuggerPluginο
Inherits: RefCounted < Object
A base class to implement debugger plugins.
Descriptionο
EditorDebuggerPlugin provides functions related to the editor side of the debugger.
To interact with the debugger, an instance of this class must be added to the editor via EditorPlugin.add_debugger_plugin().
Once added, the _setup_session() callback will be called for every EditorDebuggerSession available to the plugin, and when new ones are created (the sessions may be inactive during this stage).
You can retrieve the available EditorDebuggerSessions via get_sessions() or get a specific one via get_session().
To connect on the running game side, use the EngineDebugger singleton:
Note: While the game is running, @GlobalScope.print() and similar functions called in the editor do not print anything, the Output Log prints only game messages.
Methodsο
void |
_breakpoint_set_in_tree(script: Script, line: int, enabled: bool) virtual |
void |
_breakpoints_cleared_in_tree() virtual |
_capture(message: String, data: Array, session_id: int) virtual |
|
void |
_goto_script_line(script: Script, line: int) virtual |
_has_capture(capture: String) virtual const |
|
void |
_setup_session(session_id: int) virtual |
get_session(id: int) |
|
Method Descriptionsο
void _breakpoint_set_in_tree(script: Script, line: int, enabled: bool) virtual π
Override this method to be notified when a breakpoint is set in the editor.
void _breakpoints_cleared_in_tree() virtual π
Override this method to be notified when all breakpoints are cleared in the editor.
bool _capture(message: String, data: Array, session_id: int) virtual π
Override this method to process incoming messages. The session_id is the ID of the EditorDebuggerSession that received the message. Use get_session() to retrieve the session. This method should return true if the message is recognized.
void _goto_script_line(script: Script, line: int) virtual π
Override this method to be notified when a breakpoint line has been clicked in the debugger breakpoint panel.
bool _has_capture(capture: String) virtual const π
Override this method to enable receiving messages from the debugger. If capture is βmy_messageβ then messages starting with βmy_message:β will be passed to the _capture() method.
void _setup_session(session_id: int) virtual π
Override this method to be notified whenever a new EditorDebuggerSession is created. Note that the session may be inactive during this stage.
EditorDebuggerSession get_session(id: int) π
Returns the EditorDebuggerSession with the given id.
Returns an array of EditorDebuggerSession currently available to this debugger plugin.
Note: Sessions in the array may be inactive, check their state via EditorDebuggerSession.is_active().