Reputation: 301
I am currently running a Lua script with a hook attached using LUA_MASKCALL
and the hook function implemented as follows:
void LuaHook(lua_State *L, lua_Debug *ar) {
switch(ar->event) {
case LUA_HOOKCALL:
lua_getinfo(L, ">n", ar);
//breakpoint here...
} break;
default:
break;
}
}
I would like to get the name of the called function, but am not sure I am doing it correctly since it never seems to give me anything (the breakpoint is hit at the appropriate times though). The functions that are called are bound C functions that do have names so that seems weird. Overall lua_getinfo
is a complete mystery to me and the documentation does not clear things up either so any help would be greatly appreciated on this one.
Upvotes: 2
Views: 1208