summaryrefslogtreecommitdiff
path: root/core/debugger
diff options
context:
space:
mode:
Diffstat (limited to 'core/debugger')
-rw-r--r--core/debugger/SCsub2
-rw-r--r--core/debugger/debugger_marshalls.cpp4
-rw-r--r--core/debugger/debugger_marshalls.h4
-rw-r--r--core/debugger/engine_debugger.cpp10
-rw-r--r--core/debugger/engine_debugger.h14
-rw-r--r--core/debugger/local_debugger.cpp2
-rw-r--r--core/debugger/local_debugger.h2
-rw-r--r--core/debugger/remote_debugger.cpp39
-rw-r--r--core/debugger/remote_debugger.h8
-rw-r--r--core/debugger/remote_debugger_peer.cpp4
-rw-r--r--core/debugger/remote_debugger_peer.h2
-rw-r--r--core/debugger/script_debugger.h4
12 files changed, 48 insertions, 47 deletions
diff --git a/core/debugger/SCsub b/core/debugger/SCsub
index 1c5f954470..19a6549225 100644
--- a/core/debugger/SCsub
+++ b/core/debugger/SCsub
@@ -1,5 +1,5 @@
#!/usr/bin/env python
-Import('env')
+Import("env")
env.add_source_files(env.core_sources, "*.cpp")
diff --git a/core/debugger/debugger_marshalls.cpp b/core/debugger/debugger_marshalls.cpp
index eb3a19506a..410c55129d 100644
--- a/core/debugger/debugger_marshalls.cpp
+++ b/core/debugger/debugger_marshalls.cpp
@@ -227,7 +227,7 @@ Array DebuggerMarshalls::ScriptStackVariable::serialize(int max_size) {
}
int len = 0;
- Error err = encode_variant(var, NULL, len, true);
+ Error err = encode_variant(var, nullptr, len, true);
if (err != OK)
ERR_PRINT("Failed to encode variant.");
@@ -317,7 +317,7 @@ bool DebuggerMarshalls::VisualProfilerFrame::deserialize(const Array &p_arr) {
CHECK_SIZE(p_arr, size, "VisualProfilerFrame");
int idx = 2;
areas.resize(size / 3);
- VS::FrameProfileArea *w = areas.ptrw();
+ RS::FrameProfileArea *w = areas.ptrw();
for (int i = 0; i < size / 3; i++) {
w[i].name = p_arr[idx];
w[i].cpu_msec = p_arr[idx + 1];
diff --git a/core/debugger/debugger_marshalls.h b/core/debugger/debugger_marshalls.h
index 4c15adc555..04229c0afc 100644
--- a/core/debugger/debugger_marshalls.h
+++ b/core/debugger/debugger_marshalls.h
@@ -32,7 +32,7 @@
#define DEBUGGER_MARSHARLLS_H
#include "core/script_language.h"
-#include "servers/visual_server.h"
+#include "servers/rendering_server.h"
struct DebuggerMarshalls {
@@ -165,7 +165,7 @@ struct DebuggerMarshalls {
// Visual Profiler
struct VisualProfilerFrame {
uint64_t frame_number;
- Vector<VS::FrameProfileArea> areas;
+ Vector<RS::FrameProfileArea> areas;
Array serialize();
bool deserialize(const Array &p_arr);
diff --git a/core/debugger/engine_debugger.cpp b/core/debugger/engine_debugger.cpp
index c64d886800..bfe38d0f4a 100644
--- a/core/debugger/engine_debugger.cpp
+++ b/core/debugger/engine_debugger.cpp
@@ -35,8 +35,8 @@
#include "core/debugger/script_debugger.h"
#include "core/os/os.h"
-EngineDebugger *EngineDebugger::singleton = NULL;
-ScriptDebugger *EngineDebugger::script_debugger = NULL;
+EngineDebugger *EngineDebugger::singleton = nullptr;
+ScriptDebugger *EngineDebugger::script_debugger = nullptr;
Map<StringName, EngineDebugger::Profiler> EngineDebugger::profilers;
Map<StringName, EngineDebugger::Capture> EngineDebugger::captures;
@@ -173,7 +173,7 @@ void EngineDebugger::deinitialize() {
singleton->poll_events(false);
memdelete(singleton);
- singleton = NULL;
+ singleton = nullptr;
profilers.clear();
captures.clear();
}
@@ -181,6 +181,6 @@ void EngineDebugger::deinitialize() {
EngineDebugger::~EngineDebugger() {
if (script_debugger)
memdelete(script_debugger);
- script_debugger = NULL;
- singleton = NULL;
+ script_debugger = nullptr;
+ singleton = nullptr;
}
diff --git a/core/debugger/engine_debugger.h b/core/debugger/engine_debugger.h
index 9e01aeba18..7b6b77ca9b 100644
--- a/core/debugger/engine_debugger.h
+++ b/core/debugger/engine_debugger.h
@@ -50,10 +50,10 @@ public:
class Profiler {
friend class EngineDebugger;
- ProfilingToggle toggle = NULL;
- ProfilingAdd add = NULL;
- ProfilingTick tick = NULL;
- void *data = NULL;
+ ProfilingToggle toggle = nullptr;
+ ProfilingAdd add = nullptr;
+ ProfilingTick tick = nullptr;
+ void *data = nullptr;
bool active = false;
public:
@@ -69,8 +69,8 @@ public:
class Capture {
friend class EngineDebugger;
- CaptureFunc capture = NULL;
- void *data = NULL;
+ CaptureFunc capture = nullptr;
+ void *data = nullptr;
public:
Capture() {}
@@ -97,7 +97,7 @@ protected:
public:
_FORCE_INLINE_ static EngineDebugger *get_singleton() { return singleton; }
- _FORCE_INLINE_ static bool is_active() { return singleton != NULL && script_debugger != NULL; }
+ _FORCE_INLINE_ static bool is_active() { return singleton != nullptr && script_debugger != nullptr; }
_FORCE_INLINE_ static ScriptDebugger *get_script_debugger() { return script_debugger; };
diff --git a/core/debugger/local_debugger.cpp b/core/debugger/local_debugger.cpp
index 01e30fb621..6d88ceb2c1 100644
--- a/core/debugger/local_debugger.cpp
+++ b/core/debugger/local_debugger.cpp
@@ -402,7 +402,7 @@ LocalDebugger::LocalDebugger() {
[](void *p_user, bool p_enable, const Array &p_opts) {
((ScriptsProfiler *)p_user)->toggle(p_enable, p_opts);
},
- NULL,
+ nullptr,
[](void *p_user, float p_frame_time, float p_idle_time, float p_physics_time, float p_physics_frame_time) {
((ScriptsProfiler *)p_user)->tick(p_frame_time, p_idle_time, p_physics_time, p_physics_frame_time);
});
diff --git a/core/debugger/local_debugger.h b/core/debugger/local_debugger.h
index e299df0546..2c4302f4da 100644
--- a/core/debugger/local_debugger.h
+++ b/core/debugger/local_debugger.h
@@ -40,7 +40,7 @@ class LocalDebugger : public EngineDebugger {
private:
struct ScriptsProfiler;
- ScriptsProfiler *scripts_profiler = NULL;
+ ScriptsProfiler *scripts_profiler = nullptr;
String target_function;
Map<String, String> options;
diff --git a/core/debugger/remote_debugger.cpp b/core/debugger/remote_debugger.cpp
index 5f7ffb115c..e6bcc5f77e 100644
--- a/core/debugger/remote_debugger.cpp
+++ b/core/debugger/remote_debugger.cpp
@@ -33,11 +33,12 @@
#include "core/debugger/debugger_marshalls.h"
#include "core/debugger/engine_debugger.h"
#include "core/debugger/script_debugger.h"
-#include "core/os/input.h"
+#include "core/input/input_filter.h"
#include "core/os/os.h"
#include "core/project_settings.h"
#include "core/script_language.h"
#include "scene/main/node.h"
+#include "servers/display_server.h"
template <typename T>
void RemoteDebugger::_bind_profiler(const String &p_name, T *p_prof) {
@@ -317,7 +318,7 @@ struct RemoteDebugger::ServersProfiler {
void _send_frame_data(bool p_final) {
DebuggerMarshalls::ServersProfilerFrame frame;
- frame.frame_number = Engine::get_singleton()->get_frames_drawn();
+ frame.frame_number = Engine::get_singleton()->get_idle_frames();
frame.frame_time = frame_time;
frame.idle_time = idle_time;
frame.physics_time = physics_time;
@@ -353,18 +354,18 @@ struct RemoteDebugger::VisualProfiler {
Map<StringName, ServerInfo> server_data;
void toggle(bool p_enable, const Array &p_opts) {
- VS::get_singleton()->set_frame_profiling_enabled(p_enable);
+ RS::get_singleton()->set_frame_profiling_enabled(p_enable);
}
void add(const Array &p_data) {}
void tick(float p_frame_time, float p_idle_time, float p_physics_time, float p_physics_frame_time) {
- Vector<VS::FrameProfileArea> profile_areas = VS::get_singleton()->get_frame_profile();
+ Vector<RS::FrameProfileArea> profile_areas = RS::get_singleton()->get_frame_profile();
DebuggerMarshalls::VisualProfilerFrame frame;
if (!profile_areas.size())
return;
- frame.frame_number = VS::get_singleton()->get_frame_profile_frame();
+ frame.frame_number = RS::get_singleton()->get_frame_profile_frame();
frame.areas.append_array(profile_areas);
EngineDebugger::get_singleton()->send_message("visual:profile_frame", frame.serialize());
}
@@ -372,7 +373,7 @@ struct RemoteDebugger::VisualProfiler {
struct RemoteDebugger::PerformanceProfiler {
- Object *performance = NULL;
+ Object *performance = nullptr;
int last_perf_time = 0;
void toggle(bool p_enable, const Array &p_opts) {}
@@ -403,10 +404,10 @@ void RemoteDebugger::_send_resource_usage() {
DebuggerMarshalls::ResourceUsage usage;
- List<VS::TextureInfo> tinfo;
- VS::get_singleton()->texture_debug_usage(&tinfo);
+ List<RS::TextureInfo> tinfo;
+ RS::get_singleton()->texture_debug_usage(&tinfo);
- for (List<VS::TextureInfo>::Element *E = tinfo.front(); E; E = E->next()) {
+ for (List<RS::TextureInfo>::Element *E = tinfo.front(); E; E = E->next()) {
DebuggerMarshalls::ResourceInfo info;
info.path = E->get().path;
@@ -658,9 +659,9 @@ void RemoteDebugger::debug(bool p_can_continue, bool p_is_error_breakpoint) {
servers_profiler->skip_profile_frame = true; // Avoid frame time spike in debug.
- Input::MouseMode mouse_mode = Input::get_singleton()->get_mouse_mode();
- if (mouse_mode != Input::MOUSE_MODE_VISIBLE)
- Input::get_singleton()->set_mouse_mode(Input::MOUSE_MODE_VISIBLE);
+ InputFilter::MouseMode mouse_mode = InputFilter::get_singleton()->get_mouse_mode();
+ if (mouse_mode != InputFilter::MOUSE_MODE_VISIBLE)
+ InputFilter::get_singleton()->set_mouse_mode(InputFilter::MOUSE_MODE_VISIBLE);
uint64_t loop_begin_usec = 0;
uint64_t loop_time_sec = 0;
@@ -694,7 +695,7 @@ void RemoteDebugger::debug(bool p_can_continue, bool p_is_error_breakpoint) {
} else if (command == "continue") {
script_debugger->set_depth(-1);
script_debugger->set_lines_left(-1);
- OS::get_singleton()->move_window_to_foreground();
+ DisplayServer::get_singleton()->window_move_to_foreground();
break;
} else if (command == "break") {
@@ -770,16 +771,16 @@ void RemoteDebugger::debug(bool p_can_continue, bool p_is_error_breakpoint) {
// This is for the camera override to stay live even when the game is paused from the editor
loop_time_sec = (OS::get_singleton()->get_ticks_usec() - loop_begin_usec) / 1000000.0f;
- VisualServer::get_singleton()->sync();
- if (VisualServer::get_singleton()->has_changed()) {
- VisualServer::get_singleton()->draw(true, loop_time_sec * Engine::get_singleton()->get_time_scale());
+ RenderingServer::get_singleton()->sync();
+ if (RenderingServer::get_singleton()->has_changed()) {
+ RenderingServer::get_singleton()->draw(true, loop_time_sec * Engine::get_singleton()->get_time_scale());
}
}
send_message("debug_exit", Array());
- if (mouse_mode != Input::MOUSE_MODE_VISIBLE)
- Input::get_singleton()->set_mouse_mode(mouse_mode);
+ if (mouse_mode != InputFilter::MOUSE_MODE_VISIBLE)
+ InputFilter::get_singleton()->set_mouse_mode(mouse_mode);
}
void RemoteDebugger::poll_events(bool p_is_idle) {
@@ -866,7 +867,7 @@ RemoteDebugger *RemoteDebugger::create_for_uri(const String &p_uri) {
Ref<RemoteDebuggerPeer> peer = RemoteDebuggerPeer::create_from_uri(p_uri);
if (peer.is_valid())
return memnew(RemoteDebugger(peer));
- return NULL;
+ return nullptr;
}
RemoteDebugger::RemoteDebugger(Ref<RemoteDebuggerPeer> p_peer) {
diff --git a/core/debugger/remote_debugger.h b/core/debugger/remote_debugger.h
index 83789c67f9..f805eec631 100644
--- a/core/debugger/remote_debugger.h
+++ b/core/debugger/remote_debugger.h
@@ -50,10 +50,10 @@ private:
struct VisualProfiler;
struct PerformanceProfiler;
- NetworkProfiler *network_profiler = NULL;
- ServersProfiler *servers_profiler = NULL;
- VisualProfiler *visual_profiler = NULL;
- PerformanceProfiler *performance_profiler = NULL;
+ NetworkProfiler *network_profiler = nullptr;
+ ServersProfiler *servers_profiler = nullptr;
+ VisualProfiler *visual_profiler = nullptr;
+ PerformanceProfiler *performance_profiler = nullptr;
Ref<RemoteDebuggerPeer> peer;
diff --git a/core/debugger/remote_debugger_peer.cpp b/core/debugger/remote_debugger_peer.cpp
index 42c2c8e309..ed04431177 100644
--- a/core/debugger/remote_debugger_peer.cpp
+++ b/core/debugger/remote_debugger_peer.cpp
@@ -68,7 +68,7 @@ void RemoteDebuggerPeerTCP::close() {
running = false;
Thread::wait_to_finish(thread);
memdelete(thread);
- thread = NULL;
+ thread = nullptr;
}
tcp_client->disconnect_from_host();
out_buf.resize(0);
@@ -106,7 +106,7 @@ void RemoteDebuggerPeerTCP::_write_out() {
out_queue.pop_front();
mutex.unlock();
int size = 0;
- Error err = encode_variant(var, NULL, size);
+ Error err = encode_variant(var, nullptr, size);
ERR_CONTINUE(err != OK || size > out_buf.size() - 4); // 4 bytes separator.
encode_uint32(size, buf);
encode_variant(var, buf + 4, size);
diff --git a/core/debugger/remote_debugger_peer.h b/core/debugger/remote_debugger_peer.h
index 6fc3214a51..e4b838f145 100644
--- a/core/debugger/remote_debugger_peer.h
+++ b/core/debugger/remote_debugger_peer.h
@@ -58,7 +58,7 @@ class RemoteDebuggerPeerTCP : public RemoteDebuggerPeer {
private:
Ref<StreamPeerTCP> tcp_client;
Mutex mutex;
- Thread *thread = NULL;
+ Thread *thread = nullptr;
List<Array> in_queue;
List<Array> out_queue;
int out_left = 0;
diff --git a/core/debugger/script_debugger.h b/core/debugger/script_debugger.h
index 2273073bf4..e5066273d2 100644
--- a/core/debugger/script_debugger.h
+++ b/core/debugger/script_debugger.h
@@ -47,7 +47,7 @@ class ScriptDebugger {
Map<int, Set<StringName>> breakpoints;
- ScriptLanguage *break_lang = NULL;
+ ScriptLanguage *break_lang = nullptr;
Vector<StackInfo> error_stack_info;
public:
@@ -77,4 +77,4 @@ public:
ScriptDebugger() {}
};
-#endif
+#endif // SCRIPT_DEBUGGER_H