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

Function Sys_DebuggerLightweightHook

engine/script/src/script_sys.cpp:1455–1473  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1453 //undocummented function for debugger
1454
1455 static void Sys_DebuggerLightweightHook(lua_State *L, lua_Debug *ar)
1456 {
1457 int top = lua_gettop(L);
1458 lua_getinfo(L, "S", ar);
1459 lua_rawgeti(L, LUA_REGISTRYINDEX, g_DebuggerLightweightHook);
1460 lua_pushstring(L, ar->source);
1461 lua_pushnumber(L, ar->lastlinedefined);
1462 if (lua_pushthread(L))
1463 {
1464 lua_pop(L, 1);
1465 lua_pushnil(L); //main thread is not a coroutine
1466 }
1467 //[-1] - thread or nil
1468 //[-2] - lastlinedefined (number)
1469 //[-3] - source (string)
1470 //[-4] - callback
1471 lua_call(L, 3, 0);
1472 assert(top == lua_gettop(L));
1473 }
1474
1475 static int Sys_SetDebuggerLightweightHook(lua_State* L)
1476 {

Callers

nothing calls this directly

Calls 9

lua_gettopFunction · 0.85
lua_getinfoFunction · 0.85
lua_rawgetiFunction · 0.85
lua_pushstringFunction · 0.85
lua_pushnumberFunction · 0.85
lua_pushthreadFunction · 0.85
lua_pushnilFunction · 0.85
lua_callFunction · 0.85
assertFunction · 0.50

Tested by

no test coverage detected