Gets details about a regional variable of certain activation record

Gets details about a regional variable of certain activation record


To get details about a work invocation, the parameter ar ought to be a valid activation record that was filled by an earlier label to lua_getstack or offered as debate to a hook (discover lua_Hook ).

To have information about a features your drive it onto the pile and begin the what string aided by the dynamics ‘ > ‘. (if that’s the case, lua_getinfo pops the function inside the the top of pile.) For instance, to learn in which range a function f was actually identified, you can create the subsequent signal:

  • ‘ letter ‘: fills in that particular niche term and namewhat ;
  • ‘ S ‘: fills in industries supply , short_src , linedefined , lastlinedefined , and what ;
  • ‘ l ‘: fills in the field currentline ;
  • ‘ u ‘: fills in the field nups ;
  • ‘ f ‘: pushes on the bunch the function that will be operating during the offered levels;
  • ‘ L ‘: forces on the stack a dining table whose indices will be the numbers of the traces which are legitimate from the purpose. (A valid line was a line with connected rule, which, a line where you could place a rest aim. Non-valid lines add vacant lines and remarks.)


The parameter ar need to be a valid activation record which was filled by an earlier call to lua_getstack or given as discussion to a hook (read lua_Hook ). The index n selects which regional diverse to check (1 could be the basic parameter or productive neighborhood variable, an such like, until the finally active neighborhood changeable). lua_getlocal forces the variable’s price on the heap and comes back the term.

Adjustable names starting with ‘ ( ‘ (open parentheses) represent internal factors (cycle controls factors, temporaries, and C purpose residents).


This features fulfills components of a lua_Debug framework with an identification of this activation record associated with function executing at confirmed level. Degree 0 could be the present operating function, whereas amount n+1 will be the features who has also known as level n. When there will be no mistakes, lua_getstack comes back 1; whenever known as with an amount greater than the stack degree, it return 0.


Gets information regarding a closure’s upvalue. (For Lua functionality, upvalues are the exterior local factors that features makes use of, hence were as a result incorporated into the closure.) lua_getupvalue receives the directory n of an upvalue, forces the upvalue’s importance onto the stack, and comes back the label. funcindex things to the closing when you look at the pile. (Upvalues haven’t any particular order, since they are effective through the complete function. So, they’ve been numbered in an arbitrary order.)

Profits NULL (and forces absolutely nothing) as soon as the directory is greater than the quantity of upvalues. For C functionality, this features utilizes the vacant string “” as a name regarding upvalues.


Whenever a hook is called, its ar argument has its industry show set-to the particular event that induced the hook. Lua identifies these events making use of appropriate constants: LUA_HOOKCALL , LUA_HOOKRET , LUA_HOOKTAILRET , LUA_HOOKLINE , and LUA_HOOKCOUNT . Moreover, for line activities, the field currentline can arranged. To have the value of other area in ar , the hook must name lua_getinfo . For return events, occasion can be LUA_HOOKRET , the typical worth, or LUA_HOOKTAILRET . In the latter circumstances, Lua was simulating going back from a function that did a tail telephone call; in this case, truly pointless to call lua_getinfo .

While Lua is working a hook, they disables more telephone calls to hooks. Therefore, if a hook phone calls straight back Lua to execute a function or a chunk, this execution occurs with no telephone calls to hooks free Popular singles dating site.

Trả lời

Email của bạn sẽ không được hiển thị công khai. Các trường bắt buộc được đánh dấu *