ldebug.c
Go to the documentation of this file.
1 /*
2 ** $Id: ldebug.c $
3 ** Debug Interface
4 ** See Copyright Notice in lua.h
5 */
6 
7 #define ldebug_c
8 #define LUA_CORE
9 
10 #include "lprefix.h"
11 
12 
13 #include <stdarg.h>
14 #include <stddef.h>
15 #include <string.h>
16 
17 #include "lua.h"
18 
19 #include "lapi.h"
20 #include "lcode.h"
21 #include "ldebug.h"
22 #include "ldo.h"
23 #include "lfunc.h"
24 #include "lobject.h"
25 #include "lopcodes.h"
26 #include "lstate.h"
27 #include "lstring.h"
28 #include "ltable.h"
29 #include "ltm.h"
30 #include "lvm.h"
31 
32 
33 
34 #define noLuaClosure(f) ((f) == NULL || (f)->c.tt == LUA_VCCL)
35 
36 
37 static const char *funcnamefromcode (lua_State *L, CallInfo *ci,
38  const char **name);
39 
40 
41 static int currentpc (CallInfo *ci) {
42  lua_assert(isLua(ci));
43  return pcRel(ci->u.l.savedpc, ci_func(ci)->p);
44 }
45 
46 
47 /*
48 ** Get a "base line" to find the line corresponding to an instruction.
49 ** Base lines are regularly placed at MAXIWTHABS intervals, so usually
50 ** an integer division gets the right place. When the source file has
51 ** large sequences of empty/comment lines, it may need extra entries,
52 ** so the original estimate needs a correction.
53 ** If the original estimate is -1, the initial 'if' ensures that the
54 ** 'while' will run at least once.
55 ** The assertion that the estimate is a lower bound for the correct base
56 ** is valid as long as the debug info has been generated with the same
57 ** value for MAXIWTHABS or smaller. (Previous releases use a little
58 ** smaller value.)
59 */
60 static int getbaseline (const Proto *f, int pc, int *basepc) {
61  if (f->sizeabslineinfo == 0 || pc < f->abslineinfo[0].pc) {
62  *basepc = -1; /* start from the beginning */
63  return f->linedefined;
64  }
65  else {
66  int i = cast_uint(pc) / MAXIWTHABS - 1; /* get an estimate */
67  /* estimate must be a lower bond of the correct base */
68  lua_assert(i < 0 ||
69  (i < f->sizeabslineinfo && f->abslineinfo[i].pc <= pc));
70  while (i + 1 < f->sizeabslineinfo && pc >= f->abslineinfo[i + 1].pc)
71  i++; /* low estimate; adjust it */
72  *basepc = f->abslineinfo[i].pc;
73  return f->abslineinfo[i].line;
74  }
75 }
76 
77 
78 /*
79 ** Get the line corresponding to instruction 'pc' in function 'f';
80 ** first gets a base line and from there does the increments until
81 ** the desired instruction.
82 */
83 int luaG_getfuncline (const Proto *f, int pc) {
84  if (f->lineinfo == NULL) /* no debug information? */
85  return -1;
86  else {
87  int basepc;
88  int baseline = getbaseline(f, pc, &basepc);
89  while (basepc++ < pc) { /* walk until given instruction */
90  lua_assert(f->lineinfo[basepc] != ABSLINEINFO);
91  baseline += f->lineinfo[basepc]; /* correct line */
92  }
93  return baseline;
94  }
95 }
96 
97 
98 static int getcurrentline (CallInfo *ci) {
99  return luaG_getfuncline(ci_func(ci)->p, currentpc(ci));
100 }
101 
102 
103 /*
104 ** Set 'trap' for all active Lua frames.
105 ** This function can be called during a signal, under "reasonable"
106 ** assumptions. A new 'ci' is completely linked in the list before it
107 ** becomes part of the "active" list, and we assume that pointers are
108 ** atomic; see comment in next function.
109 ** (A compiler doing interprocedural optimizations could, theoretically,
110 ** reorder memory writes in such a way that the list could be
111 ** temporarily broken while inserting a new element. We simply assume it
112 ** has no good reasons to do that.)
113 */
114 static void settraps (CallInfo *ci) {
115  for (; ci != NULL; ci = ci->previous)
116  if (isLua(ci))
117  ci->u.l.trap = 1;
118 }
119 
120 
121 /*
122 ** This function can be called during a signal, under "reasonable"
123 ** assumptions.
124 ** Fields 'basehookcount' and 'hookcount' (set by 'resethookcount')
125 ** are for debug only, and it is no problem if they get arbitrary
126 ** values (causes at most one wrong hook call). 'hookmask' is an atomic
127 ** value. We assume that pointers are atomic too (e.g., gcc ensures that
128 ** for all platforms where it runs). Moreover, 'hook' is always checked
129 ** before being called (see 'luaD_hook').
130 */
131 LUA_API void lua_sethook (lua_State *L, lua_Hook func, int mask, int count) {
132  if (func == NULL || mask == 0) { /* turn off hooks? */
133  mask = 0;
134  func = NULL;
135  }
136  L->hook = func;
137  L->basehookcount = count;
138  resethookcount(L);
139  L->hookmask = cast_byte(mask);
140  if (mask)
141  settraps(L->ci); /* to trace inside 'luaV_execute' */
142 }
143 
144 
146  return L->hook;
147 }
148 
149 
151  return L->hookmask;
152 }
153 
154 
156  return L->basehookcount;
157 }
158 
159 
160 LUA_API int lua_getstack (lua_State *L, int level, lua_Debug *ar) {
161  int status;
162  CallInfo *ci;
163  if (level < 0) return 0; /* invalid (negative) level */
164  lua_lock(L);
165  for (ci = L->ci; level > 0 && ci != &L->base_ci; ci = ci->previous)
166  level--;
167  if (level == 0 && ci != &L->base_ci) { /* level found? */
168  status = 1;
169  ar->i_ci = ci;
170  }
171  else status = 0; /* no such level */
172  lua_unlock(L);
173  return status;
174 }
175 
176 
177 static const char *upvalname (const Proto *p, int uv) {
178  TString *s = check_exp(uv < p->sizeupvalues, p->upvalues[uv].name);
179  if (s == NULL) return "?";
180  else return getstr(s);
181 }
182 
183 
184 static const char *findvararg (CallInfo *ci, int n, StkId *pos) {
185  if (clLvalue(s2v(ci->func))->p->is_vararg) {
186  int nextra = ci->u.l.nextraargs;
187  if (n >= -nextra) { /* 'n' is negative */
188  *pos = ci->func - nextra - (n + 1);
189  return "(vararg)"; /* generic name for any vararg */
190  }
191  }
192  return NULL; /* no such vararg */
193 }
194 
195 
196 const char *luaG_findlocal (lua_State *L, CallInfo *ci, int n, StkId *pos) {
197  StkId base = ci->func + 1;
198  const char *name = NULL;
199  if (isLua(ci)) {
200  if (n < 0) /* access to vararg values? */
201  return findvararg(ci, n, pos);
202  else
203  name = luaF_getlocalname(ci_func(ci)->p, n, currentpc(ci));
204  }
205  if (name == NULL) { /* no 'standard' name? */
206  StkId limit = (ci == L->ci) ? L->top : ci->next->func;
207  if (limit - base >= n && n > 0) { /* is 'n' inside 'ci' stack? */
208  /* generic name for any valid slot */
209  name = isLua(ci) ? "(temporary)" : "(C temporary)";
210  }
211  else
212  return NULL; /* no name */
213  }
214  if (pos)
215  *pos = base + (n - 1);
216  return name;
217 }
218 
219 
220 LUA_API const char *lua_getlocal (lua_State *L, const lua_Debug *ar, int n) {
221  const char *name;
222  lua_lock(L);
223  if (ar == NULL) { /* information about non-active function? */
224  if (!isLfunction(s2v(L->top - 1))) /* not a Lua function? */
225  name = NULL;
226  else /* consider live variables at function start (parameters) */
227  name = luaF_getlocalname(clLvalue(s2v(L->top - 1))->p, n, 0);
228  }
229  else { /* active function; get information through 'ar' */
230  StkId pos = NULL; /* to avoid warnings */
231  name = luaG_findlocal(L, ar->i_ci, n, &pos);
232  if (name) {
233  setobjs2s(L, L->top, pos);
234  api_incr_top(L);
235  }
236  }
237  lua_unlock(L);
238  return name;
239 }
240 
241 
242 LUA_API const char *lua_setlocal (lua_State *L, const lua_Debug *ar, int n) {
243  StkId pos = NULL; /* to avoid warnings */
244  const char *name;
245  lua_lock(L);
246  name = luaG_findlocal(L, ar->i_ci, n, &pos);
247  if (name) {
248  setobjs2s(L, pos, L->top - 1);
249  L->top--; /* pop value */
250  }
251  lua_unlock(L);
252  return name;
253 }
254 
255 
256 static void funcinfo (lua_Debug *ar, Closure *cl) {
257  if (noLuaClosure(cl)) {
258  ar->source = "=[C]";
259  ar->srclen = LL("=[C]");
260  ar->linedefined = -1;
261  ar->lastlinedefined = -1;
262  ar->what = "C";
263  }
264  else {
265  const Proto *p = cl->l.p;
266  if (p->source) {
267  ar->source = getstr(p->source);
268  ar->srclen = tsslen(p->source);
269  }
270  else {
271  ar->source = "=?";
272  ar->srclen = LL("=?");
273  }
274  ar->linedefined = p->linedefined;
276  ar->what = (ar->linedefined == 0) ? "main" : "Lua";
277  }
278  luaO_chunkid(ar->short_src, ar->source, ar->srclen);
279 }
280 
281 
282 static int nextline (const Proto *p, int currentline, int pc) {
283  if (p->lineinfo[pc] != ABSLINEINFO)
284  return currentline + p->lineinfo[pc];
285  else
286  return luaG_getfuncline(p, pc);
287 }
288 
289 
290 static void collectvalidlines (lua_State *L, Closure *f) {
291  if (noLuaClosure(f)) {
292  setnilvalue(s2v(L->top));
293  api_incr_top(L);
294  }
295  else {
296  int i;
297  TValue v;
298  const Proto *p = f->l.p;
299  int currentline = p->linedefined;
300  Table *t = luaH_new(L); /* new table to store active lines */
301  sethvalue2s(L, L->top, t); /* push it on stack */
302  api_incr_top(L);
303  setbtvalue(&v); /* boolean 'true' to be the value of all indices */
304  for (i = 0; i < p->sizelineinfo; i++) { /* for all instructions */
305  currentline = nextline(p, currentline, i); /* get its line */
306  luaH_setint(L, t, currentline, &v); /* table[line] = true */
307  }
308  }
309 }
310 
311 
312 static const char *getfuncname (lua_State *L, CallInfo *ci, const char **name) {
313  if (ci == NULL) /* no 'ci'? */
314  return NULL; /* no info */
315  else if (ci->callstatus & CIST_FIN) { /* is this a finalizer? */
316  *name = "__gc";
317  return "metamethod"; /* report it as such */
318  }
319  /* calling function is a known Lua function? */
320  else if (!(ci->callstatus & CIST_TAIL) && isLua(ci->previous))
321  return funcnamefromcode(L, ci->previous, name);
322  else return NULL; /* no way to find a name */
323 }
324 
325 
326 static int auxgetinfo (lua_State *L, const char *what, lua_Debug *ar,
327  Closure *f, CallInfo *ci) {
328  int status = 1;
329  for (; *what; what++) {
330  switch (*what) {
331  case 'S': {
332  funcinfo(ar, f);
333  break;
334  }
335  case 'l': {
336  ar->currentline = (ci && isLua(ci)) ? getcurrentline(ci) : -1;
337  break;
338  }
339  case 'u': {
340  ar->nups = (f == NULL) ? 0 : f->c.nupvalues;
341  if (noLuaClosure(f)) {
342  ar->isvararg = 1;
343  ar->nparams = 0;
344  }
345  else {
346  ar->isvararg = f->l.p->is_vararg;
347  ar->nparams = f->l.p->numparams;
348  }
349  break;
350  }
351  case 't': {
352  ar->istailcall = (ci) ? ci->callstatus & CIST_TAIL : 0;
353  break;
354  }
355  case 'n': {
356  ar->namewhat = getfuncname(L, ci, &ar->name);
357  if (ar->namewhat == NULL) {
358  ar->namewhat = ""; /* not found */
359  ar->name = NULL;
360  }
361  break;
362  }
363  case 'r': {
364  if (ci == NULL || !(ci->callstatus & CIST_TRAN))
365  ar->ftransfer = ar->ntransfer = 0;
366  else {
367  ar->ftransfer = ci->u2.transferinfo.ftransfer;
368  ar->ntransfer = ci->u2.transferinfo.ntransfer;
369  }
370  break;
371  }
372  case 'L':
373  case 'f': /* handled by lua_getinfo */
374  break;
375  default: status = 0; /* invalid option */
376  }
377  }
378  return status;
379 }
380 
381 
382 LUA_API int lua_getinfo (lua_State *L, const char *what, lua_Debug *ar) {
383  int status;
384  Closure *cl;
385  CallInfo *ci;
386  TValue *func;
387  lua_lock(L);
388  if (*what == '>') {
389  ci = NULL;
390  func = s2v(L->top - 1);
391  api_check(L, ttisfunction(func), "function expected");
392  what++; /* skip the '>' */
393  L->top--; /* pop function */
394  }
395  else {
396  ci = ar->i_ci;
397  func = s2v(ci->func);
398  lua_assert(ttisfunction(func));
399  }
400  cl = ttisclosure(func) ? clvalue(func) : NULL;
401  status = auxgetinfo(L, what, ar, cl, ci);
402  if (strchr(what, 'f')) {
403  setobj2s(L, L->top, func);
404  api_incr_top(L);
405  }
406  if (strchr(what, 'L'))
407  collectvalidlines(L, cl);
408  lua_unlock(L);
409  return status;
410 }
411 
412 
413 /*
414 ** {======================================================
415 ** Symbolic Execution
416 ** =======================================================
417 */
418 
419 static const char *getobjname (const Proto *p, int lastpc, int reg,
420  const char **name);
421 
422 
423 /*
424 ** Find a "name" for the constant 'c'.
425 */
426 static void kname (const Proto *p, int c, const char **name) {
427  TValue *kvalue = &p->k[c];
428  *name = (ttisstring(kvalue)) ? svalue(kvalue) : "?";
429 }
430 
431 
432 /*
433 ** Find a "name" for the register 'c'.
434 */
435 static void rname (const Proto *p, int pc, int c, const char **name) {
436  const char *what = getobjname(p, pc, c, name); /* search for 'c' */
437  if (!(what && *what == 'c')) /* did not find a constant name? */
438  *name = "?";
439 }
440 
441 
442 /*
443 ** Find a "name" for a 'C' value in an RK instruction.
444 */
445 static void rkname (const Proto *p, int pc, Instruction i, const char **name) {
446  int c = GETARG_C(i); /* key index */
447  if (GETARG_k(i)) /* is 'c' a constant? */
448  kname(p, c, name);
449  else /* 'c' is a register */
450  rname(p, pc, c, name);
451 }
452 
453 
454 static int filterpc (int pc, int jmptarget) {
455  if (pc < jmptarget) /* is code conditional (inside a jump)? */
456  return -1; /* cannot know who sets that register */
457  else return pc; /* current position sets that register */
458 }
459 
460 
461 /*
462 ** Try to find last instruction before 'lastpc' that modified register 'reg'.
463 */
464 static int findsetreg (const Proto *p, int lastpc, int reg) {
465  int pc;
466  int setreg = -1; /* keep last instruction that changed 'reg' */
467  int jmptarget = 0; /* any code before this address is conditional */
468  if (testMMMode(GET_OPCODE(p->code[lastpc])))
469  lastpc--; /* previous instruction was not actually executed */
470  for (pc = 0; pc < lastpc; pc++) {
471  Instruction i = p->code[pc];
472  OpCode op = GET_OPCODE(i);
473  int a = GETARG_A(i);
474  int change; /* true if current instruction changed 'reg' */
475  switch (op) {
476  case OP_LOADNIL: { /* set registers from 'a' to 'a+b' */
477  int b = GETARG_B(i);
478  change = (a <= reg && reg <= a + b);
479  break;
480  }
481  case OP_TFORCALL: { /* affect all regs above its base */
482  change = (reg >= a + 2);
483  break;
484  }
485  case OP_CALL:
486  case OP_TAILCALL: { /* affect all registers above base */
487  change = (reg >= a);
488  break;
489  }
490  case OP_JMP: { /* doesn't change registers, but changes 'jmptarget' */
491  int b = GETARG_sJ(i);
492  int dest = pc + 1 + b;
493  /* jump does not skip 'lastpc' and is larger than current one? */
494  if (dest <= lastpc && dest > jmptarget)
495  jmptarget = dest; /* update 'jmptarget' */
496  change = 0;
497  break;
498  }
499  default: /* any instruction that sets A */
500  change = (testAMode(op) && reg == a);
501  break;
502  }
503  if (change)
504  setreg = filterpc(pc, jmptarget);
505  }
506  return setreg;
507 }
508 
509 
510 /*
511 ** Check whether table being indexed by instruction 'i' is the
512 ** environment '_ENV'
513 */
514 static const char *gxf (const Proto *p, int pc, Instruction i, int isup) {
515  int t = GETARG_B(i); /* table index */
516  const char *name; /* name of indexed variable */
517  if (isup) /* is an upvalue? */
518  name = upvalname(p, t);
519  else
520  getobjname(p, pc, t, &name);
521  return (name && strcmp(name, LUA_ENV) == 0) ? "global" : "field";
522 }
523 
524 
525 static const char *getobjname (const Proto *p, int lastpc, int reg,
526  const char **name) {
527  int pc;
528  *name = luaF_getlocalname(p, reg + 1, lastpc);
529  if (*name) /* is a local? */
530  return "local";
531  /* else try symbolic execution */
532  pc = findsetreg(p, lastpc, reg);
533  if (pc != -1) { /* could find instruction? */
534  Instruction i = p->code[pc];
535  OpCode op = GET_OPCODE(i);
536  switch (op) {
537  case OP_MOVE: {
538  int b = GETARG_B(i); /* move from 'b' to 'a' */
539  if (b < GETARG_A(i))
540  return getobjname(p, pc, b, name); /* get name for 'b' */
541  break;
542  }
543  case OP_GETTABUP: {
544  int k = GETARG_C(i); /* key index */
545  kname(p, k, name);
546  return gxf(p, pc, i, 1);
547  }
548  case OP_GETTABLE: {
549  int k = GETARG_C(i); /* key index */
550  rname(p, pc, k, name);
551  return gxf(p, pc, i, 0);
552  }
553  case OP_GETI: {
554  *name = "integer index";
555  return "field";
556  }
557  case OP_GETFIELD: {
558  int k = GETARG_C(i); /* key index */
559  kname(p, k, name);
560  return gxf(p, pc, i, 0);
561  }
562  case OP_GETUPVAL: {
563  *name = upvalname(p, GETARG_B(i));
564  return "upvalue";
565  }
566  case OP_LOADK:
567  case OP_LOADKX: {
568  int b = (op == OP_LOADK) ? GETARG_Bx(i)
569  : GETARG_Ax(p->code[pc + 1]);
570  if (ttisstring(&p->k[b])) {
571  *name = svalue(&p->k[b]);
572  return "constant";
573  }
574  break;
575  }
576  case OP_SELF: {
577  rkname(p, pc, i, name);
578  return "method";
579  }
580  default: break; /* go through to return NULL */
581  }
582  }
583  return NULL; /* could not find reasonable name */
584 }
585 
586 
587 /*
588 ** Try to find a name for a function based on the code that called it.
589 ** (Only works when function was called by a Lua function.)
590 ** Returns what the name is (e.g., "for iterator", "method",
591 ** "metamethod") and sets '*name' to point to the name.
592 */
593 static const char *funcnamefromcode (lua_State *L, CallInfo *ci,
594  const char **name) {
595  TMS tm = (TMS)0; /* (initial value avoids warnings) */
596  const Proto *p = ci_func(ci)->p; /* calling function */
597  int pc = currentpc(ci); /* calling instruction index */
598  Instruction i = p->code[pc]; /* calling instruction */
599  if (ci->callstatus & CIST_HOOKED) { /* was it called inside a hook? */
600  *name = "?";
601  return "hook";
602  }
603  switch (GET_OPCODE(i)) {
604  case OP_CALL:
605  case OP_TAILCALL:
606  return getobjname(p, pc, GETARG_A(i), name); /* get function name */
607  case OP_TFORCALL: { /* for iterator */
608  *name = "for iterator";
609  return "for iterator";
610  }
611  /* other instructions can do calls through metamethods */
612  case OP_SELF: case OP_GETTABUP: case OP_GETTABLE:
613  case OP_GETI: case OP_GETFIELD:
614  tm = TM_INDEX;
615  break;
616  case OP_SETTABUP: case OP_SETTABLE: case OP_SETI: case OP_SETFIELD:
617  tm = TM_NEWINDEX;
618  break;
619  case OP_MMBIN: case OP_MMBINI: case OP_MMBINK: {
620  tm = cast(TMS, GETARG_C(i));
621  break;
622  }
623  case OP_UNM: tm = TM_UNM; break;
624  case OP_BNOT: tm = TM_BNOT; break;
625  case OP_LEN: tm = TM_LEN; break;
626  case OP_CONCAT: tm = TM_CONCAT; break;
627  case OP_EQ: tm = TM_EQ; break;
628  /* no cases for OP_EQI and OP_EQK, as they don't call metamethods */
629  case OP_LT: case OP_LTI: case OP_GTI: tm = TM_LT; break;
630  case OP_LE: case OP_LEI: case OP_GEI: tm = TM_LE; break;
631  case OP_CLOSE: case OP_RETURN: tm = TM_CLOSE; break;
632  default:
633  return NULL; /* cannot find a reasonable name */
634  }
635  *name = getstr(G(L)->tmname[tm]) + 2;
636  return "metamethod";
637 }
638 
639 /* }====================================================== */
640 
641 
642 
643 /*
644 ** Check whether pointer 'o' points to some value in the stack
645 ** frame of the current function. Because 'o' may not point to a
646 ** value in this stack, we cannot compare it with the region
647 ** boundaries (undefined behaviour in ISO C).
648 */
649 static int isinstack (CallInfo *ci, const TValue *o) {
650  StkId pos;
651  for (pos = ci->func + 1; pos < ci->top; pos++) {
652  if (o == s2v(pos))
653  return 1;
654  }
655  return 0; /* not found */
656 }
657 
658 
659 /*
660 ** Checks whether value 'o' came from an upvalue. (That can only happen
661 ** with instructions OP_GETTABUP/OP_SETTABUP, which operate directly on
662 ** upvalues.)
663 */
664 static const char *getupvalname (CallInfo *ci, const TValue *o,
665  const char **name) {
666  LClosure *c = ci_func(ci);
667  int i;
668  for (i = 0; i < c->nupvalues; i++) {
669  if (c->upvals[i]->v == o) {
670  *name = upvalname(c->p, i);
671  return "upvalue";
672  }
673  }
674  return NULL;
675 }
676 
677 
678 static const char *varinfo (lua_State *L, const TValue *o) {
679  const char *name = NULL; /* to avoid warnings */
680  CallInfo *ci = L->ci;
681  const char *kind = NULL;
682  if (isLua(ci)) {
683  kind = getupvalname(ci, o, &name); /* check whether 'o' is an upvalue */
684  if (!kind && isinstack(ci, o)) /* no? try a register */
685  kind = getobjname(ci_func(ci)->p, currentpc(ci),
686  cast_int(cast(StkId, o) - (ci->func + 1)), &name);
687  }
688  return (kind) ? luaO_pushfstring(L, " (%s '%s')", kind, name) : "";
689 }
690 
691 
692 l_noret luaG_typeerror (lua_State *L, const TValue *o, const char *op) {
693  const char *t = luaT_objtypename(L, o);
694  luaG_runerror(L, "attempt to %s a %s value%s", op, t, varinfo(L, o));
695 }
696 
697 
699  CallInfo *ci = L->ci;
700  const char *name = NULL; /* to avoid warnings */
701  const char *what = (isLua(ci)) ? funcnamefromcode(L, ci, &name) : NULL;
702  if (what != NULL) {
703  const char *t = luaT_objtypename(L, o);
704  luaG_runerror(L, "%s '%s' is not callable (a %s value)", what, name, t);
705  }
706  else
707  luaG_typeerror(L, o, "call");
708 }
709 
710 
711 l_noret luaG_forerror (lua_State *L, const TValue *o, const char *what) {
712  luaG_runerror(L, "bad 'for' %s (number expected, got %s)",
713  what, luaT_objtypename(L, o));
714 }
715 
716 
717 l_noret luaG_concaterror (lua_State *L, const TValue *p1, const TValue *p2) {
718  if (ttisstring(p1) || cvt2str(p1)) p1 = p2;
719  luaG_typeerror(L, p1, "concatenate");
720 }
721 
722 
724  const TValue *p2, const char *msg) {
725  if (!ttisnumber(p1)) /* first operand is wrong? */
726  p2 = p1; /* now second is wrong */
727  luaG_typeerror(L, p2, msg);
728 }
729 
730 
731 /*
732 ** Error when both values are convertible to numbers, but not to integers
733 */
734 l_noret luaG_tointerror (lua_State *L, const TValue *p1, const TValue *p2) {
735  lua_Integer temp;
736  if (!luaV_tointegerns(p1, &temp, LUA_FLOORN2I))
737  p2 = p1;
738  luaG_runerror(L, "number%s has no integer representation", varinfo(L, p2));
739 }
740 
741 
742 l_noret luaG_ordererror (lua_State *L, const TValue *p1, const TValue *p2) {
743  const char *t1 = luaT_objtypename(L, p1);
744  const char *t2 = luaT_objtypename(L, p2);
745  if (strcmp(t1, t2) == 0)
746  luaG_runerror(L, "attempt to compare two %s values", t1);
747  else
748  luaG_runerror(L, "attempt to compare %s with %s", t1, t2);
749 }
750 
751 
752 /* add src:line information to 'msg' */
753 const char *luaG_addinfo (lua_State *L, const char *msg, TString *src,
754  int line) {
755  char buff[LUA_IDSIZE];
756  if (src)
757  luaO_chunkid(buff, getstr(src), tsslen(src));
758  else { /* no source available; use "?" instead */
759  buff[0] = '?'; buff[1] = '\0';
760  }
761  return luaO_pushfstring(L, "%s:%d: %s", buff, line, msg);
762 }
763 
764 
766  if (L->errfunc != 0) { /* is there an error handling function? */
767  StkId errfunc = restorestack(L, L->errfunc);
768  lua_assert(ttisfunction(s2v(errfunc)));
769  setobjs2s(L, L->top, L->top - 1); /* move argument */
770  setobjs2s(L, L->top - 1, errfunc); /* push function */
771  L->top++; /* assume EXTRA_STACK */
772  luaD_callnoyield(L, L->top - 2, 1); /* call it */
773  }
775 }
776 
777 
778 l_noret luaG_runerror (lua_State *L, const char *fmt, ...) {
779  CallInfo *ci = L->ci;
780  const char *msg;
781  va_list argp;
782  luaC_checkGC(L); /* error message uses memory */
783  va_start(argp, fmt);
784  msg = luaO_pushvfstring(L, fmt, argp); /* format message */
785  va_end(argp);
786  if (isLua(ci)) /* if Lua function, add source:line information */
787  luaG_addinfo(L, msg, ci_func(ci)->p->source, getcurrentline(ci));
788  luaG_errormsg(L);
789 }
790 
791 
792 /*
793 ** Check whether new instruction 'newpc' is in a different line from
794 ** previous instruction 'oldpc'. More often than not, 'newpc' is only
795 ** one or a few instructions after 'oldpc' (it must be after, see
796 ** caller), so try to avoid calling 'luaG_getfuncline'. If they are
797 ** too far apart, there is a good chance of a ABSLINEINFO in the way,
798 ** so it goes directly to 'luaG_getfuncline'.
799 */
800 static int changedline (const Proto *p, int oldpc, int newpc) {
801  if (p->lineinfo == NULL) /* no debug information? */
802  return 0;
803  if (newpc - oldpc < MAXIWTHABS / 2) { /* not too far apart? */
804  int delta = 0; /* line diference */
805  int pc = oldpc;
806  for (;;) {
807  int lineinfo = p->lineinfo[++pc];
808  if (lineinfo == ABSLINEINFO)
809  break; /* cannot compute delta; fall through */
810  delta += lineinfo;
811  if (pc == newpc)
812  return (delta != 0); /* delta computed successfully */
813  }
814  }
815  /* either instructions are too far apart or there is an absolute line
816  info in the way; compute line difference explicitly */
817  return (luaG_getfuncline(p, oldpc) != luaG_getfuncline(p, newpc));
818 }
819 
820 
821 /*
822 ** Traces the execution of a Lua function. Called before the execution
823 ** of each opcode, when debug is on. 'L->oldpc' stores the last
824 ** instruction traced, to detect line changes. When entering a new
825 ** function, 'npci' will be zero and will test as a new line whatever
826 ** the value of 'oldpc'. Some exceptional conditions may return to
827 ** a function without setting 'oldpc'. In that case, 'oldpc' may be
828 ** invalid; if so, use zero as a valid value. (A wrong but valid 'oldpc'
829 ** at most causes an extra call to a line hook.)
830 ** This function is not "Protected" when called, so it should correct
831 ** 'L->top' before calling anything that can run the GC.
832 */
833 int luaG_traceexec (lua_State *L, const Instruction *pc) {
834  CallInfo *ci = L->ci;
835  lu_byte mask = L->hookmask;
836  const Proto *p = ci_func(ci)->p;
837  int counthook;
838  if (!(mask & (LUA_MASKLINE | LUA_MASKCOUNT))) { /* no hooks? */
839  ci->u.l.trap = 0; /* don't need to stop again */
840  return 0; /* turn off 'trap' */
841  }
842  pc++; /* reference is always next instruction */
843  ci->u.l.savedpc = pc; /* save 'pc' */
844  counthook = (--L->hookcount == 0 && (mask & LUA_MASKCOUNT));
845  if (counthook)
846  resethookcount(L); /* reset count */
847  else if (!(mask & LUA_MASKLINE))
848  return 1; /* no line hook and count != 0; nothing to be done now */
849  if (ci->callstatus & CIST_HOOKYIELD) { /* called hook last time? */
850  ci->callstatus &= ~CIST_HOOKYIELD; /* erase mark */
851  return 1; /* do not call hook again (VM yielded, so it did not move) */
852  }
853  if (!isIT(*(ci->u.l.savedpc - 1))) /* top not being used? */
854  L->top = ci->top; /* correct top */
855  if (counthook)
856  luaD_hook(L, LUA_HOOKCOUNT, -1, 0, 0); /* call count hook */
857  if (mask & LUA_MASKLINE) {
858  /* 'L->oldpc' may be invalid; use zero in this case */
859  int oldpc = (L->oldpc < p->sizecode) ? L->oldpc : 0;
860  int npci = pcRel(pc, p);
861  if (npci <= oldpc || /* call hook when jump back (loop), */
862  changedline(p, oldpc, npci)) { /* or when enter new line */
863  int newline = luaG_getfuncline(p, npci);
864  luaD_hook(L, LUA_HOOKLINE, newline, 0, 0); /* call line hook */
865  }
866  L->oldpc = npci; /* 'pc' of last call to line hook */
867  }
868  if (L->status == LUA_YIELD) { /* did hook yield? */
869  if (counthook)
870  L->hookcount = 1; /* undo decrement to zero */
871  ci->u.l.savedpc--; /* undo increment (resume will increment it again) */
872  ci->callstatus |= CIST_HOOKYIELD; /* mark that it yielded */
873  luaD_throw(L, LUA_YIELD);
874  }
875  return 1; /* keep 'trap' on */
876 }
877 
LUA_IDSIZE
#define LUA_IDSIZE
Definition: luaconf.h:757
luaF_getlocalname
const char * luaF_getlocalname(const Proto *f, int local_number, int pc)
Definition: lfunc.c:283
lua_gethookcount
LUA_API int lua_gethookcount(lua_State *L)
Definition: ldebug.c:155
lua_Debug::name
const char * name
Definition: lua.h:472
setobjs2s
#define setobjs2s(L, o1, o2)
Definition: lobject.h:127
s2v
#define s2v(o)
Definition: lobject.h:159
resethookcount
#define resethookcount(L)
Definition: ldebug.h:21
CallInfo::u
union CallInfo::@12 u
lua_Debug::what
const char * what
Definition: lua.h:474
CallInfo::previous
struct CallInfo * previous
Definition: lstate.h:175
LClosure::p
struct Proto * p
Definition: lobject.h:643
op
#define op
lua_assert
#define lua_assert(c)
Definition: lauxlib.h:170
sol::stack::top
int top(lua_State *L)
Definition: sol.hpp:11684
isinstack
static int isinstack(CallInfo *ci, const TValue *o)
Definition: ldebug.c:649
Proto::linedefined
int linedefined
Definition: lobject.h:551
LClosure
Definition: lobject.h:641
OP_SELF
@ OP_SELF
Definition: lopcodes.h:224
cast_byte
#define cast_byte(i)
Definition: llimits.h:130
l_noret
#define l_noret
Definition: llimits.h:162
getcurrentline
static int getcurrentline(CallInfo *ci)
Definition: ldebug.c:98
cast
#define cast(t, exp)
Definition: llimits.h:123
TString
Definition: lobject.h:373
GETARG_Bx
#define GETARG_Bx(i)
Definition: lopcodes.h:140
Closure
Definition: lobject.h:648
funcinfo
static void funcinfo(lua_Debug *ar, Closure *cl)
Definition: ldebug.c:256
lua_State::errfunc
ptrdiff_t errfunc
Definition: lstate.h:321
CallInfo::transferinfo
struct CallInfo::@13::@16 transferinfo
LUA_ENV
#define LUA_ENV
Definition: llex.h:24
lstate.h
GETARG_B
#define GETARG_B(i)
Definition: lopcodes.h:128
CIST_HOOKED
#define CIST_HOOKED
Definition: lstate.h:208
OP_TAILCALL
@ OP_TAILCALL
Definition: lopcodes.h:286
LClosure::upvals
UpVal * upvals[1]
Definition: lobject.h:644
lcode.h
tmname
static TString ** tmname
Definition: luac.c:40
CallInfo::next
struct CallInfo * next
Definition: lstate.h:175
OP_CALL
@ OP_CALL
Definition: lopcodes.h:285
lua_State::status
lu_byte status
Definition: lstate.h:306
api_incr_top
#define api_incr_top(L)
Definition: lapi.h:16
Proto::code
Instruction * code
Definition: lobject.h:554
CallInfo::func
StkId func
Definition: lstate.h:173
ttisfunction
#define ttisfunction(o)
Definition: lobject.h:581
LUA_HOOKCOUNT
#define LUA_HOOKCOUNT
Definition: lua.h:433
OP_GETUPVAL
@ OP_GETUPVAL
Definition: lopcodes.h:209
s
XmlRpcServer s
GETARG_A
#define GETARG_A(i)
Definition: lopcodes.h:125
luaG_ordererror
l_noret luaG_ordererror(lua_State *L, const TValue *p1, const TValue *p2)
Definition: ldebug.c:742
StackValue
Definition: lobject.h:146
isIT
#define isIT(i)
Definition: lopcodes.h:383
ltable.h
luaC_checkGC
#define luaC_checkGC(L)
Definition: lgc.h:162
lua_getinfo
LUA_API int lua_getinfo(lua_State *L, const char *what, lua_Debug *ar)
Definition: ldebug.c:382
lua_getlocal
const LUA_API char * lua_getlocal(lua_State *L, const lua_Debug *ar, int n)
Definition: ldebug.c:220
rname
static void rname(const Proto *p, int pc, int c, const char **name)
Definition: ldebug.c:435
LUA_MASKLINE
#define LUA_MASKLINE
Definition: lua.h:442
lua_unlock
#define lua_unlock(L)
Definition: llimits.h:238
Proto::source
TString * source
Definition: lobject.h:560
lua_State::top
StkId top
Definition: lstate.h:309
luaG_runerror
l_noret luaG_runerror(lua_State *L, const char *fmt,...)
Definition: ldebug.c:778
OP_CONCAT
@ OP_CONCAT
Definition: lopcodes.h:266
restorestack
#define restorestack(L, n)
Definition: ldo.h:36
CIST_TAIL
#define CIST_TAIL
Definition: lstate.h:210
upvalname
static const char * upvalname(const Proto *p, int uv)
Definition: ldebug.c:177
Proto::sizecode
int sizecode
Definition: lobject.h:546
kname
static void kname(const Proto *p, int c, const char **name)
Definition: ldebug.c:426
Closure::l
LClosure l
Definition: lobject.h:650
getobjname
static const char * getobjname(const Proto *p, int lastpc, int reg, const char **name)
Definition: ldebug.c:525
OP_BNOT
@ OP_BNOT
Definition: lopcodes.h:262
OP_LTI
@ OP_LTI
Definition: lopcodes.h:277
lua_State::basehookcount
int basehookcount
Definition: lstate.h:324
TM_INDEX
@ TM_INDEX
Definition: ltm.h:19
luaG_findlocal
const char * luaG_findlocal(lua_State *L, CallInfo *ci, int n, StkId *pos)
Definition: ldebug.c:196
filterpc
static int filterpc(int pc, int jmptarget)
Definition: ldebug.c:454
CallInfo::top
StkId top
Definition: lstate.h:174
Proto::sizelineinfo
int sizelineinfo
Definition: lobject.h:547
TM_NEWINDEX
@ TM_NEWINDEX
Definition: ltm.h:20
cast_uint
#define cast_uint(i)
Definition: llimits.h:129
TMS
TMS
Definition: ltm.h:18
ttisclosure
#define ttisclosure(o)
Definition: lobject.h:585
Proto::lastlinedefined
int lastlinedefined
Definition: lobject.h:552
currentpc
static int currentpc(CallInfo *ci)
Definition: ldebug.c:41
lua_Debug::i_ci
struct CallInfo * i_ci
Definition: lua.h:488
ltm.h
lua_Debug::nups
unsigned char nups
Definition: lua.h:480
GETARG_k
#define GETARG_k(i)
Definition: lopcodes.h:137
mqtt_test_proto.msg
msg
Definition: mqtt_test_proto.py:43
CIST_HOOKYIELD
#define CIST_HOOKYIELD
Definition: lstate.h:211
OP_LE
@ OP_LE
Definition: lopcodes.h:273
luaG_tointerror
l_noret luaG_tointerror(lua_State *L, const TValue *p1, const TValue *p2)
Definition: ldebug.c:734
luaD_callnoyield
void luaD_callnoyield(lua_State *L, StkId func, int nResults)
Definition: ldo.c:594
clvalue
#define clvalue(o)
Definition: lobject.h:590
lua_Debug::namewhat
const char * namewhat
Definition: lua.h:473
TM_UNM
@ TM_UNM
Definition: ltm.h:37
OP_UNM
@ OP_UNM
Definition: lopcodes.h:261
OP_MOVE
@ OP_MOVE
Definition: lopcodes.h:200
GETARG_sJ
#define GETARG_sJ(i)
Definition: lopcodes.h:150
f
f
lua_Debug::source
const char * source
Definition: lua.h:475
varinfo
static const char * varinfo(lua_State *L, const TValue *o)
Definition: ldebug.c:678
settraps
static void settraps(CallInfo *ci)
Definition: ldebug.c:114
luaD_hook
void luaD_hook(lua_State *L, int event, int line, int ftransfer, int ntransfer)
Definition: ldo.c:306
setnilvalue
#define setnilvalue(obj)
Definition: lobject.h:187
CallInfo::callstatus
unsigned short callstatus
Definition: lstate.h:198
lua.h
LL
#define LL(x)
Definition: llimits.h:70
OP_CLOSE
@ OP_CLOSE
Definition: lopcodes.h:268
OP_GETI
@ OP_GETI
Definition: lopcodes.h:214
lua_Debug::srclen
size_t srclen
Definition: lua.h:476
lua_Debug::short_src
char short_src[LUA_IDSIZE]
Definition: lua.h:486
LUA_MASKCOUNT
#define LUA_MASKCOUNT
Definition: lua.h:443
getupvalname
static const char * getupvalname(CallInfo *ci, const TValue *o, const char **name)
Definition: ldebug.c:664
luaT_objtypename
const char * luaT_objtypename(lua_State *L, const TValue *o)
Definition: ltm.c:91
lua_gethookmask
LUA_API int lua_gethookmask(lua_State *L)
Definition: ldebug.c:150
lua_Debug::ntransfer
unsigned short ntransfer
Definition: lua.h:485
lua_State::hookcount
int hookcount
Definition: lstate.h:325
changedline
static int changedline(const Proto *p, int oldpc, int newpc)
Definition: ldebug.c:800
detail::count
constexpr auto count() -> size_t
Definition: core.h:1222
luaG_traceexec
int luaG_traceexec(lua_State *L, const Instruction *pc)
Definition: ldebug.c:833
OP_SETI
@ OP_SETI
Definition: lopcodes.h:219
TM_BNOT
@ TM_BNOT
Definition: ltm.h:38
nextline
static int nextline(const Proto *p, int currentline, int pc)
Definition: ldebug.c:282
OP_GEI
@ OP_GEI
Definition: lopcodes.h:280
OP_MMBINI
@ OP_MMBINI
Definition: lopcodes.h:258
lvm.h
lua_Debug::istailcall
char istailcall
Definition: lua.h:483
ci_func
#define ci_func(ci)
Definition: ldebug.h:18
G
#define G(L)
Definition: lstate.h:330
lua_sethook
LUA_API void lua_sethook(lua_State *L, lua_Hook func, int mask, int count)
Definition: ldebug.c:131
gxf
static const char * gxf(const Proto *p, int pc, Instruction i, int isup)
Definition: ldebug.c:514
collectvalidlines
static void collectvalidlines(lua_State *L, Closure *f)
Definition: ldebug.c:290
lprefix.h
luaG_typeerror
l_noret luaG_typeerror(lua_State *L, const TValue *o, const char *op)
Definition: ldebug.c:692
OP_SETTABLE
@ OP_SETTABLE
Definition: lopcodes.h:218
lua_Debug::lastlinedefined
int lastlinedefined
Definition: lua.h:479
ldebug.h
lua_lock
#define lua_lock(L)
Definition: llimits.h:237
lu_byte
unsigned char lu_byte
Definition: llimits.h:36
getstr
#define getstr(ts)
Definition: lobject.h:390
luaO_chunkid
void luaO_chunkid(char *out, const char *source, size_t srclen)
Definition: lobject.c:557
LUA_HOOKLINE
#define LUA_HOOKLINE
Definition: lua.h:432
lua_State
Definition: lstate.h:304
lua_State::oldpc
int oldpc
Definition: lstate.h:323
LUA_API
#define LUA_API
Definition: luaconf.h:282
clLvalue
#define clLvalue(o)
Definition: lobject.h:591
lua_Hook
void(* lua_Hook)(lua_State *L, lua_Debug *ar)
Definition: lua.h:449
TM_LT
@ TM_LT
Definition: ltm.h:39
noLuaClosure
#define noLuaClosure(f)
Definition: ldebug.c:34
lua_getstack
LUA_API int lua_getstack(lua_State *L, int level, lua_Debug *ar)
Definition: ldebug.c:160
Proto
Definition: lobject.h:539
OP_LOADK
@ OP_LOADK
Definition: lopcodes.h:203
lua_Debug::isvararg
char isvararg
Definition: lua.h:482
TM_LEN
@ TM_LEN
Definition: ltm.h:23
lobject.h
luaH_new
Table * luaH_new(lua_State *L)
Definition: ltable.c:615
CallInfo::u2
union CallInfo::@13 u2
lua_Integer
LUA_INTEGER lua_Integer
Definition: lua.h:94
lua_State::base_ci
CallInfo base_ci
Definition: lstate.h:319
LUA_FLOORN2I
#define LUA_FLOORN2I
Definition: lvm.h:36
GETARG_Ax
#define GETARG_Ax(i)
Definition: lopcodes.h:143
lua_State::ci
CallInfo * ci
Definition: lstate.h:311
UpVal::v
TValue * v
Definition: lobject.h:619
tsslen
#define tsslen(s)
Definition: lobject.h:397
TM_EQ
@ TM_EQ
Definition: ltm.h:24
luaG_opinterror
l_noret luaG_opinterror(lua_State *L, const TValue *p1, const TValue *p2, const char *msg)
Definition: ldebug.c:723
pcRel
#define pcRel(pc, p)
Definition: ldebug.h:14
getfuncname
static const char * getfuncname(lua_State *L, CallInfo *ci, const char **name)
Definition: ldebug.c:312
LUA_YIELD
#define LUA_YIELD
Definition: lua.h:50
luaO_pushfstring
const char * luaO_pushfstring(lua_State *L, const char *fmt,...)
Definition: lobject.c:539
dest
char * dest
Definition: lz4.h:765
OP_GETFIELD
@ OP_GETFIELD
Definition: lopcodes.h:215
lua_gethook
LUA_API lua_Hook lua_gethook(lua_State *L)
Definition: ldebug.c:145
Instruction
l_uint32 Instruction
Definition: llimits.h:178
lua_State::hookmask
volatile l_signalT hookmask
Definition: lstate.h:326
OP_LEN
@ OP_LEN
Definition: lopcodes.h:264
Proto::k
TValue * k
Definition: lobject.h:553
luaH_setint
void luaH_setint(lua_State *L, Table *t, lua_Integer key, TValue *value)
Definition: ltable.c:819
OpCode
OpCode
Definition: lopcodes.h:196
CIST_TRAN
#define CIST_TRAN
Definition: lstate.h:213
luaO_pushvfstring
const char * luaO_pushvfstring(lua_State *L, const char *fmt, va_list argp)
Definition: lobject.c:470
OP_LOADKX
@ OP_LOADKX
Definition: lopcodes.h:204
luaG_concaterror
l_noret luaG_concaterror(lua_State *L, const TValue *p1, const TValue *p2)
Definition: ldebug.c:717
lua_Debug::currentline
int currentline
Definition: lua.h:477
luaD_throw
l_noret luaD_throw(lua_State *L, int errcode)
Definition: ldo.c:115
OP_SETFIELD
@ OP_SETFIELD
Definition: lopcodes.h:220
funcnamefromcode
static const char * funcnamefromcode(lua_State *L, CallInfo *ci, const char **name)
Definition: ldebug.c:593
testAMode
#define testAMode(m)
Definition: lopcodes.h:371
sethvalue2s
#define sethvalue2s(L, o, h)
Definition: lobject.h:676
findvararg
static const char * findvararg(CallInfo *ci, int n, StkId *pos)
Definition: ldebug.c:184
GET_OPCODE
#define GET_OPCODE(i)
Definition: lopcodes.h:114
testMMMode
#define testMMMode(m)
Definition: lopcodes.h:375
lua_Debug::ftransfer
unsigned short ftransfer
Definition: lua.h:484
TM_CLOSE
@ TM_CLOSE
Definition: ltm.h:43
getbaseline
static int getbaseline(const Proto *f, int pc, int *basepc)
Definition: ldebug.c:60
luaV_tointegerns
int luaV_tointegerns(const TValue *obj, lua_Integer *p, F2Imod mode)
Definition: lvm.c:137
luaG_callerror
l_noret luaG_callerror(lua_State *L, const TValue *o)
Definition: ldebug.c:698
cvt2str
#define cvt2str(o)
Definition: lvm.h:17
OP_MMBINK
@ OP_MMBINK
Definition: lopcodes.h:259
rkname
static void rkname(const Proto *p, int pc, Instruction i, const char **name)
Definition: ldebug.c:445
setobj2s
#define setobj2s(L, o1, o2)
Definition: lobject.h:129
lstring.h
luaG_addinfo
const char * luaG_addinfo(lua_State *L, const char *msg, TString *src, int line)
Definition: ldebug.c:753
OP_MMBIN
@ OP_MMBIN
Definition: lopcodes.h:257
ttisnumber
#define ttisnumber(o)
Definition: lobject.h:313
luaG_getfuncline
int luaG_getfuncline(const Proto *f, int pc)
Definition: ldebug.c:83
CallInfo
Definition: lstate.h:172
CIST_FIN
#define CIST_FIN
Definition: lstate.h:212
OP_JMP
@ OP_JMP
Definition: lopcodes.h:270
lapi.h
auxgetinfo
static int auxgetinfo(lua_State *L, const char *what, lua_Debug *ar, Closure *f, CallInfo *ci)
Definition: ldebug.c:326
LUA_ERRRUN
#define LUA_ERRRUN
Definition: lua.h:51
OP_GETTABLE
@ OP_GETTABLE
Definition: lopcodes.h:213
OP_GETTABUP
@ OP_GETTABUP
Definition: lopcodes.h:212
Proto::lineinfo
ls_byte * lineinfo
Definition: lobject.h:557
lua_Debug::nparams
unsigned char nparams
Definition: lua.h:481
OP_TFORCALL
@ OP_TFORCALL
Definition: lopcodes.h:297
lua_State::hook
volatile lua_Hook hook
Definition: lstate.h:320
api_check
#define api_check(l, e, msg)
Definition: llimits.h:113
isLua
#define isLua(ci)
Definition: lstate.h:236
Upvaldesc::name
TString * name
Definition: lobject.h:503
OP_EQ
@ OP_EQ
Definition: lopcodes.h:271
lua_Debug
Definition: lua.h:470
setbtvalue
#define setbtvalue(obj)
Definition: lobject.h:238
MAXIWTHABS
#define MAXIWTHABS
Definition: ldebug.h:35
TM_LE
@ TM_LE
Definition: ltm.h:40
TM_CONCAT
@ TM_CONCAT
Definition: ltm.h:41
GETARG_C
#define GETARG_C(i)
Definition: lopcodes.h:132
lua_Debug::linedefined
int linedefined
Definition: lua.h:478
OP_LT
@ OP_LT
Definition: lopcodes.h:272
svalue
#define svalue(o)
Definition: lobject.h:394
lua_setlocal
const LUA_API char * lua_setlocal(lua_State *L, const lua_Debug *ar, int n)
Definition: ldebug.c:242
Table
Definition: lobject.h:724
luaG_forerror
l_noret luaG_forerror(lua_State *L, const TValue *o, const char *what)
Definition: ldebug.c:711
luaG_errormsg
l_noret luaG_errormsg(lua_State *L)
Definition: ldebug.c:765
OP_LOADNIL
@ OP_LOADNIL
Definition: lopcodes.h:208
OP_LEI
@ OP_LEI
Definition: lopcodes.h:278
lopcodes.h
lfunc.h
ABSLINEINFO
#define ABSLINEINFO
Definition: ldebug.h:27
Proto::upvalues
Upvaldesc * upvalues
Definition: lobject.h:556
OP_SETTABUP
@ OP_SETTABUP
Definition: lopcodes.h:217
ldo.h
CallInfo::l
struct CallInfo::@12::@14 l
OP_RETURN
@ OP_RETURN
Definition: lopcodes.h:288
check_exp
#define check_exp(c, e)
Definition: llimits.h:102
TValue
Definition: lobject.h:65
cast_int
#define cast_int(i)
Definition: llimits.h:128
isLfunction
#define isLfunction(o)
Definition: lobject.h:588
OP_GTI
@ OP_GTI
Definition: lopcodes.h:279
ttisstring
#define ttisstring(o)
Definition: lobject.h:350
findsetreg
static int findsetreg(const Proto *p, int lastpc, int reg)
Definition: ldebug.c:464


plotjuggler
Author(s): Davide Faconti
autogenerated on Sun Aug 11 2024 02:24:23