• Native crash logging functions.

Static variables

@:native("SYSFIELD_MAX")staticread onlySysFieldMax:Int

  • The max number of sysfields.

@:native("USERFIELD_MAX")staticread onlyUserFieldMax:Int

  • The max number of user fields.

@:native("USERFIELD_SIZE")staticread onlyUserFieldSize:Int

  • The max size of a single user field.

Static methods

@:native("get_backtrace")staticgetBacktrace(handle:CrashHandle):LuaArray<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

@:native("get_extra_data")staticgetExtraData(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

@:native("get_modules")staticgetModules(handle:CrashHandle):LuaArray<{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

@:native("get_signum")staticgetSignum(handle:CrashHandle):Int

  • Read signal number from a crash report.

Parameters:

handle

crash dump handle

Returns:

signal signal number

@:native("get_sys_field")staticgetSysField(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 Crash.SYSFIELD_MAX

Returns:

value recorded in the crash dump, or nil if it didn't exist

@:native("get_user_field")staticgetUserField(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

@:native("load_previous")staticloadPrevious():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

@:native("set_file_path")staticsetFilePath(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

@:native("set_user_field")staticsetUserField(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

@:native("write_dump")staticwriteDump():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.