27 static const char *
const HOOKKEY =
"_HOOKKEY";
169 if (strchr(options,
'S')) {
177 if (strchr(options,
'l'))
179 if (strchr(options,
'u')) {
184 if (strchr(options,
'n')) {
188 if (strchr(options,
'r')) {
192 if (strchr(options,
't'))
194 if (strchr(options,
'L'))
196 if (strchr(options,
'f'))
262 if (name == NULL)
return 0;
288 "invalid upvalue index");
315 static const char *
const hooknames[] =
316 {
"call",
"return",
"line",
"count",
"tail call"};
362 func = NULL; mask = 0; count = 0;
396 else if (hook !=
hookf)
415 if (fgets(buffer,
sizeof(buffer), stdin) == 0 ||
416 strcmp(buffer,
"cont\n") == 0)
LUA_API const char * lua_getupvalue(lua_State *L, int funcindex, int n)
#define lua_isnoneornil(L, n)
LUA_API void lua_xmove(lua_State *from, lua_State *to, int n)
static char * unmakemask(int mask, char *smask)
LUA_API int lua_rawget(lua_State *L, int idx)
static const char *const HOOKKEY
static int db_getuservalue(lua_State *L)
LUA_API void lua_pushnil(lua_State *L)
static int db_setuservalue(lua_State *L)
static int db_setlocal(lua_State *L)
LUA_API int lua_setmetatable(lua_State *L, int objindex)
LUAMOD_API int luaopen_debug(lua_State *L)
LUA_API void lua_rawset(lua_State *L, int idx)
#define luaL_argexpected(L, cond, arg, tname)
static int auxupvalue(lua_State *L, int get)
static void settabsi(lua_State *L, const char *k, int v)
static int db_setcstacklimit(lua_State *L)
LUA_API void lua_setfield(lua_State *L, int idx, const char *k)
#define lua_remove(L, idx)
static int db_getinfo(lua_State *L)
LUA_API int lua_setiuservalue(lua_State *L, int idx, int n)
LUA_API const char * lua_getlocal(lua_State *L, const lua_Debug *ar, int n)
static int db_getregistry(lua_State *L)
char short_src[LUA_IDSIZE]
LUA_API const char * lua_pushstring(lua_State *L, const char *s)
static int db_debug(lua_State *L)
static int makemask(const char *smask, int count)
LUA_API void lua_sethook(lua_State *L, lua_Hook func, int mask, int count)
#define luaL_loadbuffer(L, s, sz, n)
LUA_API void lua_pushvalue(lua_State *L, int idx)
LUA_API int lua_getinfo(lua_State *L, const char *what, lua_Debug *ar)
static lua_State * getthread(lua_State *L, int *arg)
LUA_API void lua_settop(lua_State *L, int idx)
LUA_API int lua_getmetatable(lua_State *L, int objindex)
LUA_API void lua_upvaluejoin(lua_State *L, int fidx1, int n1, int fidx2, int n2)
#define lua_isthread(L, n)
#define lua_pcall(L, n, r, f)
LUA_API int lua_getstack(lua_State *L, int level, lua_Debug *ar)
static const luaL_Reg dblib[]
LUA_API void * lua_upvalueid(lua_State *L, int fidx, int n)
LUA_API void lua_pushboolean(lua_State *L, int b)
LUA_API int lua_iscfunction(lua_State *L, int idx)
static int db_setupvalue(lua_State *L)
static int db_getlocal(lua_State *L)
static void settabsb(lua_State *L, const char *k, int v)
LUA_API int lua_pushthread(lua_State *L)
LUA_API int lua_getiuservalue(lua_State *L, int idx, int n)
LUA_API lua_State * lua_tothread(lua_State *L, int idx)
#define lua_pushliteral(L, s)
LUALIB_API void luaL_checkany(lua_State *L, int arg)
LUA_API const char * lua_setlocal(lua_State *L, const lua_Debug *ar, int n)
LUALIB_API const char * luaL_tolstring(lua_State *L, int idx, size_t *len)
static int db_setmetatable(lua_State *L)
LUALIB_API void luaL_traceback(lua_State *L, lua_State *L1, const char *msg, int level)
static int db_gethook(lua_State *L)
LUALIB_API lua_Integer luaL_checkinteger(lua_State *L, int arg)
detail::named_arg< Char, T > arg(const Char *name, const T &arg)
static void settabss(lua_State *L, const char *k, const char *v)
#define lua_isfunction(L, n)
LUA_API int lua_type(lua_State *L, int idx)
LUALIB_API int luaL_argerror(lua_State *L, int arg, const char *extramsg)
LUALIB_API lua_Integer luaL_optinteger(lua_State *L, int arg, lua_Integer def)
#define lua_tostring(L, i)
static void checkstack(lua_State *L, lua_State *L1, int n)
LUALIB_API int luaL_error(lua_State *L, const char *fmt,...)
static int db_upvaluejoin(lua_State *L)
#define luaL_newlib(L, l)
static void hookf(lua_State *L, lua_Debug *ar)
#define lua_call(L, n, r)
LUA_API void lua_rotate(lua_State *L, int idx, int n)
LUA_API int lua_gethookcount(lua_State *L)
#define luaL_argcheck(L, cond, arg, extramsg)
LUA_API int lua_gethookmask(lua_State *L)
static int db_upvalueid(lua_State *L)
LUALIB_API int luaL_getsubtable(lua_State *L, int idx, const char *fname)
LUA_API void lua_pushinteger(lua_State *L, lua_Integer n)
#define LUA_REGISTRYINDEX
LUA_API void lua_pushlightuserdata(lua_State *L, void *p)
LUALIB_API void luaL_checktype(lua_State *L, int arg, int t)
void(* lua_Hook)(lua_State *L, lua_Debug *ar)
#define lua_writestringerror(s, p)
LUA_API const char * lua_pushfstring(lua_State *L, const char *fmt,...)
LUA_API const char * lua_setupvalue(lua_State *L, int funcindex, int n)
#define lua_insert(L, idx)
LUA_API lua_Hook lua_gethook(lua_State *L)
LUA_API const char * lua_pushlstring(lua_State *L, const char *s, size_t len)
LUA_API int lua_setcstacklimit(lua_State *L, unsigned int limit)
LUA_API int lua_getfield(lua_State *L, int idx, const char *k)
static int db_sethook(lua_State *L)
#define luaL_optstring(L, n, d)
static int checkupval(lua_State *L, int argf, int argnup)
static int db_getmetatable(lua_State *L)
static void treatstackoption(lua_State *L, lua_State *L1, const char *fname)
static int db_traceback(lua_State *L)
LUA_API int lua_checkstack(lua_State *L, int n)
static int db_getupvalue(lua_State *L)
#define luaL_checkstring(L, n)