CrashHandler Class Reference

#include <crashhandler.h>

Detailed Description

Private custom crash handler.

Public Types

using CallbackPtr = void(*)(const CrashReportState &crashState)
 

Public Member Functions

 MAXON_OBSERVABLE_STATIC (void, ObservableCrashDataDirectory,(const Url &dataDirectory), ObservableCombinerRunAllComponent)
 

Static Public Member Functions

static MAXON_METHOD Bool SetCallback (CallbackPtr callback)
 
static MAXON_METHOD Bool SetSecondaryCallback (CallbackPtr callback)
 
static MAXON_METHOD Result< void > SetCrashDataDirectory (const Url &dataDirectory)
 
static MAXON_METHOD void DisplayCrashDialog (const String &title, const String &message)
 
static MAXON_METHOD Result< void > GetProcessModules (WritableArrayInterface< CrashModuleEntry > &modules)
 
static MAXON_METHOD Result< void > ResolveBugReport (const Url &report, const Url &symbolFileArchives, const Url &temporaryDir)
 

Private Member Functions

 MAXON_INTERFACE_NONVIRTUAL (CrashHandler, MAXON_REFERENCE_NONE, "net.maxon.interface.crashhandler")
 

Member Typedef Documentation

◆ CallbackPtr

using CallbackPtr = void (*)(const CrashReportState& crashState)

Member Function Documentation

◆ MAXON_INTERFACE_NONVIRTUAL()

MAXON_INTERFACE_NONVIRTUAL ( CrashHandler  ,
MAXON_REFERENCE_NONE  ,
"net.maxon.interface.crashhandler"   
)
private

◆ SetCallback()

static MAXON_METHOD Bool SetCallback ( CallbackPtr  callback)
static

Sets a callback that will be invoked when a thread has crashed. Usually the callback should dump the register and callstack information and whatever else it deems important to a file. After the callback returns the application will usually quit.

Parameters
[in]callbackFunction to be invoked when a thread has crashed.
Returns
True if crash handler callback was set, false if crash handling is disabled.

◆ SetSecondaryCallback()

static MAXON_METHOD Bool SetSecondaryCallback ( CallbackPtr  callback)
static

This callback is invoked after the primary crash callback and can be used to dump optional data, for example an OpenGL trace.

Parameters
[in]callbackFunction to be invoked when a thread has crashed.
Returns
True if crash handler callback was set, false if crash handling is disabled.

◆ SetCrashDataDirectory()

static MAXON_METHOD Result<void> SetCrashDataDirectory ( const Url dataDirectory)
static

Sets a directory which is used to store crash relevant data, for example OS specific dumps, log files or recovered documents.

Parameters
[in]dataDirectoryThe path of a directory which will be used to store additional crash relevant data.
Returns
OK on success.

◆ DisplayCrashDialog()

static MAXON_METHOD void DisplayCrashDialog ( const String title,
const String message 
)
static

Displays a crash safe dialog with one button (OK).

Parameters
[in]titleDialog title.
[in]messageDialog text (use
to seperate lines).

◆ GetProcessModules()

static MAXON_METHOD Result<void> GetProcessModules ( WritableArrayInterface< CrashModuleEntry > &  modules)
static

This method is for diagnostic purposes. In a crash case using the generic ArrayInterface could be problematic.

Parameters
[out]modulesModule informationDialog title.
Returns
OK on success.

◆ ResolveBugReport()

static MAXON_METHOD Result<void> ResolveBugReport ( const Url report,
const Url symbolFileArchives,
const Url temporaryDir 
)
static

Resolves the addresses in a bug report and saves a file containing symbol and file information to the same location as the bug report. The symbol archive files are expected to be stored in a three level hierarchy. On the first level the directories have the (arbitrary) name of the branch and on the second level the arbitrary name must contain the build number of each corresponding build. On the third level is a directory named "builds" which contains a zip with the symbol file archive. The symbol file archive conforms to the naming scheme buildId plus "_dsym.zip" or "_pdb64.zip", for example "MA93302_dsym.izp" or "RC79244_pdb64.zip". If symbolFileArchives is empty the value of the configuration variable g_symbolArchiveFolder is used and if temporaryDir is empty g_symbolTemporaryFolder is used.

Parameters
[in]reportThe bug report file.
[in]symbolFileArchivesThe path of the symbolFileArchives.
[in]temporaryDirThe path of a temporary directory to unpack the archives.
Returns
OK on success.

◆ MAXON_OBSERVABLE_STATIC()

MAXON_OBSERVABLE_STATIC ( void  ,
ObservableCrashDataDirectory  ,
(const Url &dataDirectory)  ,
ObservableCombinerRunAllComponent   
)

Invokes the observer(s) with the url of the crash data directory.