MCPcopy Create free account
hub / github.com/EmmyLua/EmmyLuaDebugger / db_gethook

Function db_gethook

third-party/lua-5.2.4/src/ldblib.c:333–351  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

331
332
333static int db_gethook (lua_State *L) {
334 int arg;
335 lua_State *L1 = getthread(L, &arg);
336 char buff[5];
337 int mask = lua_gethookmask(L1);
338 lua_Hook hook = lua_gethook(L1);
339 if (hook != NULL && hook != hookf) /* external hook? */
340 lua_pushliteral(L, "external hook");
341 else {
342 gethooktable(L);
343 checkstack(L, L1, 1);
344 lua_pushthread(L1); lua_xmove(L1, L, 1);
345 lua_rawget(L, -2); /* get hook */
346 lua_remove(L, -2); /* remove hook table */
347 }
348 lua_pushstring(L, unmakemask(mask, buff));
349 lua_pushinteger(L, lua_gethookcount(L1));
350 return 3;
351}
352
353
354static int db_debug (lua_State *L) {

Callers

nothing calls this directly

Calls 13

gethooktableFunction · 0.85
getthreadFunction · 0.70
lua_gethookmaskFunction · 0.70
lua_gethookFunction · 0.70
checkstackFunction · 0.70
lua_pushthreadFunction · 0.70
lua_xmoveFunction · 0.70
lua_rawgetFunction · 0.70
lua_removeFunction · 0.70
lua_pushstringFunction · 0.70
unmakemaskFunction · 0.70
lua_pushintegerFunction · 0.70

Tested by

no test coverage detected