4.9 – The Debug Interface

Lua has no built-in debugging facilities. Instead, it offers a special interface by means of functions and hooks. This interface allows the construction of different kinds of debuggers, profilers, and other tools that need "inside information" from the interpreter.

lua_gethookcount
  • References/Lua/Lua/API/The Debug Interface

lua_gethookcount[-0, +0, –] int lua_gethookcount (lua_State *L); Returns the current hook count.

2025-01-10 15:47:30
lua_Debug
  • References/Lua/Lua/API/The Debug Interface

lua_Debug typedef struct lua_Debug { int event; const char *name; /* (n) */ const char *namewhat; /* (n) */ const char

2025-01-10 15:47:30
lua_getlocal
  • References/Lua/Lua/API/The Debug Interface

lua_getlocal[-0, +(0|1), –] const char *lua_getlocal (lua_State *L, const lua_Debug *ar, int n); Gets information

2025-01-10 15:47:30
lua_gethook
  • References/Lua/Lua/API/The Debug Interface

lua_gethook[-0, +0, –] lua_Hook lua_gethook (lua_State *L); Returns the current hook function.

2025-01-10 15:47:30
lua_gethookmask
  • References/Lua/Lua/API/The Debug Interface

lua_gethookmask[-0, +0, –] int lua_gethookmask (lua_State *L); Returns the current hook mask.

2025-01-10 15:47:30
lua_setlocal
  • References/Lua/Lua/API/The Debug Interface

lua_setlocal[-(0|1), +0, –] const char *lua_setlocal (lua_State *L, const lua_Debug *ar, int n); Sets the

2025-01-10 15:47:30
lua_sethook
  • References/Lua/Lua/API/The Debug Interface

lua_sethook[-0, +0, –] void lua_sethook (lua_State *L, lua_Hook f, int mask, int count); Sets the debugging

2025-01-10 15:47:30
lua_setupvalue
  • References/Lua/Lua/API/The Debug Interface

lua_setupvalue[-(0|1), +0, –] const char *lua_setupvalue (lua_State *L, int funcindex, int n); Sets the

2025-01-10 15:47:30
lua_getinfo
  • References/Lua/Lua/API/The Debug Interface

lua_getinfo[-(0|1), +(0|1|2), e] int lua_getinfo (lua_State *L, const char *what, lua_Debug *ar);

2025-01-10 15:47:30
lua_upvalueid
  • References/Lua/Lua/API/The Debug Interface

lua_upvalueid[-0, +0, –] void *lua_upvalueid (lua_State *L, int funcindex, int n); Returns a unique identifier

2025-01-10 15:47:30