| 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 | { |
nothing calls this directly
no test coverage detected