typedef void (*lua_Hook) (lua_State *L, lua_Debug *ar);
Type for debugging hook functions.
Whenever a hook is called, its
ar argument has its field
event set to the specific event that triggered the hook.
Lua identifies these events with the following constants:
Moreover, for line events, the field
currentline is also set.
To get the value of any other field in
the hook must call
For return events,
event can be
the normal value, or
In the latter case, Lua is simulating a return from
a function that did a tail call;
in this case, it is useless to call
While Lua is running a hook, it disables other calls to hooks.
Therefore, if a hook calls back Lua to execute a function or a chunk,
this execution occurs without any calls to hooks.