Quirrel4.41.0

debug

Introspection, the error handler, the debug hook and the garbage collector.

from "debug" import ...

Functions

collectgarbagecollectgarbage(): intRuns the garbage collector and returns the number of reclaimed objects
docdoc(subject: function|instance|class): string|nullReturns a documentation string for a function, class, or instance
format_call_stack_stringformat_call_stack_string(): stringReturns a formatted string describing the current call stack
get_function_decl_stringget_function_decl_string(func: function): string|nullReturns a function declaration string
get_function_info_tableget_function_info_table(func: function): table|nullReturns meta information about a function as table
get_stack_topget_stack_top(): intReturns the current VM stack top index
getbuildinfogetbuildinfo(): tableReturns a table describing the Quirrel build (version, sizes, GC status)
getlocalsgetlocals([level: int, include_internal: bool]): tableReturns a table of local variables at the given stack level
getstackinfosgetstackinfos(level: int): table|nullReturns call stack information for the given stack level
resurrectunreachableresurrectunreachable(): array|nullResurrects unreachable objects for inspection
script_watchdog_kickscript_watchdog_kick()Resets the script watchdog timer
set_script_watchdog_timeout_msecset_script_watchdog_timeout_msec(timeout_msec: int): intSets the script watchdog timeout in milliseconds and returns the previous value
setdebughooksetdebughook(hook: function|null)Installs the given function as the VM debug hook; null clears it
seterrorhandlerseterrorhandler(handler: function|null)Installs the given function as the VM error handler; null clears it
type_mask_to_stringtype_mask_to_string(mask: int): stringConvert type mask to human-readable string