lua_getinfo
To get details about a features invocation, the factor ar must be a valid activation record that has been filled by an earlier phone call to lua_getstack Plenty of Fish vs OkCupid for men or provided as argument to a hook (see lua_Hook ).
To obtain information on a features you press it on the pile and begin the exactly what sequence using the character ‘ > ‘. (In that case, lua_getinfo pops the big event for the top of the heap.) As an instance, to understand wherein line a function f got explained, you’ll be able to write these code:
- ‘ letter ‘: fills on the go title and namewhat ;
- ‘ S ‘: fills inside the industries supply , short_src , linedefined , lastlinedefined , and what ;
- ‘ l ‘: fills on the go currentline ;
- ‘ u ‘: fills in the field nups ;
- ‘ f ‘: forces on the heap the function which run on given amount;
- ‘ L ‘: forces on the bunch a desk whoever indicator will be the quantities of the traces being legitimate throughout the features. (a legitimate range try a line with associated rule, that will be, a line where you can placed some slack point. Non-valid outlines consist of empty lines and comments.)
lua_getlocal
The parameter ar ought to be a legitimate activation record which was loaded by a previous name to lua_getstack or given as argument to a hook (discover lua_Hook ). The index letter selects which local diverse to inspect (1 will be the very first parameter or active regional varying, an such like, through to the final productive neighborhood adjustable). lua_getlocal forces the diverse’s worth on the heap and comes back the label.
Changeable labels you start with ‘ ( ‘ (open parentheses) express inner variables (circle regulation variables, temporaries, and C features locals).
lua_getstack
This purpose fulfills components of a lua_Debug build with an identification in the activation record of the purpose executing at confirmed stage. Degree 0 will be the current run purpose, whereas stage n+1 could be the function who has called level n. When there will be no mistakes, lua_getstack comes back 1; whenever labeled as with an amount greater than the stack level, they return 0.
lua_getupvalue
Gets information regarding a closure’s upvalue. (For Lua performance, upvalues would be the external neighborhood variables the function makes use of, and this is subsequently incorporated the closing.) lua_getupvalue receives the list letter of an upvalue, forces the upvalue’s advantages onto the stack, and returns their label. funcindex points to the closure within the stack. (Upvalues haven’t any particular purchase, since they are effective through the whole work. Very, they might be numbered in an arbitrary purchase.)
Profits NULL (and forces nothing) as soon as the index was higher than the quantity of upvalues. For C applications, this purpose uses the empty string “” as a name for every upvalues.
lua_Hook
When a hook is called, their ar discussion has its own industry event set to the precise event that triggered the hook. Lua determines these activities with all the soon after constants: LUA_HOOKCALL , LUA_HOOKRET , LUA_HOOKTAILRET , LUA_HOOKLINE , and LUA_HOOKCOUNT . Furthermore, for line happenings, the field currentline can set. To get the value of some other industry in ar , the hook must name lua_getinfo . For return occasions, celebration are LUA_HOOKRET , the usual benefits, or LUA_HOOKTAILRET . Inside latter case, Lua try simulating a return from a function that performed a tail telephone call; in this case, it really is pointless to phone lua_getinfo .
While Lua is actually working a hook, they disables more phone calls to hooks. Thus, if a hook calls back Lua to implement a function or a chunk, this execution does occur with no phone calls to hooks.