Ability to print and log script backtraces

Co-authored-by: Mikael Hermansson <mikael@hermansson.io>
This commit is contained in:
reduz 2025-03-31 21:39:43 +02:00 committed by Mikael Hermansson
parent f704113abe
commit d1dcb40d56
32 changed files with 813 additions and 95 deletions

View file

@ -2942,17 +2942,14 @@ GDScriptLanguage::GDScriptLanguage() {
script_frame_time = 0;
#endif
int dmcs = GLOBAL_DEF(PropertyInfo(Variant::INT, "debug/settings/gdscript/max_call_stack", PROPERTY_HINT_RANGE, "512," + itos(GDScriptFunction::MAX_CALL_DEPTH - 1) + ",1"), 1024);
if (EngineDebugger::is_active()) {
//debugging enabled!
_debug_max_call_stack = dmcs;
} else {
_debug_max_call_stack = 0;
}
_debug_max_call_stack = GLOBAL_DEF_RST(PropertyInfo(Variant::INT, "debug/settings/gdscript/max_call_stack", PROPERTY_HINT_RANGE, "512," + itos(GDScriptFunction::MAX_CALL_DEPTH - 1) + ",1"), 1024);
track_call_stack = GLOBAL_DEF_RST("debug/settings/gdscript/always_track_call_stacks", false);
track_locals = GLOBAL_DEF_RST("debug/settings/gdscript/always_track_local_variables", false);
#ifdef DEBUG_ENABLED
track_call_stack = true;
track_locals = track_locals || EngineDebugger::is_active();
GLOBAL_DEF("debug/gdscript/warnings/enable", true);
GLOBAL_DEF("debug/gdscript/warnings/exclude_addons", true);
GLOBAL_DEF("debug/gdscript/warnings/renamed_in_godot_4_hint", true);