Crash

Namespace: crash Language: Lua Type: Defold Lua File: script_crash.cpp Source: engine/crash/src/script_crash.cpp

Native crash logging functions and constants.

API

crash.get_backtrace

Type: FUNCTION A table is returned containing the addresses of the call stack.

Parameters

Returns

crash.get_extra_data

Type: FUNCTION The format of read text blob is platform specific and not guaranteed but can be useful for manual inspection.

Parameters

Returns

crash.get_modules

Type: FUNCTION get all loaded modules from when the crash occured

Parameters

Returns

crash.get_signum

Type: FUNCTION read signal number from a crash report

Parameters

Returns

crash.get_sys_field

Type: FUNCTION reads a system field from a loaded crash dump

Parameters

Returns

crash.get_user_field

Type: FUNCTION reads user field from a loaded crash dump

Parameters

Returns

crash.load_previous

Type: FUNCTION The crash dump will be removed from disk upon a successful load, so loading is one-shot.

Returns

crash.module_info

Type: STRUCT Loaded crash module

Members

crash.release

Type: FUNCTION releases a previously loaded crash dump

Parameters

crash.set_file_path

Type: FUNCTION Crashes occuring before the path is set will be stored to a default engine location.

Parameters

crash.set_user_field

Type: 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

crash.SYSFIELD

Type: ENUM System crash fields

Members

crash.SYSFIELD_MAX

Type: CONSTANT The max number of sysfields.

Parameters

crash.USERFIELD

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

Examples

crash.set_user_field(0, "level=forest")
crash.set_user_field(1, "checkpoint=3")

crash.USERFIELD_MAX

Type: CONSTANT The max number of user fields.

Parameters

crash.USERFIELD_SIZE

Type: CONSTANT The max size of a single user field.

Parameters

crash.write_dump

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