Get information about the interpreter runtime stack.
When there are no errors, lua_getstack returns 1; when called with a level greater than the stack depth, it returns 0.
This function fills parts of a lua_Debug structure with an identification of the activation record of the function executing at a given level. Level 0 is the current running function, whereas level n+1 is the function that has called level n.