Namespace: crash
Language: Lua
Type: Defold Lua
File: script_crash.cpp
Source: engine/crash/src/script_crash.cpp
Native crash logging functions and constants.
Type: FUNCTION A table is returned containing the addresses of the call stack.
Parameters
handle (number) - crash dump handleReturns
backtrace (string[]) - table containing the backtraceType: FUNCTION The format of read text blob is platform specific and not guaranteed but can be useful for manual inspection.
Parameters
handle (number) - crash dump handleReturns
blob (string) - string with the platform specific dataType: FUNCTION get all loaded modules from when the crash occured
Parameters
handle (number) - crash dump handleReturns
modules (crash.module_info[]) - loaded modulesType: FUNCTION read signal number from a crash report
Parameters
handle (number) - crash dump handleReturns
signal (number) - signal numberType: FUNCTION reads a system field from a loaded crash dump
Parameters
handle (number) - crash dump handleindex (crash.SYSFIELD) - system field enum. Must be less than crash.SYSFIELD_MAXReturns
value (string |
nil) - value recorded in the crash dump, or nil if it didn’t exist |
Type: FUNCTION reads user field from a loaded crash dump
Parameters
handle (number) - crash dump handleindex (crash.USERFIELD) - user data slot indexReturns
value (string) - user data value recorded in the crash dumpType: FUNCTION The crash dump will be removed from disk upon a successful load, so loading is one-shot.
Returns
handle (number |
nil) - handle to the loaded dump, or nil if no dump was found |
Type: STRUCT Loaded crash module
Members
name (string) - module nameaddress (string) - module load addressType: FUNCTION releases a previously loaded crash dump
Parameters
handle (number) - handle to loaded crash dumpType: FUNCTION Crashes occuring before the path is set will be stored to a default engine location.
Parameters
path (string) - file path to useType: FUNCTION Store a user value that will get written to a crash dump when a crash occurs. This can be user id:s, breadcrumb data etc. There are 32 slots indexed from 0. Each slot stores at most 255 characters.
Parameters
index (crash.USERFIELD) - slot index. 0-indexedvalue (string) - string value to storeType: ENUM System crash fields
Members
crash.SYSFIELD_ENGINE_VERSION - engine version as release numbercrash.SYSFIELD_ENGINE_HASH - engine version as hashcrash.SYSFIELD_DEVICE_MODEL - device model as reported by sys.get_sys_infocrash.SYSFIELD_MANUFACTURER - device manufacturer as reported by sys.get_sys_infocrash.SYSFIELD_SYSTEM_NAME - system name as reported by sys.get_sys_infocrash.SYSFIELD_SYSTEM_VERSION - system version as reported by sys.get_sys_infocrash.SYSFIELD_LANGUAGE - system language as reported by sys.get_sys_infocrash.SYSFIELD_DEVICE_LANGUAGE - system device language as reported by sys.get_sys_infocrash.SYSFIELD_TERRITORY - system territory as reported by sys.get_sys_infocrash.SYSFIELD_ANDROID_BUILD_FINGERPRINT - android build fingerprintType: CONSTANT The max number of sysfields.
Parameters
value (integer)Type: TYPEDEF An integer index identifying one of the 32 user-defined fields stored in a crash dump. Valid indices are 0 through 31. Each field stores a string of at most crash.USERFIELD_SIZE bytes; longer strings are truncated.
Parameters
value (integer) - zero-based user-field indexExamples
crash.set_user_field(0, "level=forest")
crash.set_user_field(1, "checkpoint=3")
Type: CONSTANT The max number of user fields.
Parameters
value (integer)Type: CONSTANT The max size of a single user field.
Parameters
value (integer)Type: FUNCTION 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