From b8ddaf9c33107e01928e04ed462aa08d4017247b Mon Sep 17 00:00:00 2001 From: Fabio Alessandrelli Date: Thu, 27 Feb 2020 03:30:20 +0100 Subject: Refactor ScriptDebugger. EngineDebugger is the new interface to access the debugger. It tries to be as agnostic as possible on the data that various subsystems can expose. It allows 2 types of interactions: - Profilers: A subsystem can register a profiler, assigning it a unique name. That name can be used to activate the profiler or add data to it. The registered profiler can be composed of up to 3 functions: - Toggle: called when the profiler is activated/deactivated. - Add: called whenever data is added to the debugger (via `EngineDebugger::profiler_add_frame_data`) - Tick: called every frame (during idle), receives frame times. - Captures: (Only relevant in remote debugger for now) A subsystem can register a capture, assigning it a unique name. When receiving a message, the remote debugger will check if it starts with `[prefix]:` and call the associated capture with name `prefix`. Port MultiplayerAPI, Servers, Scripts, Visual, Performance to the new profiler system. Port SceneDebugger and RemoteDebugger to the new capture system. The LocalDebugger also uses the new profiler system for scripts profiling. --- core/script_language.h | 63 ++++---------------------------------------------- 1 file changed, 5 insertions(+), 58 deletions(-) (limited to 'core/script_language.h') diff --git a/core/script_language.h b/core/script_language.h index 48570ae546..f1b809425b 100644 --- a/core/script_language.h +++ b/core/script_language.h @@ -350,6 +350,11 @@ public: virtual void thread_exit() {} /* DEBUGGER FUNCTIONS */ + struct StackInfo { + String file; + String func; + int line; + }; virtual String debug_get_error() const = 0; virtual int debug_get_stack_level_count() const = 0; @@ -362,12 +367,6 @@ public: virtual void debug_get_globals(List *p_globals, List *p_values, int p_max_subitems = -1, int p_max_depth = -1) = 0; virtual String debug_parse_stack_level_expression(int p_level, const String &p_expression, int p_max_subitems = -1, int p_max_depth = -1) = 0; - struct StackInfo { - String file; - String func; - int line; - }; - virtual Vector debug_get_current_stack_info() { return Vector(); } virtual void reload_all_scripts() = 0; @@ -460,56 +459,4 @@ public: PlaceHolderScriptInstance(ScriptLanguage *p_language, Ref