Merge pull request #39440 from simpuid/custom-profilers
Debugger Plugins in Godot
This commit is contained in:
commit
d30c3d06dd
16 changed files with 780 additions and 1 deletions
|
|
@ -34,6 +34,7 @@
|
|||
#include "editor/debugger/script_editor_debugger.h"
|
||||
#include "editor/editor_log.h"
|
||||
#include "editor/editor_node.h"
|
||||
#include "editor/plugins/editor_debugger_plugin.h"
|
||||
#include "editor/plugins/script_editor_plugin.h"
|
||||
#include "scene/gui/menu_button.h"
|
||||
#include "scene/gui/tab_container.h"
|
||||
|
|
@ -114,6 +115,12 @@ ScriptEditorDebugger *EditorDebuggerNode::_add_debugger() {
|
|||
tabs->add_theme_style_override("panel", EditorNode::get_singleton()->get_gui_base()->get_theme_stylebox("DebuggerPanel", "EditorStyles"));
|
||||
}
|
||||
|
||||
if (!debugger_plugins.empty()) {
|
||||
for (Set<Ref<Script>>::Element *i = debugger_plugins.front(); i; i = i->next()) {
|
||||
node->add_debugger_plugin(i->get());
|
||||
}
|
||||
}
|
||||
|
||||
return node;
|
||||
}
|
||||
|
||||
|
|
@ -618,3 +625,23 @@ void EditorDebuggerNode::live_debug_reparent_node(const NodePath &p_at, const No
|
|||
dbg->live_debug_reparent_node(p_at, p_new_place, p_new_name, p_at_pos);
|
||||
});
|
||||
}
|
||||
|
||||
void EditorDebuggerNode::add_debugger_plugin(const Ref<Script> &p_script) {
|
||||
ERR_FAIL_COND_MSG(debugger_plugins.has(p_script), "Debugger plugin already exists.");
|
||||
ERR_FAIL_COND_MSG(p_script.is_null(), "Debugger plugin script is null");
|
||||
ERR_FAIL_COND_MSG(String(p_script->get_instance_base_type()) == "", "Debugger plugin script has error.");
|
||||
ERR_FAIL_COND_MSG(String(p_script->get_instance_base_type()) != "EditorDebuggerPlugin", "Base type of debugger plugin is not 'EditorDebuggerPlugin'.");
|
||||
ERR_FAIL_COND_MSG(!p_script->is_tool(), "Debugger plugin script is not in tool mode.");
|
||||
debugger_plugins.insert(p_script);
|
||||
for (int i = 0; get_debugger(i); i++) {
|
||||
get_debugger(i)->add_debugger_plugin(p_script);
|
||||
}
|
||||
}
|
||||
|
||||
void EditorDebuggerNode::remove_debugger_plugin(const Ref<Script> &p_script) {
|
||||
ERR_FAIL_COND_MSG(!debugger_plugins.has(p_script), "Debugger plugin doesn't exists.");
|
||||
debugger_plugins.erase(p_script);
|
||||
for (int i = 0; get_debugger(i); i++) {
|
||||
get_debugger(i)->remove_debugger_plugin(p_script);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -103,6 +103,8 @@ private:
|
|||
CameraOverride camera_override = OVERRIDE_NONE;
|
||||
Map<Breakpoint, bool> breakpoints;
|
||||
|
||||
Set<Ref<Script>> debugger_plugins;
|
||||
|
||||
ScriptEditorDebugger *_add_debugger();
|
||||
EditorDebuggerRemoteObject *get_inspected_remote_object();
|
||||
|
||||
|
|
@ -186,5 +188,8 @@ public:
|
|||
Error start(const String &p_protocol = "tcp://");
|
||||
|
||||
void stop();
|
||||
|
||||
void add_debugger_plugin(const Ref<Script> &p_script);
|
||||
void remove_debugger_plugin(const Ref<Script> &p_script);
|
||||
};
|
||||
#endif // EDITOR_DEBUGGER_NODE_H
|
||||
|
|
|
|||
|
|
@ -44,6 +44,7 @@
|
|||
#include "editor/editor_scale.h"
|
||||
#include "editor/editor_settings.h"
|
||||
#include "editor/plugins/canvas_item_editor_plugin.h"
|
||||
#include "editor/plugins/editor_debugger_plugin.h"
|
||||
#include "editor/plugins/node_3d_editor_plugin.h"
|
||||
#include "editor/property_editor.h"
|
||||
#include "main/performance.h"
|
||||
|
|
@ -701,7 +702,28 @@ void ScriptEditorDebugger::_parse_message(const String &p_msg, const Array &p_da
|
|||
performance_profiler->update_monitors(monitors);
|
||||
|
||||
} else {
|
||||
WARN_PRINT("unknown message " + p_msg);
|
||||
int colon_index = p_msg.find_char(':');
|
||||
ERR_FAIL_COND_MSG(colon_index < 1, "Invalid message received");
|
||||
|
||||
bool parsed = false;
|
||||
const String cap = p_msg.substr(0, colon_index);
|
||||
Map<StringName, Callable>::Element *element = captures.find(cap);
|
||||
if (element) {
|
||||
Callable &c = element->value();
|
||||
ERR_FAIL_COND_MSG(c.is_null(), "Invalid callable registered: " + cap);
|
||||
Variant cmd = p_msg.substr(colon_index + 1), data = p_data;
|
||||
const Variant *args[2] = { &cmd, &data };
|
||||
Variant retval;
|
||||
Callable::CallError err;
|
||||
c.call(args, 2, retval, err);
|
||||
ERR_FAIL_COND_MSG(err.error != Callable::CallError::CALL_OK, "Error calling 'capture' to callable: " + Variant::get_callable_error_text(c, args, 2, err));
|
||||
ERR_FAIL_COND_MSG(retval.get_type() != Variant::BOOL, "Error calling 'capture' to callable: " + String(c) + ". Return type is not bool.");
|
||||
parsed = retval;
|
||||
}
|
||||
|
||||
if (!parsed) {
|
||||
WARN_PRINT("unknown message " + p_msg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -847,6 +869,7 @@ void ScriptEditorDebugger::start(Ref<RemoteDebuggerPeer> p_peer) {
|
|||
tabs->set_current_tab(0);
|
||||
_set_reason_text(TTR("Debug session started."), MESSAGE_SUCCESS);
|
||||
_update_buttons_state();
|
||||
emit_signal("started");
|
||||
}
|
||||
|
||||
void ScriptEditorDebugger::_update_buttons_state() {
|
||||
|
|
@ -1395,6 +1418,7 @@ void ScriptEditorDebugger::_bind_methods() {
|
|||
ClassDB::bind_method(D_METHOD("request_remote_object", "id"), &ScriptEditorDebugger::request_remote_object);
|
||||
ClassDB::bind_method(D_METHOD("update_remote_object", "id", "property", "value"), &ScriptEditorDebugger::update_remote_object);
|
||||
|
||||
ADD_SIGNAL(MethodInfo("started"));
|
||||
ADD_SIGNAL(MethodInfo("stopped"));
|
||||
ADD_SIGNAL(MethodInfo("stop_requested"));
|
||||
ADD_SIGNAL(MethodInfo("stack_frame_selected", PropertyInfo(Variant::INT, "frame")));
|
||||
|
|
@ -1408,6 +1432,43 @@ void ScriptEditorDebugger::_bind_methods() {
|
|||
ADD_SIGNAL(MethodInfo("remote_tree_updated"));
|
||||
}
|
||||
|
||||
void ScriptEditorDebugger::add_debugger_plugin(const Ref<Script> &p_script) {
|
||||
if (!debugger_plugins.has(p_script)) {
|
||||
EditorDebuggerPlugin *plugin = memnew(EditorDebuggerPlugin());
|
||||
plugin->attach_debugger(this);
|
||||
plugin->set_script(p_script);
|
||||
tabs->add_child(plugin);
|
||||
debugger_plugins.insert(p_script, plugin);
|
||||
}
|
||||
}
|
||||
|
||||
void ScriptEditorDebugger::remove_debugger_plugin(const Ref<Script> &p_script) {
|
||||
if (debugger_plugins.has(p_script)) {
|
||||
tabs->remove_child(debugger_plugins[p_script]);
|
||||
debugger_plugins[p_script]->detach_debugger(false);
|
||||
memdelete(debugger_plugins[p_script]);
|
||||
debugger_plugins.erase(p_script);
|
||||
}
|
||||
}
|
||||
|
||||
void ScriptEditorDebugger::send_message(const String &p_message, const Array &p_args) {
|
||||
_put_msg(p_message, p_args);
|
||||
}
|
||||
|
||||
void ScriptEditorDebugger::register_message_capture(const StringName &p_name, const Callable &p_callable) {
|
||||
ERR_FAIL_COND_MSG(has_capture(p_name), "Capture already registered: " + p_name);
|
||||
captures.insert(p_name, p_callable);
|
||||
}
|
||||
|
||||
void ScriptEditorDebugger::unregister_message_capture(const StringName &p_name) {
|
||||
ERR_FAIL_COND_MSG(!has_capture(p_name), "Capture not registered: " + p_name);
|
||||
captures.erase(p_name);
|
||||
}
|
||||
|
||||
bool ScriptEditorDebugger::has_capture(const StringName &p_name) {
|
||||
return captures.has(p_name);
|
||||
}
|
||||
|
||||
ScriptEditorDebugger::ScriptEditorDebugger(EditorNode *p_editor) {
|
||||
editor = p_editor;
|
||||
|
||||
|
|
|
|||
|
|
@ -54,6 +54,7 @@ class EditorVisualProfiler;
|
|||
class EditorNetworkProfiler;
|
||||
class EditorPerformanceProfiler;
|
||||
class SceneDebuggerTree;
|
||||
class EditorDebuggerPlugin;
|
||||
|
||||
class ScriptEditorDebugger : public MarginContainer {
|
||||
GDCLASS(ScriptEditorDebugger, MarginContainer);
|
||||
|
|
@ -146,6 +147,10 @@ private:
|
|||
|
||||
EditorDebuggerNode::CameraOverride camera_override;
|
||||
|
||||
Map<Ref<Script>, EditorDebuggerPlugin *> debugger_plugins;
|
||||
|
||||
Map<StringName, Callable> captures;
|
||||
|
||||
void _stack_dump_frame_selected();
|
||||
|
||||
void _file_selected(const String &p_file);
|
||||
|
|
@ -253,6 +258,16 @@ public:
|
|||
bool is_skip_breakpoints();
|
||||
|
||||
virtual Size2 get_minimum_size() const override;
|
||||
|
||||
void add_debugger_plugin(const Ref<Script> &p_script);
|
||||
void remove_debugger_plugin(const Ref<Script> &p_script);
|
||||
|
||||
void send_message(const String &p_message, const Array &p_args);
|
||||
|
||||
void register_message_capture(const StringName &p_name, const Callable &p_callable);
|
||||
void unregister_message_capture(const StringName &p_name);
|
||||
bool has_capture(const StringName &p_name);
|
||||
|
||||
ScriptEditorDebugger(EditorNode *p_editor = nullptr);
|
||||
~ScriptEditorDebugger();
|
||||
};
|
||||
|
|
|
|||
|
|
@ -123,6 +123,7 @@
|
|||
#include "editor/plugins/cpu_particles_3d_editor_plugin.h"
|
||||
#include "editor/plugins/curve_editor_plugin.h"
|
||||
#include "editor/plugins/debugger_editor_plugin.h"
|
||||
#include "editor/plugins/editor_debugger_plugin.h"
|
||||
#include "editor/plugins/editor_preview_plugins.h"
|
||||
#include "editor/plugins/gi_probe_editor_plugin.h"
|
||||
#include "editor/plugins/gpu_particles_2d_editor_plugin.h"
|
||||
|
|
@ -3620,6 +3621,7 @@ void EditorNode::register_editor_types() {
|
|||
// FIXME: Is this stuff obsolete, or should it be ported to new APIs?
|
||||
ClassDB::register_class<EditorScenePostImport>();
|
||||
//ClassDB::register_type<EditorImportExport>();
|
||||
ClassDB::register_class<EditorDebuggerPlugin>();
|
||||
}
|
||||
|
||||
void EditorNode::unregister_editor_types() {
|
||||
|
|
|
|||
|
|
@ -811,6 +811,14 @@ ScriptCreateDialog *EditorPlugin::get_script_create_dialog() {
|
|||
return EditorNode::get_singleton()->get_script_create_dialog();
|
||||
}
|
||||
|
||||
void EditorPlugin::add_debugger_plugin(const Ref<Script> &p_script) {
|
||||
EditorDebuggerNode::get_singleton()->add_debugger_plugin(p_script);
|
||||
}
|
||||
|
||||
void EditorPlugin::remove_debugger_plugin(const Ref<Script> &p_script) {
|
||||
EditorDebuggerNode::get_singleton()->remove_debugger_plugin(p_script);
|
||||
}
|
||||
|
||||
void EditorPlugin::_bind_methods() {
|
||||
ClassDB::bind_method(D_METHOD("add_control_to_container", "container", "control"), &EditorPlugin::add_control_to_container);
|
||||
ClassDB::bind_method(D_METHOD("add_control_to_bottom_panel", "control", "title"), &EditorPlugin::add_control_to_bottom_panel);
|
||||
|
|
@ -851,6 +859,8 @@ void EditorPlugin::_bind_methods() {
|
|||
|
||||
ClassDB::bind_method(D_METHOD("get_editor_interface"), &EditorPlugin::get_editor_interface);
|
||||
ClassDB::bind_method(D_METHOD("get_script_create_dialog"), &EditorPlugin::get_script_create_dialog);
|
||||
ClassDB::bind_method(D_METHOD("add_debugger_plugin", "script"), &EditorPlugin::add_debugger_plugin);
|
||||
ClassDB::bind_method(D_METHOD("remove_debugger_plugin", "script"), &EditorPlugin::remove_debugger_plugin);
|
||||
|
||||
ClassDB::add_virtual_method(get_class_static(), MethodInfo(Variant::BOOL, "forward_canvas_gui_input", PropertyInfo(Variant::OBJECT, "event", PROPERTY_HINT_RESOURCE_TYPE, "InputEvent")));
|
||||
ClassDB::add_virtual_method(get_class_static(), MethodInfo("forward_canvas_draw_over_viewport", PropertyInfo(Variant::OBJECT, "overlay", PROPERTY_HINT_RESOURCE_TYPE, "Control")));
|
||||
|
|
|
|||
|
|
@ -33,6 +33,7 @@
|
|||
|
||||
#include "core/io/config_file.h"
|
||||
#include "core/undo_redo.h"
|
||||
#include "editor/debugger/editor_debugger_node.h"
|
||||
#include "editor/editor_inspector.h"
|
||||
#include "editor/editor_translation_parser.h"
|
||||
#include "editor/import/editor_import_plugin.h"
|
||||
|
|
@ -249,6 +250,9 @@ public:
|
|||
void add_autoload_singleton(const String &p_name, const String &p_path);
|
||||
void remove_autoload_singleton(const String &p_name);
|
||||
|
||||
void add_debugger_plugin(const Ref<Script> &p_script);
|
||||
void remove_debugger_plugin(const Ref<Script> &p_script);
|
||||
|
||||
void enable_plugin();
|
||||
void disable_plugin();
|
||||
|
||||
|
|
|
|||
124
editor/plugins/editor_debugger_plugin.cpp
Normal file
124
editor/plugins/editor_debugger_plugin.cpp
Normal file
|
|
@ -0,0 +1,124 @@
|
|||
/*************************************************************************/
|
||||
/* editor_debugger_plugin.cpp */
|
||||
/*************************************************************************/
|
||||
/* This file is part of: */
|
||||
/* GODOT ENGINE */
|
||||
/* https://godotengine.org */
|
||||
/*************************************************************************/
|
||||
/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
|
||||
/* */
|
||||
/* Permission is hereby granted, free of charge, to any person obtaining */
|
||||
/* a copy of this software and associated documentation files (the */
|
||||
/* "Software"), to deal in the Software without restriction, including */
|
||||
/* without limitation the rights to use, copy, modify, merge, publish, */
|
||||
/* distribute, sublicense, and/or sell copies of the Software, and to */
|
||||
/* permit persons to whom the Software is furnished to do so, subject to */
|
||||
/* the following conditions: */
|
||||
/* */
|
||||
/* The above copyright notice and this permission notice shall be */
|
||||
/* included in all copies or substantial portions of the Software. */
|
||||
/* */
|
||||
/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
|
||||
/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
|
||||
/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
|
||||
/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
|
||||
/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
|
||||
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
|
||||
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
/*************************************************************************/
|
||||
|
||||
#include "editor_debugger_plugin.h"
|
||||
|
||||
#include "editor/debugger/script_editor_debugger.h"
|
||||
|
||||
void EditorDebuggerPlugin::_breaked(bool p_really_did, bool p_can_debug) {
|
||||
if (p_really_did) {
|
||||
emit_signal("breaked", p_can_debug);
|
||||
} else {
|
||||
emit_signal("continued");
|
||||
}
|
||||
}
|
||||
|
||||
void EditorDebuggerPlugin::_started() {
|
||||
emit_signal("started");
|
||||
}
|
||||
|
||||
void EditorDebuggerPlugin::_stopped() {
|
||||
emit_signal("stopped");
|
||||
}
|
||||
|
||||
void EditorDebuggerPlugin::_bind_methods() {
|
||||
ClassDB::bind_method(D_METHOD("send_message", "message", "data"), &EditorDebuggerPlugin::send_message);
|
||||
ClassDB::bind_method(D_METHOD("register_message_capture", "name", "callable"), &EditorDebuggerPlugin::register_message_capture);
|
||||
ClassDB::bind_method(D_METHOD("unregister_message_capture", "name"), &EditorDebuggerPlugin::unregister_message_capture);
|
||||
ClassDB::bind_method(D_METHOD("has_capture", "name"), &EditorDebuggerPlugin::has_capture);
|
||||
ClassDB::bind_method(D_METHOD("is_breaked"), &EditorDebuggerPlugin::is_breaked);
|
||||
ClassDB::bind_method(D_METHOD("is_debuggable"), &EditorDebuggerPlugin::is_debuggable);
|
||||
ClassDB::bind_method(D_METHOD("is_session_active"), &EditorDebuggerPlugin::is_session_active);
|
||||
|
||||
ADD_SIGNAL(MethodInfo("started"));
|
||||
ADD_SIGNAL(MethodInfo("stopped"));
|
||||
ADD_SIGNAL(MethodInfo("breaked", PropertyInfo(Variant::BOOL, "can_debug")));
|
||||
ADD_SIGNAL(MethodInfo("continued"));
|
||||
}
|
||||
|
||||
void EditorDebuggerPlugin::attach_debugger(ScriptEditorDebugger *p_debugger) {
|
||||
debugger = p_debugger;
|
||||
if (debugger) {
|
||||
debugger->connect("started", callable_mp(this, &EditorDebuggerPlugin::_started));
|
||||
debugger->connect("stopped", callable_mp(this, &EditorDebuggerPlugin::_stopped));
|
||||
debugger->connect("breaked", callable_mp(this, &EditorDebuggerPlugin::_breaked));
|
||||
}
|
||||
}
|
||||
|
||||
void EditorDebuggerPlugin::detach_debugger(bool p_call_debugger) {
|
||||
if (debugger) {
|
||||
debugger->disconnect("started", callable_mp(this, &EditorDebuggerPlugin::_started));
|
||||
debugger->disconnect("stopped", callable_mp(this, &EditorDebuggerPlugin::_stopped));
|
||||
debugger->disconnect("breaked", callable_mp(this, &EditorDebuggerPlugin::_breaked));
|
||||
if (p_call_debugger && get_script_instance()) {
|
||||
debugger->remove_debugger_plugin(get_script_instance()->get_script());
|
||||
}
|
||||
debugger = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
void EditorDebuggerPlugin::send_message(const String &p_message, const Array &p_args) {
|
||||
ERR_FAIL_COND_MSG(!debugger, "Plugin is not attached to debugger");
|
||||
debugger->send_message(p_message, p_args);
|
||||
}
|
||||
|
||||
void EditorDebuggerPlugin::register_message_capture(const StringName &p_name, const Callable &p_callable) {
|
||||
ERR_FAIL_COND_MSG(!debugger, "Plugin is not attached to debugger");
|
||||
debugger->register_message_capture(p_name, p_callable);
|
||||
}
|
||||
|
||||
void EditorDebuggerPlugin::unregister_message_capture(const StringName &p_name) {
|
||||
ERR_FAIL_COND_MSG(!debugger, "Plugin is not attached to debugger");
|
||||
debugger->unregister_message_capture(p_name);
|
||||
}
|
||||
|
||||
bool EditorDebuggerPlugin::has_capture(const StringName &p_name) {
|
||||
ERR_FAIL_COND_V_MSG(!debugger, false, "Plugin is not attached to debugger");
|
||||
return debugger->has_capture(p_name);
|
||||
}
|
||||
|
||||
bool EditorDebuggerPlugin::is_breaked() {
|
||||
ERR_FAIL_COND_V_MSG(!debugger, false, "Plugin is not attached to debugger");
|
||||
return debugger->is_breaked();
|
||||
}
|
||||
|
||||
bool EditorDebuggerPlugin::is_debuggable() {
|
||||
ERR_FAIL_COND_V_MSG(!debugger, false, "Plugin is not attached to debugger");
|
||||
return debugger->is_debuggable();
|
||||
}
|
||||
|
||||
bool EditorDebuggerPlugin::is_session_active() {
|
||||
ERR_FAIL_COND_V_MSG(!debugger, false, "Plugin is not attached to debugger");
|
||||
return debugger->is_session_active();
|
||||
}
|
||||
|
||||
EditorDebuggerPlugin::~EditorDebuggerPlugin() {
|
||||
detach_debugger(true);
|
||||
}
|
||||
64
editor/plugins/editor_debugger_plugin.h
Normal file
64
editor/plugins/editor_debugger_plugin.h
Normal file
|
|
@ -0,0 +1,64 @@
|
|||
/*************************************************************************/
|
||||
/* editor_debugger_plugin.h */
|
||||
/*************************************************************************/
|
||||
/* This file is part of: */
|
||||
/* GODOT ENGINE */
|
||||
/* https://godotengine.org */
|
||||
/*************************************************************************/
|
||||
/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
|
||||
/* */
|
||||
/* Permission is hereby granted, free of charge, to any person obtaining */
|
||||
/* a copy of this software and associated documentation files (the */
|
||||
/* "Software"), to deal in the Software without restriction, including */
|
||||
/* without limitation the rights to use, copy, modify, merge, publish, */
|
||||
/* distribute, sublicense, and/or sell copies of the Software, and to */
|
||||
/* permit persons to whom the Software is furnished to do so, subject to */
|
||||
/* the following conditions: */
|
||||
/* */
|
||||
/* The above copyright notice and this permission notice shall be */
|
||||
/* included in all copies or substantial portions of the Software. */
|
||||
/* */
|
||||
/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
|
||||
/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
|
||||
/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
|
||||
/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
|
||||
/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
|
||||
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
|
||||
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
/*************************************************************************/
|
||||
|
||||
#ifndef EDITOR_DEBUGGER_PLUGIN_H
|
||||
#define EDITOR_DEBUGGER_PLUGIN_H
|
||||
|
||||
#include "scene/gui/control.h"
|
||||
|
||||
class ScriptEditorDebugger;
|
||||
|
||||
class EditorDebuggerPlugin : public Control {
|
||||
GDCLASS(EditorDebuggerPlugin, Control);
|
||||
|
||||
private:
|
||||
ScriptEditorDebugger *debugger;
|
||||
|
||||
void _breaked(bool p_really_did, bool p_can_debug);
|
||||
void _started();
|
||||
void _stopped();
|
||||
|
||||
protected:
|
||||
static void _bind_methods();
|
||||
|
||||
public:
|
||||
void attach_debugger(ScriptEditorDebugger *p_debugger);
|
||||
void detach_debugger(bool p_call_debugger);
|
||||
void send_message(const String &p_message, const Array &p_args);
|
||||
void register_message_capture(const StringName &p_name, const Callable &p_callable);
|
||||
void unregister_message_capture(const StringName &p_name);
|
||||
bool has_capture(const StringName &p_name);
|
||||
bool is_breaked();
|
||||
bool is_debuggable();
|
||||
bool is_session_active();
|
||||
~EditorDebuggerPlugin();
|
||||
};
|
||||
|
||||
#endif // EDITOR_DEBUGGER_PLUGIN_H
|
||||
Loading…
Add table
Add a link
Reference in a new issue