Output a log, savegame and screenshot on desync events

This commit is contained in:
Jonathan G Rennison
2019-05-17 18:55:45 +01:00
parent 3fdd553a08
commit fa55a1c002
7 changed files with 139 additions and 9 deletions

View File

@@ -517,6 +517,8 @@ class CrashLogUnix : public CrashLog {
#endif
public:
struct DesyncTag {};
/**
* A crash log is always generated by signal.
* @param signum the signal that was caused by the crash.
@@ -544,6 +546,15 @@ public:
{
}
#endif /* WITH_SIGACTION */
CrashLogUnix(DesyncTag tag) : signum(0)
{
#ifdef WITH_SIGACTION
this->si = nullptr;
this->context = nullptr;
this->signal_instruction_ptr_valid = false;
#endif
}
};
/** The signals we want our crash handler to handle. */
@@ -608,3 +619,9 @@ static void CDECL HandleCrash(int signum)
#endif
}
}
/* static */ void CrashLog::DesyncCrashLog()
{
CrashLogUnix log(CrashLogUnix::DesyncTag{});
log.MakeDesyncCrashLog();
}