Has information about a local variable of confirmed activation record
lua_getinfo
Receive information on a work invocation, the parameter ar needs to be a legitimate activation record which was overflowing by a past label to lua_getstack or given as argument to a hook (discover lua_Hook ).
In order to get information on a purpose your drive it onto the bunch and start the exactly what sequence utilizing the fictional character ‘ > ‘. (In this case, lua_getinfo pops the event in top of the bunch.) As an instance, understand wherein range a function f was identified, it is possible to compose these rule:
- ‘ letter ‘: fills in that particular niche identity and namewhat ;
- ‘ S ‘: fills within the industries resource , short_src , linedefined , lastlinedefined , and what ;
- ‘ l ‘: fills on the go currentline ;
- ‘ u ‘: fills in that particular niche nups ;
- ‘ f ‘: forces onto the stack the function that will be run from the considering stage;
- ‘ L ‘: pushes on the pile a desk whose indicator would be the amounts of the contours which can be good on purpose. (A valid range try a line with some connected laws, that will be, a line where you could set a rest point. Non-valid contours incorporate bare traces and responses.)
lua_getlocal
The parameter ar needs to be a legitimate activation record that has been brimming by a past telephone call to lua_getstack or provided as argument to a hook (read lua_Hook ). The directory letter selects which neighborhood diverse to check (1 may be the first parameter or energetic local varying, and so forth, until the final energetic regional varying). lua_getlocal forces the variable’s appreciate on the heap and comes back their title.
Variable labels starting with ‘ ( ‘ (open parentheses) signify interior https://datingmentor.org/popular-dating/ variables (loop controls variables, temporaries, and C features neighbors).
lua_getstack
This work fulfills areas of a lua_Debug build with an identification of the activation record of function executing at confirmed degree. Degree 0 will be the current working features, whereas level n+1 will be the function which includes called level letter. Whenever there are no problems, lua_getstack profits 1; when labeled as with an amount more than the pile degree, it comes back 0.
lua_getupvalue
Has information about a closing’s upvalue. (For Lua performance, upvalues are outside neighborhood variables the purpose makes use of, and therefore become consequently incorporated the closure.) lua_getupvalue receives the list letter of an upvalue, forces the upvalue’s advantages on the pile, and comes back the title. funcindex points to the closing from inside the stack. (Upvalues haven’t any certain order, because they are effective through the whole purpose. Very, these are typically numbered in an arbitrary purchase.)
Profits NULL (and forces absolutely nothing) whenever the index is actually higher than the sheer number of upvalues. For C functionality, this purpose makes use of the unused sequence “” as a reputation for several upvalues.
lua_Hook
When a hook is known as, their ar discussion has its own field occasion set-to the specific show that created the hook. Lua determines these happenings with the appropriate constants: LUA_HOOKCALL , LUA_HOOKRET , LUA_HOOKTAILRET , LUA_HOOKLINE , and LUA_HOOKCOUNT . Additionally, for line happenings, the field currentline normally set. To get the property value every other area in ar , the hook must call lua_getinfo . For return activities, occasion is generally LUA_HOOKRET , the standard value, or LUA_HOOKTAILRET . Inside the latter instance, Lua try simulating a return from a function that performed a tail telephone call; in this instance, it’s worthless to call lua_getinfo .
While Lua is actually operating a hook, it disables various other calls to hooks. For that reason, if a hook phone calls right back Lua to carry out a function or a chunk, this execution takes place without the telephone calls to hooks.