diff options
author | Fabio Alessandrelli <fabio.alessandrelli@gmail.com> | 2021-09-01 16:17:32 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-01 16:17:32 +0200 |
commit | 58c30b2626f4fcd00dece84de7778acfd2e9c6f8 (patch) | |
tree | 11899328f80795d7978442e256e9344c0b9bc81e /editor/debugger/script_editor_debugger.cpp | |
parent | 8259a3b1c2aee729584f1960686db4e9708f7f19 (diff) | |
parent | 292ed61c186f0c8416a0837f69817f747e4b5e26 (diff) | |
download | redot-engine-58c30b2626f4fcd00dece84de7778acfd2e9c6f8.tar.gz |
Merge pull request #51639 from Ev1lbl0w/gsoc21-dap
Implement more advanced features for DAP
Diffstat (limited to 'editor/debugger/script_editor_debugger.cpp')
-rw-r--r-- | editor/debugger/script_editor_debugger.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/editor/debugger/script_editor_debugger.cpp b/editor/debugger/script_editor_debugger.cpp index 2a5013893f..2f5bde64a9 100644 --- a/editor/debugger/script_editor_debugger.cpp +++ b/editor/debugger/script_editor_debugger.cpp @@ -296,6 +296,7 @@ Size2 ScriptEditorDebugger::get_minimum_size() const { } void ScriptEditorDebugger::_parse_message(const String &p_msg, const Array &p_data) { + emit_signal(SNAME("debug_data"), p_msg, p_data); if (p_msg == "debug_enter") { _put_msg("get_stack_dump", Array()); @@ -872,6 +873,16 @@ void ScriptEditorDebugger::_clear_execution() { inspector->clear_stack_variables(); } +void ScriptEditorDebugger::_set_breakpoint(const String &p_file, const int &p_line, const bool &p_enabled) { + Ref<Script> script = ResourceLoader::load(p_file); + emit_signal("set_breakpoint", script, p_line - 1, p_enabled); + script.unref(); +} + +void ScriptEditorDebugger::_clear_breakpoints() { + emit_signal("clear_breakpoints"); +} + void ScriptEditorDebugger::start(Ref<RemoteDebuggerPeer> p_peer) { error_count = 0; warning_count = 0; @@ -1503,6 +1514,9 @@ void ScriptEditorDebugger::_bind_methods() { ADD_SIGNAL(MethodInfo("stack_dump", PropertyInfo(Variant::ARRAY, "stack_dump"))); ADD_SIGNAL(MethodInfo("stack_frame_vars", PropertyInfo(Variant::INT, "num_vars"))); ADD_SIGNAL(MethodInfo("stack_frame_var", PropertyInfo(Variant::ARRAY, "data"))); + ADD_SIGNAL(MethodInfo("debug_data", PropertyInfo(Variant::STRING, "msg"), PropertyInfo(Variant::ARRAY, "data"))); + ADD_SIGNAL(MethodInfo("set_breakpoint", PropertyInfo("script"), PropertyInfo(Variant::INT, "line"), PropertyInfo(Variant::BOOL, "enabled"))); + ADD_SIGNAL(MethodInfo("clear_breakpoints")); } void ScriptEditorDebugger::add_debugger_plugin(const Ref<Script> &p_script) { |