Blog

Has information regarding a regional variable of a given activation record

Has information regarding a regional variable of a given activation record

lua_getinfo

For information about a work invocation, the parameter ar needs to be a valid activation record that has been overflowing by a previous name to lua_getstack or considering as argument to a hook (see lua_Hook ).

To have information on a purpose your press it on the heap and start the what string because of the dynamics ‘ > ‘. (In this case, lua_getinfo pops the function into the the surface of the heap.) For instance, to know which line a function f was described, you’ll be able to write these rule:

  • ‘ letter ‘: fills in the field label and namewhat ;
  • ‘ S ‘: fills from inside the sphere resource , short_src , linedefined , lastlinedefined , and just what ;
  • ‘ l ‘: fills in the field currentline ;
  • ‘ u ‘: fills in the field nups ;
  • ‘ f ‘: forces onto the heap the event which operating on given levels;
  • ‘ L ‘: forces onto the pile a desk whoever indicator include numbers of the lines that are good throughout the work. (A valid range is actually a line with related rule, that will be, a line where you can put a break point. Non-valid outlines integrate vacant outlines and feedback.)

lua_getlocal

The factor ar should be a valid activation record that was stuffed by a past phone call to lua_getstack or provided as debate to a hook (discover lua_Hook ). The list letter selects which local variable to examine (1 will be the very first parameter or productive local variable, an such like, till the last productive regional changeable). lua_getlocal forces the variable’s value on the stack and comes back their identity.

Varying brands beginning with ‘ ( ‘ (open parentheses) signify inner variables (loop control variables, temporaries, and C work locals).

lua_getstack

This work fulfills elements of a lua_Debug build with a recognition with the activation record associated with the purpose executing at certain levels. Levels 0 may be the latest running purpose, whereas level n+1 will be the work with known as stage letter. When there are no problems, lua_getstack profits 1; when called with an amount greater than the heap level, it return 0.

lua_getupvalue

Has information on a closure’s upvalue. (For Lua applications, upvalues are the external local variables that the features utilizes, and this include therefore a part of the closing.) lua_getupvalue receives the list letter of an upvalue, pushes the upvalue’s appreciate on the heap, and comes back its label. funcindex things to the closing during the stack. (Upvalues do not have certain purchase, because they’re energetic through the whole purpose. Therefore, these are generally numbered in an arbitrary order.)

Comes back NULL (and pushes little) if the list was more than how many upvalues. For C applications, this function makes use of the unused string “” as a reputation for all upvalues.

lua_Hook

Each time a hook is known as, its ar discussion has its own industry occasion set-to the precise occasion that induced the hook. Lua identifies these occasions with all the appropriate constants: LUA_HOOKCALL , LUA_HOOKRET , LUA_HOOKTAILRET , LUA_HOOKLINE , and LUA_HOOKCOUNT . Additionally, for line events, industry currentline can put. To get the value of all other field in ar , the hook must contact lua_getinfo . For return activities, event may be LUA_HOOKRET , the normal importance, or LUA_HOOKTAILRET . For the second circumstances, Lua try simulating going back from a function that did a tail name; in this situation, its pointless to phone lua_getinfo .

While Lua was running a hook, they dating sites Popular disables different calls to hooks. Consequently, if a hook phone calls back once again Lua to implement a function or a chunk, this delivery starts without any telephone calls to hooks.