OpenTTD Source 20241224-master-gee860a5c8e
|
OS X crash log handler. More...
#include "../../stdafx.h"
#include "../../crashlog.h"
#include "../../fileio_func.h"
#include "../../string_func.h"
#include "../../gamelog.h"
#include "../../saveload/saveload.h"
#include "../../video/video_driver.hpp"
#include "macos.h"
#include <setjmp.h>
#include <signal.h>
#include <mach-o/arch.h>
#include <dlfcn.h>
#include <cxxabi.h>
#include <execinfo.h>
#include "../../safeguards.h"
Go to the source code of this file.
Data Structures | |
class | CrashLogOSX |
OSX implementation for the crash logger. More... | |
Macros | |
#define | IS_ALIGNED(addr) (((uintptr_t)(addr) & 0xf) == 0) |
#define | MAX_STACK_FRAMES 64 |
Functions | |
static sigset_t | SetSignals (void(*handler)(int)) |
Set a signal handler for all signals we want to capture. | |
static void CDECL | HandleInternalCrash (int) |
Entry point for a crash that happened during the handling of a crash. | |
static void CDECL | HandleCrash (int signum) |
Entry point for the crash handler. | |
Variables | |
static constexpr int | _signals_to_handle [] = { SIGSEGV, SIGABRT, SIGFPE, SIGBUS, SIGILL, SIGSYS, SIGQUIT } |
The signals we want our crash handler to handle. | |
OS X crash log handler.
Definition in file crashlog_osx.cpp.
#define IS_ALIGNED | ( | addr | ) | (((uintptr_t)(addr) & 0xf) == 0) |
Definition at line 37 of file crashlog_osx.cpp.
#define MAX_STACK_FRAMES 64 |
Definition at line 40 of file crashlog_osx.cpp.
|
static |
Entry point for the crash handler.
signum | the signal that caused us to crash. |
Definition at line 196 of file crashlog_osx.cpp.
References _gamelog, CrashLog::AfterCrashLogCleanup(), CrashLogOSX::current, CrashLogOSX::DisplayCrashDialog(), VideoDriver::GetInstance(), HandleInternalCrash(), CrashLog::MakeCrashLog(), SaveloadCrashWithMissingNewGRFs(), SetSignals(), ShowMacDialog(), and Gamelog::TestEmergency().
Referenced by CrashLog::InitialiseCrashLog().
|
static |
Entry point for a crash that happened during the handling of a crash.
Definition at line 181 of file crashlog_osx.cpp.
References CrashLogOSX::current.
Referenced by HandleCrash().
|
static |
Set a signal handler for all signals we want to capture.
handler | The handler to use. |
Definition at line 154 of file crashlog_osx.cpp.
References _signals_to_handle.
Referenced by HandleCrash(), and CrashLog::InitialiseCrashLog().
|
staticconstexpr |
The signals we want our crash handler to handle.
Definition at line 43 of file crashlog_osx.cpp.
Referenced by SetSignals(), and CrashLogOSX::TryExecute().