OpenTTD

Public Member Functions | Private Member Functions | Private Attributes
CrashLogOSX Class Reference

OSX implementation for the crash logger. More...

Inheritance diagram for CrashLogOSX:

## Public Member Functions
| CrashLogOSX (int signum)
| A crash log is always generated by signal. More...
bool | MakeCrashLog ()
| Generate the crash log. More...
void | DisplayCrashDialog () const
| Show a dialog with the crash information. More...
Public Member Functions inherited from CrashLog
virtual | ~CrashLog ()
| Stub destructor to silence some compilers. More...
char * | FillCrashLog (char *buffer, const char *last) const
| Fill the crash log buffer with all data of a crash log. More...
bool | WriteCrashLog (const char *buffer, char *filename, const char *filename_last) const
| Write the crash log to a file. More...
virtual int | WriteCrashDump (char *filename, const char *filename_last) const
| Write the (crash) dump to a file. More...
bool | WriteSavegame (char *filename, const char *filename_last) const
| Write the (crash) savegame to a file. More...
bool | WriteScreenshot (char *filename, const char *filename_last) const
| Write the (crash) screenshot to a file. More...
bool | MakeCrashLog () const
| Makes the crash log, writes it to a file and then subsequently tries to make a crash dump and crash savegame. More...

## Private Member Functions
char * | LogOSVersion (char *buffer, const char *last) const
| Writes OS' version to the buffer. More...
char * | LogError (char *buffer, const char *last, const char *message) const
| Writes actually encountered error to the buffer. More...
char * | LogStacktrace (char *buffer, const char *last) const
| Writes the stack trace to the buffer, if there is information about it available. More...

## Private Attributes
int | signum
| Signal that has been thrown. More...
char | filename_log [MAX_PATH]
| Path of crash.log.
char | filename_save [MAX_PATH]
| Path of crash.sav.
char | filename_screenshot [MAX_PATH]
| Path of crash.(png|bmp|pcx)

## Additional Inherited Members
Static Public Member Functions inherited from CrashLog
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 | SetErrorMessage (const char *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...
Protected Member Functions inherited from CrashLog
virtual char * | LogCompiler (char *buffer, const char *last) const
| Writes compiler (and its version, if available) to the buffer. More...
virtual char * | LogRegisters (char *buffer, const char *last) const
| Writes information about the data in the registers, if there is information about it available. More...
virtual char * | LogModules (char *buffer, const char *last) const
| Writes the dynamically linked libraries/modules to the buffer, if there is information about it available. More...
char * | LogOpenTTDVersion (char *buffer, const char *last) const
| Writes OpenTTD's version to the buffer. More...
char * | LogConfiguration (char *buffer, const char *last) const
| Writes the (important) configuration settings to the buffer. More...
char * | LogLibraries (char *buffer, const char *last) const
| Writes information (versions) of the used libraries. More...
char * | LogGamelog (char *buffer, const char *last) const
| Writes the gamelog data to the buffer. More...

## Detailed Description

OSX implementation for the crash logger.

Definition at line 47 of file crashlog_osx.cpp.

## Constructor & Destructor Documentation

## ◆ CrashLogOSX()

CrashLogOSX::CrashLogOSX | ( | int | signum | ) |
| inline

A crash log is always generated by signal.

Parameters

  signum | the signal that was caused by the crash.

Definition at line 158 of file crashlog_osx.cpp.

## Member Function Documentation

## ◆ DisplayCrashDialog()

void CrashLogOSX::DisplayCrashDialog | ( |  | ) | const
| inline

Show a dialog with the crash information.

Definition at line 198 of file crashlog_osx.cpp.

References lastof, CrashLog::message, seprintf(), and ShowMacDialog().

Referenced by HandleCrash().

## ◆ LogError()

char* CrashLogOSX::LogError | ( | char * | buffer,
|  | const char * | last,
|  | const char * | message
| ) |  | const
| inline private virtual

Writes actually encountered error to the buffer.

Parameters

  buffer | The begin where to write at.
  last | The last position in the buffer to write to.
  message | Message passed to use for possible errors. Can be NULL.

Returns
  the position of the `'\0'` character after the buffer.

Implements CrashLog.

Definition at line 74 of file crashlog_osx.cpp.

References seprintf().

## ◆ LogOSVersion()

char* CrashLogOSX::LogOSVersion | ( | char * | buffer,
|  | const char * | last
| ) |  | const
| inline private virtual

Writes OS' version to the buffer.

Parameters

  buffer | The begin where to write at.
  last | The last position in the buffer to write to.

Returns
  the position of the `'\0'` character after the buffer.

Implements CrashLog.

Definition at line 55 of file crashlog_osx.cpp.

## ◆ LogStacktrace()

char* CrashLogOSX::LogStacktrace | ( | char * | buffer,
|  | const char * | last
| ) |  | const
| inline private virtual

Writes the stack trace to the buffer, if there is information about it available.

Parameters

  buffer | The begin where to write at.
  last | The last position in the buffer to write to.

Returns
  the position of the `'\0'` character after the buffer.

Implements CrashLog.

Definition at line 86 of file crashlog_osx.cpp.

References seprintf().

## ◆ MakeCrashLog()

bool CrashLogOSX::MakeCrashLog | ( |  | ) |
| inline

Generate the crash log.

Definition at line 166 of file crashlog_osx.cpp.

References CrashLog::FillCrashLog(), lastof, CrashLog::WriteCrashLog(), CrashLog::WriteSavegame(), and CrashLog::WriteScreenshot().

Referenced by HandleCrash().

## Field Documentation

## ◆ signum

int CrashLogOSX::signum
| private

Signal that has been thrown.

Definition at line 49 of file crashlog_osx.cpp.

The documentation for this class was generated from the following file:

- src/os/macosx/crashlog_osx.cpp