Native crash logging functions.
Static variables
Static methods
staticget_backtrace(handle:CrashHandle):Table<Int, String>
Read backtrace recorded in a loaded crash dump.
A table is returned containing the addresses of the call stack.
Parameters:
handle | crash dump handle |
---|
Returns:
backtrace table containing the backtrace
staticget_extra_data(handle:CrashHandle):String
Read text blob recorded in a crash dump.
The format of read text blob is platform specific and not guaranteed but can be useful for manual inspection.
Parameters:
handle | crash dump handle |
---|
Returns:
blob string with the platform specific data
staticget_modules(handle:CrashHandle):Table<Int, {name:String, address:String}>
Get all loaded modules from when the crash occured.
The function returns a table containing entries with sub-tables that have fields 'name' and 'address' set for all loaded modules.
Parameters:
handle | crash dump handle |
---|
Returns:
modules module table
staticget_signum(handle:CrashHandle):Int
Read signal number from a crash report.
Parameters:
handle | crash dump handle |
---|
Returns:
signal signal number
staticget_sys_field(handle:CrashHandle, index:CrashSysField):Null<String>
Reads a system field from a loaded crash dump.
Parameters:
handle | crash dump handle |
---|---|
index | system field enum. Must be less than |
Returns:
value recorded in the crash dump, or nil if it didn't exist
staticget_user_field(handle:CrashHandle, index:Int):String
Reads user field from a loaded crash dump.
Parameters:
handle | crash dump handle |
---|---|
index | user data slot index |
Returns:
user data value recorded in the crash dump
staticload_previous():Null<CrashHandle>
Loads a previously written crash dump.
The crash dump will be removed from disk upon a successful load, so loading is one-shot.
Returns:
handle handle to the loaded dump, or nil if no dump was found.
staticrelease(handle:CrashHandle):Void
Releases a previously loaded crash dump.
Parameters:
handle | handle to loaded crash dump |
---|
staticset_file_path(path:String):Void
Sets the file location for crash dumps.
Crashes occuring before the path is set will be stored to a default engine location.
Parameters:
path | file path to use |
---|
staticset_user_field(index:Int, value:String):Void
Stores user-defined string value.
Store a user value that will get written to a crash dump when a crash occurs. This can be user ids, breadcrumb data etc.
There are 32 slots indexed from 0. Each slot stores at most 255 characters.
Parameters:
index | slot index. 0-indexed. |
---|---|
value | string value to store |
staticwrite_dump():Void
Writes crash dump.
Performs the same steps as if a crash had just occured but allows the program to continue.
The generated dump can be read by Crash.load_previous
.