| 함수 탐색 | 설명 |
|---|---|
getconstant | Returns one constant from a Lua function or stack level by one-based index. target must be a function or stack level number. Invalid stack levels raise “Level out of range”. Non-function and non-number targets raise a type error expecting “function or number”. C closures raise “Lua function expected”. Indexes below 1 raise “Constant index starts at 1”, and indexes past the available constants raise “Constant index out of range”. Function and table constants are returned as nil. debug.getconstant is an alias. |
getconstants | Returns constants from a Lua function or stack level as a table keyed by one-based constant index. target must be a function or stack level number. Invalid stack levels raise “Level out of range”. Non-function and non-number targets raise a type error expecting “function or number”. C closures raise “Lua function expected”. Nil, function, and table constants are absent from the returned table. debug.getconstants is an alias. |
getinfo | Returns a metadata table for a function or stack level. target must be a function or number. Invalid target types raise “function or number expected”, invalid stack levels raise “Level out of range”, and unavailable levels raise “invalid level”. The returned table includes func, nups, source, short_src, currentline, what, linedefined, is_vararg, numparams, and name. sizep is included only for direct Lua function targets. debug.getinfo is an alias. |
getproto | Returns a nested Lua function by one-based index. target must be a Lua function or stack level number. Invalid stack levels raise “Level out of range”, non-Lua functions raise “Lua function expected”, and indexes outside the nested function range raise “index out of bounds”. When active is true, returns currently live closures for that nested function instead. debug.getproto is an alias. |
getprotos | Returns all nested Lua functions from a Lua function or stack level as a one-based array table. Invalid stack levels raise “Level out of range”, and non-Lua functions raise “Lua function expected”. debug.getprotos is an alias. |
getreg | Returns the current Lua registry table. The function takes no arguments and returns the registry table directly. |
getstack | Reads stack slot values from a Lua stack frame. level is required and must be a number; it is converted to an integer and must be between 0 and the current call stack depth minus one. Invalid levels raise “Level out of range”. The selected frame is L->ci - level, so level 0 refers to the current frame in this function. If the selected frame is a C closure, the function raises “Lua function expected”. index is optional and is only used when the second argument is a number; it is converted to an integer and must be between 1 and the frame stack size. Without a numeric index, the function returns a one-based array table containing values from frame->base[0] with frame->base[top - 1]. With a numeric index, it returns the single value at frame->base[index - 1]. Collectable values trigger luaC_threadbarrier before being pushed. debug.getstack is exposed with the debug table alias. |
getupvalue | Returns one upvalue from a Lua function or stack level by one-based index. Invalid stack levels raise “Level out of range”, non-Lua functions raise “Lua Function expected”, indexes below 1 raise “Upvalue index starts at 1”, and indexes past the available upvalues raise “Upvalue index out of range”. debug.getupvalue is an alias. |
getupvalues | Returns all upvalues from a Lua function or stack level as a one-based array table. Invalid stack levels raise “Level out of range”, and non-Lua functions raise “Lua function expected”. debug.getupvalues is an alias. |
isvalidlevel | numeric stack level이 current call stack range 안에 있는지 확인합니다. function이 requires a number를 호출하므로 level은 필수이며 number여야 합니다. value는 integer conversion로 변환됩니다. function은 level < 0 또는 level >= the current call stack depth이면 false를 반환하고, 그렇지 않으면 true를 반환합니다. frame closure를 검사하지 않으며 invalid numeric levels에 대해 “Level out of range”를 발생시키지 않습니다. validlevel은 global alias이며 debug.isvalidlevel 및 debug.validlevel은 debug table aliases를 통해 노출됩니다. |
setconstant | Replaces one constant in a Lua function or stack level by one-based index. Invalid stack levels raise “Level out of range”, non-Lua functions raise “Lua function expected”, indexes below 1 raise “Constant index starts at 1”, and indexes past the available constants raise “Constant index out of range”. debug.setconstant is an alias. |
setstack | Replaces one stack slot value in a Lua stack frame. level and index are required numbers. level must satisfy 0 <= level < the current call stack depth; invalid levels raise “Level out of range”. C closure frames raise “Lua function expected”. index is one-based and must refer to an existing stack slot; invalid indexes raise “Stack index out of range”. debug.setstack is an alias. |
setupvalue | Replaces one upvalue in a Lua function or stack level by one-based index. Invalid stack levels raise “Level out of range”, non-Lua functions raise “Lua function expected”, indexes below 1 raise “Upvalue index starts at 1”, and indexes past the available upvalues raise “Upvalue index is out of range”. debug.setupvalue is an alias. |
Debug
Debug
런타임 검사 및 디버그 유틸리티.
런타임 검사 및 디버그 유틸리티.