Sintaxis
Alias
debug.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.
debug.getstack