20 #define HOOKKEY "_HKEY"
42 "nil or table expected");
60 luaL_argerror(L, 1,
"full userdata expected, got light userdata");
129 return luaL_argerror(L, arg+1,
"function or level expected");
133 if (strchr(options,
'S')) {
140 if (strchr(options,
'l'))
142 if (strchr(options,
'u')) {
147 if (strchr(options,
'n')) {
151 if (strchr(options,
't'))
153 if (strchr(options,
'L'))
155 if (strchr(options,
'f'))
209 if (name == NULL)
return 0;
255 #define gethooktable(L) luaL_getsubtable(L, LUA_REGISTRYINDEX, HOOKKEY)
259 static const char *
const hooknames[] =
260 {
"call",
"return",
"line",
"count",
"tail call"};
301 func = NULL; mask = 0; count = 0;
329 if (hook != NULL && hook !=
hookf)
347 if (fgets(buffer,
sizeof(buffer), stdin) == 0 ||
348 strcmp(buffer,
"cont\n") == 0)
static void settabsb(lua_State *L, const char *i, int v)
#define lua_isnoneornil(L, n)
LUA_API void lua_pushlightuserdata(lua_State *L, void *p)
LUA_API void lua_createtable(lua_State *L, int narray, int nrec)
static int db_setmetatable(lua_State *L)
LUAMOD_API int luaopen_debug(lua_State *L)
LUA_API void lua_settop(lua_State *L, int idx)
static int db_setuservalue(lua_State *L)
LUA_API int lua_type(lua_State *L, int idx)
static int makemask(const char *smask, int count)
static void hookf(lua_State *L, lua_Debug *ar)
LUA_API void lua_pushboolean(lua_State *L, int b)
LUA_API lua_Hook lua_gethook(lua_State *L)
static char * unmakemask(int mask, char *smask)
LUALIB_API void luaL_checktype(lua_State *L, int narg, int t)
LUA_API void lua_setuservalue(lua_State *L, int idx)
void(* lua_Hook)(lua_State *L, lua_Debug *ar)
LUA_API int lua_gethookmask(lua_State *L)
#define lua_tointeger(L, i)
#define LUA_TLIGHTUSERDATA
static int db_setupvalue(lua_State *L)
char short_src[LUA_IDSIZE]
LUA_API int lua_getstack(lua_State *L, int level, lua_Debug *ar)
#define luaL_argcheck(L, cond, numarg, extramsg)
#define luaL_loadbuffer(L, s, sz, n)
#define lua_isthread(L, n)
#define lua_pcall(L, n, r, f)
static int db_getinfo(lua_State *L)
static void settabsi(lua_State *L, const char *i, int v)
static int db_traceback(lua_State *L)
static void settabss(lua_State *L, const char *i, const char *v)
LUA_API void lua_upvaluejoin(lua_State *L, int fidx1, int n1, int fidx2, int n2)
LUA_API int lua_sethook(lua_State *L, lua_Hook func, int mask, int count)
LUA_API lua_State * lua_tothread(lua_State *L, int idx)
LUA_API int lua_getmetatable(lua_State *L, int objindex)
LUA_API void * lua_upvalueid(lua_State *L, int fidx, int n)
LUA_API const char * lua_setlocal(lua_State *L, const lua_Debug *ar, int n)
LUA_API int lua_setmetatable(lua_State *L, int objindex)
static int db_gethook(lua_State *L)
static int checkupval(lua_State *L, int argf, int argnup)
LUA_API void lua_remove(lua_State *L, int idx)
static int auxupvalue(lua_State *L, int get)
LUALIB_API void luaL_traceback(lua_State *L, lua_State *L1, const char *msg, int level)
GLuint GLuint GLsizei count
LUA_API void lua_pushnil(lua_State *L)
LUA_API const char * lua_setupvalue(lua_State *L, int funcindex, int n)
#define lua_pushliteral(L, s)
LUA_API int lua_pushthread(lua_State *L)
LUA_API void lua_getuservalue(lua_State *L, int idx)
LUA_API void lua_xmove(lua_State *from, lua_State *to, int n)
static int db_debug(lua_State *L)
LUA_API void lua_rawset(lua_State *L, int idx)
LUA_API int lua_getinfo(lua_State *L, const char *what, lua_Debug *ar)
static int db_upvaluejoin(lua_State *L)
#define lua_isfunction(L, n)
static int db_getuservalue(lua_State *L)
LUALIB_API int luaL_argerror(lua_State *L, int narg, const char *extramsg)
static int db_getregistry(lua_State *L)
static int db_upvalueid(lua_State *L)
#define lua_tostring(L, i)
static void msg(const char *act, debug_info &i, const char *to="", const char *result="")
static int db_sethook(lua_State *L)
LUA_API int lua_iscfunction(lua_State *L, int idx)
LUA_API void lua_insert(lua_State *L, int idx)
LUA_API void lua_pushvalue(lua_State *L, int idx)
static int db_getmetatable(lua_State *L)
LUA_API int lua_isnumber(lua_State *L, int idx)
#define luaL_newlib(L, l)
#define lua_call(L, n, r)
static void treatstackoption(lua_State *L, lua_State *L1, const char *fname)
LUA_API const char * lua_getlocal(lua_State *L, const lua_Debug *ar, int n)
#define luai_writestringerror(s, p)
static lua_State * getthread(lua_State *L, int *arg)
GLuint const GLchar * name
LUA_API const char * lua_getupvalue(lua_State *L, int funcindex, int n)
#define LUA_REGISTRYINDEX
#define luaL_checkint(L, n)
#define luaL_optint(L, n, d)
LUALIB_API void luaL_checkany(lua_State *L, int narg)
static int db_setlocal(lua_State *L)
LUA_API int lua_gethookcount(lua_State *L)
LUA_API const char * lua_pushfstring(lua_State *L, const char *fmt,...)
static int db_getlocal(lua_State *L)
static const luaL_Reg dblib[]
LUA_API void lua_pushinteger(lua_State *L, lua_Integer n)
#define luaL_optstring(L, n, d)
LUA_API void lua_rawget(lua_State *L, int idx)
LUA_API const char * lua_pushstring(lua_State *L, const char *s)
LUA_API void lua_setfield(lua_State *L, int idx, const char *k)
static int db_getupvalue(lua_State *L)
#define luaL_checkstring(L, n)