mirror of
https://github.com/godotengine/godot.git
synced 2025-11-02 22:51:08 +00:00
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.
This commit is contained in:
parent
d0009636df
commit
b8ddaf9c33
48 changed files with 2748 additions and 2316 deletions
|
|
@ -221,12 +221,12 @@ Script *GDScriptLanguage::create_script() const {
|
|||
bool GDScriptLanguage::debug_break_parse(const String &p_file, int p_line, const String &p_error) {
|
||||
//break because of parse error
|
||||
|
||||
if (ScriptDebugger::get_singleton() && Thread::get_caller_id() == Thread::get_main_id()) {
|
||||
if (EngineDebugger::is_active() && Thread::get_caller_id() == Thread::get_main_id()) {
|
||||
|
||||
_debug_parse_err_line = p_line;
|
||||
_debug_parse_err_file = p_file;
|
||||
_debug_error = p_error;
|
||||
ScriptDebugger::get_singleton()->debug(this, false, true);
|
||||
EngineDebugger::get_script_debugger()->debug(this, false, true);
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
|
|
@ -235,13 +235,13 @@ bool GDScriptLanguage::debug_break_parse(const String &p_file, int p_line, const
|
|||
|
||||
bool GDScriptLanguage::debug_break(const String &p_error, bool p_allow_continue) {
|
||||
|
||||
if (ScriptDebugger::get_singleton() && Thread::get_caller_id() == Thread::get_main_id()) {
|
||||
if (EngineDebugger::is_active() && Thread::get_caller_id() == Thread::get_main_id()) {
|
||||
|
||||
_debug_parse_err_line = -1;
|
||||
_debug_parse_err_file = "";
|
||||
_debug_error = p_error;
|
||||
bool is_error_breakpoint = p_error != "Breakpoint";
|
||||
ScriptDebugger::get_singleton()->debug(this, p_allow_continue, is_error_breakpoint);
|
||||
EngineDebugger::get_script_debugger()->debug(this, p_allow_continue, is_error_breakpoint);
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue