MCPcopy Create free account
hub / github.com/defold/defold / Sys_SetDebuggerLightweightHook

Function Sys_SetDebuggerLightweightHook

engine/script/src/script_sys.cpp:1475–1494  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1473 }
1474
1475 static int Sys_SetDebuggerLightweightHook(lua_State* L)
1476 {
1477 int index = 1;
1478 lua_State* L1 = L;
1479 if (lua_isthread(L, 1)) {
1480 L1 = lua_tothread(L, 1);
1481 index++;
1482 }
1483 luaL_checktype(L, index, LUA_TFUNCTION);
1484 lua_pushvalue(L, index);
1485 if (g_DebuggerLightweightHook)
1486 {
1487 dmScript::Unref(L, LUA_REGISTRYINDEX, g_DebuggerLightweightHook);
1488 g_DebuggerLightweightHook = 0;
1489 }
1490 g_DebuggerLightweightHook = dmScript::Ref(L, LUA_REGISTRYINDEX);
1491
1492 lua_sethook(L1, Sys_DebuggerLightweightHook, LUA_MASKCALL, 0);
1493 return 0;
1494 }
1495
1496 static const luaL_reg ScriptSys_methods[] =
1497 {

Callers

nothing calls this directly

Calls 6

lua_tothreadFunction · 0.85
luaL_checktypeFunction · 0.85
lua_pushvalueFunction · 0.85
UnrefFunction · 0.85
RefFunction · 0.85
lua_sethookFunction · 0.85

Tested by

no test coverage detected