34 #define noLuaClosure(f) ((f) == NULL || (f)->c.tt == LUA_VCCL) 37 #define invpcRel(pc, p) ((p)->code + (pc) + 1) 69 unsigned int m = (j + i) / 2;
93 while (basepc++ < pc) {
119 for (; ci != NULL; ci = ci->
previous)
136 if (func == NULL || mask == 0) {
167 if (level < 0)
return 0;
171 if (level == 0 && ci != &L->
base_ci) {
183 if (s == NULL)
return "?";
190 int nextra = ci->
u.
l.nextraargs;
192 *pos = ci->
func - nextra - (n + 1);
202 const char *
name = NULL;
211 if (limit - base >= n && n > 0) {
213 name =
isLua(ci) ?
"(temporary)" :
"(C temporary)";
219 *pos = base + (n - 1);
288 return currentline + p->
lineinfo[pc];
309 currentline =
nextline(p, currentline, i);
333 for (; *what; what++) {
344 ar->
nups = (f == NULL) ? 0 : f->
c.nupvalues;
406 if (strchr(what,
'f')) {
410 if (strchr(what,
'L'))
440 const char *what =
getobjname(p, pc, c, name);
441 if (!(what && *what ==
'c'))
454 rname(p, pc, c, name);
474 for (pc = 0; pc < lastpc; pc++) {
482 change = (a <= reg && reg <= a + b);
486 change = (reg >= a + 2);
496 int dest = pc + 1 + b;
498 if (dest <= lastpc && dest > jmptarget)
525 return (name && strcmp(name,
LUA_ENV) == 0) ?
"global" :
"field";
550 return gxf(p, pc, i, 1);
554 rname(p, pc, k, name);
555 return gxf(p, pc, i, 0);
558 *name =
"integer index";
564 return gxf(p, pc, i, 0);
612 *name =
"for iterator";
613 return "for iterator";
641 *name =
getstr(
G(L)->tmname[tm]) + 2;
657 return (0 <= i && i < (ci->
top - base) &&
s2v(base + i) == o);
670 for (i = 0; i < c->nupvalues; i++) {
681 const char *
name = NULL;
683 const char *kind = NULL;
713 const TValue *p2,
const char *msg) {
734 if (strcmp(t1, t2) == 0)
748 buff[0] =
'?'; buff[1] =
'\0';
788 while (oldpc++ < newpc) {
819 ci->
u.
l.savedpc = pc;
829 if (!
isIT(*(ci->
u.
l.savedpc - 1)))
833 if (mask & LUA_MASKLINE) {
834 int npci =
pcRel(pc, p);
unsigned short callstatus
static const char * getobjname(const Proto *p, int lastpc, int reg, const char **name)
const char * luaG_addinfo(lua_State *L, const char *msg, TString *src, int line)
void luaD_callnoyield(lua_State *L, StkId func, int nResults)
static const char * getfuncname(lua_State *L, CallInfo *ci, const char **name)
static const char * gxf(const Proto *p, int pc, Instruction i, int isup)
static const char * getupvalname(CallInfo *ci, const TValue *o, const char **name)
static int findsetreg(const Proto *p, int lastpc, int reg)
l_noret luaG_concaterror(lua_State *L, const TValue *p1, const TValue *p2)
const char * luaT_objtypename(lua_State *L, const TValue *o)
static const char * funcnamefromcode(lua_State *L, CallInfo *ci, const char **name)
LUA_API const char * lua_getlocal(lua_State *L, const lua_Debug *ar, int n)
l_noret luaG_typeerror(lua_State *L, const TValue *o, const char *op)
static void rkname(const Proto *p, int pc, Instruction i, const char **name)
char short_src[LUA_IDSIZE]
int luaG_traceexec(lua_State *L, const Instruction *pc)
AbsLineInfo * abslineinfo
const char * luaF_getlocalname(const Proto *f, int local_number, int pc)
l_noret luaG_ordererror(lua_State *L, const TValue *p1, const TValue *p2)
LUA_API void lua_sethook(lua_State *L, lua_Hook func, int mask, int count)
static void funcinfo(lua_Debug *ar, Closure *cl)
LUA_API int lua_getinfo(lua_State *L, const char *what, lua_Debug *ar)
#define tointegerns(o, i)
#define restorestack(L, n)
static const char * findvararg(CallInfo *ci, int n, StkId *pos)
LUA_API int lua_getstack(lua_State *L, int level, lua_Debug *ar)
struct CallInfo::@31::@34 transferinfo
static int getbaseline(const Proto *f, int pc, int *basepc)
static int getcurrentline(CallInfo *ci)
static void rname(const Proto *p, int pc, int c, const char **name)
void luaO_chunkid(char *out, const char *source, size_t srclen)
volatile l_signalT hookmask
void luaD_hook(lua_State *L, int event, int line, int ftransfer, int ntransfer)
l_noret luaG_tointerror(lua_State *L, const TValue *p1, const TValue *p2)
l_noret luaG_runerror(lua_State *L, const char *fmt,...)
const char * luaO_pushvfstring(lua_State *L, const char *fmt, va_list argp)
Table * luaH_new(lua_State *L)
#define resethookcount(L)
static int auxgetinfo(lua_State *L, const char *what, lua_Debug *ar, Closure *f, CallInfo *ci)
l_noret luaG_forerror(lua_State *L, const TValue *o, const char *what)
LUA_API const char * lua_setlocal(lua_State *L, const lua_Debug *ar, int n)
static void settraps(CallInfo *ci)
static const char * upvalname(const Proto *p, int uv)
l_noret luaG_errormsg(lua_State *L)
static const char * varinfo(lua_State *L, const TValue *o)
LUA_API int lua_gethookcount(lua_State *L)
LUA_API int lua_gethookmask(lua_State *L)
static void kname(const Proto *p, int c, const char **name)
void luaH_setint(lua_State *L, Table *t, lua_Integer key, TValue *value)
const char * luaG_findlocal(lua_State *L, CallInfo *ci, int n, StkId *pos)
l_noret luaG_opinterror(lua_State *L, const TValue *p1, const TValue *p2, const char *msg)
static int filterpc(int pc, int jmptarget)
#define api_check(l, e, msg)
struct CallInfo * previous
#define sethvalue2s(L, o, h)
void(* lua_Hook)(lua_State *L, lua_Debug *ar)
LUA_API lua_Hook lua_gethook(lua_State *L)
#define setobjs2s(L, o1, o2)
static void collectvalidlines(lua_State *L, Closure *f)
const char * luaO_pushfstring(lua_State *L, const char *fmt,...)
static int isinstack(CallInfo *ci, const TValue *o)
static int nextline(const Proto *p, int currentline, int pc)
static int currentpc(CallInfo *ci)
static int changedline(const Proto *p, int oldpc, int newpc)
l_noret luaD_throw(lua_State *L, int errcode)
#define setobj2s(L, o1, o2)
struct CallInfo::@30::@32 l
int luaG_getfuncline(const Proto *f, int pc)