Unix implementation for the crash logger.
More...
|
jmp_buf | internal_fault_jmp_buf |
| Buffer to track the long jump set setup.
|
|
bool | try_execute_active = false |
| Whether we are in a TryExecute block.
|
|
nlohmann::json | survey |
|
std::string | crashlog_filename |
|
std::string | crashdump_filename |
|
std::string | savegame_filename |
|
std::string | screenshot_filename |
|
|
void | SurveyCrash (nlohmann::json &survey) const override |
| Convert system crash reason to JSON. More...
|
|
void | SurveyStacktrace ([[maybe_unused]] nlohmann::json &survey) const override |
|
bool | TryExecute (std::string_view section_name, std::function< bool()> &&func) override |
| Execute the func() and return its value. More...
|
|
|
int | signum |
| Signal that has been thrown.
|
|
|
static void | InitialiseCrashLog () |
| Initialiser for crash logs; do the appropriate things so crashes are handled by our crash handler instead of returning straight to the OS. More...
|
|
static void | InitThread () |
| Prepare crash log handler for a newly started thread. More...
|
|
static void | SetErrorMessage (const std::string &message) |
| Sets a message for the error message handler. More...
|
|
static void | AfterCrashLogCleanup () |
| Try to close the sound/video stuff so it doesn't keep lingering around incorrect video states or so, e.g. More...
|
|
std::string | CreateFileName (const char *ext, bool with_dir=true) const |
| Create a timestamped filename. More...
|
|
Unix implementation for the crash logger.
Definition at line 46 of file crashlog_unix.cpp.
◆ CrashLogUnix()
CrashLogUnix::CrashLogUnix |
( |
int |
signum | ) |
|
|
inline |
A crash log is always generated by signal.
- Parameters
-
signum | the signal that was caused by the crash. |
Definition at line 118 of file crashlog_unix.cpp.
◆ SurveyCrash()
void CrashLogUnix::SurveyCrash |
( |
nlohmann::json & |
survey | ) |
const |
|
inlineoverrideprivatevirtual |
◆ TryExecute()
bool CrashLogUnix::TryExecute |
( |
std::string_view |
section_name, |
|
|
std::function< bool()> && |
func |
|
) |
| |
|
inlineoverrideprivatevirtual |
Execute the func() and return its value.
If any exception / signal / crash happens, catch it and return false. This function should, in theory, never not return, even in the worst conditions.
- Parameters
-
section_name | The name of the section to be executed. Printed when a crash happens. |
func | The function to call. |
- Returns
- true iff the function returned true.
Implements CrashLog.
Definition at line 88 of file crashlog_unix.cpp.
References _signals_to_handle, internal_fault_jmp_buf, signum, and try_execute_active.
The documentation for this class was generated from the following file: