mirror of
https://github.com/godotengine/godot.git
synced 2025-10-19 16:03:29 +00:00
Improve script backtrace print in crash handlers
Also fix the editor crash handler message for bug reports not properly using the `.editor` override.
This commit is contained in:
parent
6a6a1168a5
commit
a6398d71a3
4 changed files with 24 additions and 40 deletions
|
@ -67,9 +67,8 @@ static void handle_crash(int sig) {
|
|||
String _execpath = OS::get_singleton()->get_executable_path();
|
||||
|
||||
String msg;
|
||||
const ProjectSettings *proj_settings = ProjectSettings::get_singleton();
|
||||
if (proj_settings) {
|
||||
msg = proj_settings->get("debug/settings/crash_handler/message");
|
||||
if (ProjectSettings::get_singleton()) {
|
||||
msg = GLOBAL_GET("debug/settings/crash_handler/message");
|
||||
}
|
||||
|
||||
// Tell MainLoop about the crash. This can be handled by users too in Node.
|
||||
|
@ -144,21 +143,18 @@ static void handle_crash(int sig) {
|
|||
|
||||
free(strings);
|
||||
}
|
||||
print_error("-- END OF BACKTRACE --");
|
||||
print_error("-- END OF C++ BACKTRACE --");
|
||||
print_error("================================================================");
|
||||
|
||||
Vector<Ref<ScriptBacktrace>> script_backtraces;
|
||||
if (ScriptServer::are_languages_initialized()) {
|
||||
script_backtraces = ScriptServer::capture_script_backtraces(false);
|
||||
}
|
||||
if (!script_backtraces.is_empty()) {
|
||||
Vector<Ref<ScriptBacktrace>> script_backtraces = ScriptServer::capture_script_backtraces(false);
|
||||
for (const Ref<ScriptBacktrace> &backtrace : script_backtraces) {
|
||||
if (!backtrace->is_empty()) {
|
||||
print_error(backtrace->format());
|
||||
print_error(vformat("-- END OF %s BACKTRACE --", backtrace->get_language_name().to_upper()));
|
||||
print_error("================================================================");
|
||||
}
|
||||
}
|
||||
print_error("-- END OF SCRIPT BACKTRACE --");
|
||||
print_error("================================================================");
|
||||
}
|
||||
|
||||
// Abort to pass the error to the OS
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue