summaryrefslogtreecommitdiff
path: root/editor/script_editor_debugger.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'editor/script_editor_debugger.cpp')
-rw-r--r--editor/script_editor_debugger.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/editor/script_editor_debugger.cpp b/editor/script_editor_debugger.cpp
index 717d6bc8f6..01e4db6ffb 100644
--- a/editor/script_editor_debugger.cpp
+++ b/editor/script_editor_debugger.cpp
@@ -209,6 +209,7 @@ void ScriptEditorDebugger::debug_next() {
Array msg;
msg.push_back("next");
ppeer->put_var(msg);
+ _clear_execution();
stack_dump->clear();
inspector->edit(NULL);
}
@@ -221,6 +222,7 @@ void ScriptEditorDebugger::debug_step() {
Array msg;
msg.push_back("step");
ppeer->put_var(msg);
+ _clear_execution();
stack_dump->clear();
inspector->edit(NULL);
}
@@ -245,6 +247,7 @@ void ScriptEditorDebugger::debug_continue() {
OS::get_singleton()->enable_for_stealing_focus(EditorNode::get_singleton()->get_child_process_id());
Array msg;
+ _clear_execution();
msg.push_back("continue");
ppeer->put_var(msg);
}
@@ -424,6 +427,7 @@ void ScriptEditorDebugger::_parse_message(const String &p_msg, const Array &p_da
} else if (p_msg == "debug_exit") {
breaked = false;
+ _clear_execution();
copy->set_disabled(true);
step->set_disabled(true);
next->set_disabled(true);
@@ -1273,6 +1277,18 @@ void ScriptEditorDebugger::_notification(int p_what) {
}
}
+void ScriptEditorDebugger::_clear_execution() {
+ TreeItem *ti = stack_dump->get_selected();
+ if (!ti)
+ return;
+
+ Dictionary d = ti->get_metadata(0);
+
+ stack_script = ResourceLoader::load(d["file"]);
+ emit_signal("clear_execution", stack_script);
+ stack_script.unref();
+}
+
void ScriptEditorDebugger::start() {
stop();
@@ -1313,6 +1329,7 @@ void ScriptEditorDebugger::stop() {
set_process(false);
breaked = false;
+ _clear_execution();
server->stop();
_clear_remote_objects();
@@ -1393,6 +1410,7 @@ void ScriptEditorDebugger::_stack_dump_frame_selected() {
stack_script = ResourceLoader::load(d["file"]);
emit_signal("goto_script_line", stack_script, int(d["line"]) - 1);
+ emit_signal("set_execution", stack_script, int(d["line"]) - 1);
stack_script.unref();
if (connection.is_valid() && connection->is_connected_to_host()) {
@@ -1966,6 +1984,8 @@ void ScriptEditorDebugger::_bind_methods() {
ClassDB::bind_method(D_METHOD("_scene_tree_property_value_edited"), &ScriptEditorDebugger::_scene_tree_property_value_edited);
ADD_SIGNAL(MethodInfo("goto_script_line"));
+ ADD_SIGNAL(MethodInfo("set_execution", PropertyInfo("script"), PropertyInfo(Variant::INT, "line")));
+ ADD_SIGNAL(MethodInfo("clear_execution", PropertyInfo("script")));
ADD_SIGNAL(MethodInfo("breaked", PropertyInfo(Variant::BOOL, "reallydid"), PropertyInfo(Variant::BOOL, "can_debug")));
ADD_SIGNAL(MethodInfo("show_debugger", PropertyInfo(Variant::BOOL, "reallydid")));
}