Expand description
Debug interface — ported from ldebug.c.
Provides the Lua debug API: stack inspection, source info, variable lookup, hook management, and runtime error formatting.
§C source
reference/lua-5.4.7/src/ldebug.c (962 lines, 30 functions)
Structs§
- LuaDebug
- Debug introspection record.
Functions§
- arg_
error_ impl - Equivalent of C
luaL_argerror: build an arg-type error with function name (from debug info) and caller source location. Handles method calls by producing “calling ‘f’ on bad self …” when arg==1 and namewhat==“method”. - c_
api_ runtime - get_
hook_ count - Returns the current hook call count.
- get_
hook_ installed - Returns the current debug hook function, if any.
- get_
hook_ mask - Returns the current hook event mask.
- get_
info - Returns debug information about a function or active call frame.
- get_
local - Gets the name and value of local variable
nin call framear->i_ci(or in the function at the top of the stack ifaris NULL). Pushes the value on the stack and returns its name, or returnsNone. - get_
stack - Fills
arwith information about the call frame at depthlevel. Level 0 is the current running function, level 1 is the caller, etc. Returnstrueon success,falseif the level is out of range. - set_
hook - Installs a debug hook on thread
state. - set_
local - Sets local variable
nin call framear->i_cito the value on top of the stack. Pops the value and returns the variable name, or returnsNone.