summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/script_debugger_local.cpp2
-rw-r--r--core/script_debugger_local.h2
-rw-r--r--core/script_debugger_remote.cpp15
-rw-r--r--core/script_debugger_remote.h6
-rw-r--r--core/script_language.h2
5 files changed, 21 insertions, 6 deletions
diff --git a/core/script_debugger_local.cpp b/core/script_debugger_local.cpp
index ac4dafcf59..e61f9f7158 100644
--- a/core/script_debugger_local.cpp
+++ b/core/script_debugger_local.cpp
@@ -33,7 +33,7 @@
#include "core/os/os.h"
#include "scene/main/scene_tree.h"
-void ScriptDebuggerLocal::debug(ScriptLanguage *p_script, bool p_can_continue) {
+void ScriptDebuggerLocal::debug(ScriptLanguage *p_script, bool p_can_continue, bool p_is_error_breakpoint) {
if (!target_function.empty()) {
String current_function = p_script->debug_get_stack_level_function(0);
diff --git a/core/script_debugger_local.h b/core/script_debugger_local.h
index 19151d4cb0..b3aed5e358 100644
--- a/core/script_debugger_local.h
+++ b/core/script_debugger_local.h
@@ -48,7 +48,7 @@ class ScriptDebuggerLocal : public ScriptDebugger {
void print_variables(const List<String> &names, const List<Variant> &values, const String &variable_prefix);
public:
- void debug(ScriptLanguage *p_script, bool p_can_continue);
+ void debug(ScriptLanguage *p_script, bool p_can_continue, bool p_is_error_breakpoint);
virtual void send_message(const String &p_message, const Array &p_args);
virtual void send_error(const String &p_func, const String &p_file, int p_line, const String &p_err, const String &p_descr, ErrorHandlerType p_type, const Vector<ScriptLanguage::StackInfo> &p_stack_info);
diff --git a/core/script_debugger_remote.cpp b/core/script_debugger_remote.cpp
index 2a061f0947..0b2b7368d2 100644
--- a/core/script_debugger_remote.cpp
+++ b/core/script_debugger_remote.cpp
@@ -129,11 +129,14 @@ void ScriptDebuggerRemote::_save_node(ObjectID id, const String &p_path) {
ResourceSaver::save(p_path, ps);
}
-void ScriptDebuggerRemote::debug(ScriptLanguage *p_script, bool p_can_continue) {
+void ScriptDebuggerRemote::debug(ScriptLanguage *p_script, bool p_can_continue, bool p_is_error_breakpoint) {
//this function is called when there is a debugger break (bug on script)
//or when execution is paused from editor
+ if (skip_breakpoints && !p_is_error_breakpoint)
+ return;
+
ERR_FAIL_COND_MSG(!tcp_client->is_connected_to_host(), "Script Debugger failed to connect, but being used anyway.");
packet_peer_stream->put_var("debug_enter");
@@ -155,6 +158,7 @@ void ScriptDebuggerRemote::debug(ScriptLanguage *p_script, bool p_can_continue)
Variant var;
Error err = packet_peer_stream->get_var(var);
+
ERR_CONTINUE(err != OK);
ERR_CONTINUE(var.get_type() != Variant::ARRAY);
@@ -266,7 +270,6 @@ void ScriptDebuggerRemote::debug(ScriptLanguage *p_script, bool p_can_continue)
break;
} else if (command == "continue") {
-
set_depth(-1);
set_lines_left(-1);
OS::get_singleton()->move_window_to_foreground();
@@ -302,6 +305,8 @@ void ScriptDebuggerRemote::debug(ScriptLanguage *p_script, bool p_can_continue)
} else if (command == "save_node") {
_save_node(cmd[1], cmd[2]);
+ } else if (command == "set_skip_breakpoints") {
+ skip_breakpoints = cmd[1];
} else {
_parse_live_edit(cmd);
}
@@ -773,6 +778,8 @@ void ScriptDebuggerRemote::_poll_events() {
insert_breakpoint(cmd[2], cmd[1]);
else
remove_breakpoint(cmd[2], cmd[1]);
+ } else if (command == "set_skip_breakpoints") {
+ skip_breakpoints = cmd[1];
} else {
_parse_live_edit(cmd);
}
@@ -1102,6 +1109,10 @@ void ScriptDebuggerRemote::profiling_set_frame_times(float p_frame_time, float p
physics_frame_time = p_physics_frame_time;
}
+void ScriptDebuggerRemote::set_skip_breakpoints(bool p_skip_breakpoints) {
+ skip_breakpoints = p_skip_breakpoints;
+}
+
ScriptDebuggerRemote::ResourceUsageFunc ScriptDebuggerRemote::resource_usage_func = NULL;
ScriptDebuggerRemote::ScriptDebuggerRemote() :
diff --git a/core/script_debugger_remote.h b/core/script_debugger_remote.h
index a5bfd7a32d..34585afc80 100644
--- a/core/script_debugger_remote.h
+++ b/core/script_debugger_remote.h
@@ -140,6 +140,8 @@ class ScriptDebuggerRemote : public ScriptDebugger {
void _save_node(ObjectID id, const String &p_path);
+ bool skip_breakpoints;
+
public:
struct ResourceUsage {
@@ -156,7 +158,7 @@ public:
static ResourceUsageFunc resource_usage_func;
Error connect_to_host(const String &p_host, uint16_t p_port);
- virtual void debug(ScriptLanguage *p_script, bool p_can_continue = true);
+ virtual void debug(ScriptLanguage *p_script, bool p_can_continue = true, bool p_is_error_breakpoint = false);
virtual void idle_poll();
virtual void line_poll();
@@ -176,6 +178,8 @@ public:
virtual void profiling_end();
virtual void profiling_set_frame_times(float p_frame_time, float p_idle_time, float p_physics_time, float p_physics_frame_time);
+ virtual void set_skip_breakpoints(bool p_skip_breakpoints);
+
ScriptDebuggerRemote();
~ScriptDebuggerRemote();
};
diff --git a/core/script_language.h b/core/script_language.h
index 1b4f1eb4cd..5c7e8bb36c 100644
--- a/core/script_language.h
+++ b/core/script_language.h
@@ -467,7 +467,7 @@ public:
void clear_breakpoints();
const Map<int, Set<StringName> > &get_breakpoints() const { return breakpoints; }
- virtual void debug(ScriptLanguage *p_script, bool p_can_continue = true) = 0;
+ virtual void debug(ScriptLanguage *p_script, bool p_can_continue = true, bool p_is_error_breakpoint = false) = 0;
virtual void idle_poll();
virtual void line_poll();