ReferenceDebug

debug.getinfo

Returns a table describing a function or visible caller frame.

Syntax

debug.getinfo(target: function | number) -> table

Also available as

getinfoget_info

Parameters

ParameterTypeDescription
targetfunction or numberFunction or visible caller level.

Returns

TypeDescription
tableAvailable function and frame metadata.

Description

The result uses familiar Lua debug field names, including source, short_src, what, name, currentline, linedefined, nups, numparams and is_vararg where available. This is an Apex compatibility interface, not the complete Lua 5.1 debug library. A function value has no active current line; use a caller level for frame-specific information.

Example

local info = debug.getinfo(function(a, b) return a + b end)
print(info.what, info.numparams, info.is_vararg)

These are Game executor contracts. Check build requirements and session lifetimes before using them.