ldebug.h 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. /*
  2. ** $Id: ldebug.h $
  3. ** Auxiliary functions from Debug Interface module
  4. ** See Copyright Notice in lua.h
  5. */
  6. #ifndef ldebug_h
  7. #define ldebug_h
  8. #include "lstate.h"
  9. #define pcRel(pc, p) (cast_int((pc) - (p)->code) - 1)
  10. /* Active Lua function (given call info) */
  11. #define ci_func(ci) (clLvalue(s2v((ci)->func.p)))
  12. #define resethookcount(L) (L->hookcount = L->basehookcount)
  13. /*
  14. ** mark for entries in 'lineinfo' array that has absolute information in
  15. ** 'abslineinfo' array
  16. */
  17. #define ABSLINEINFO (-0x80)
  18. /*
  19. ** MAXimum number of successive Instructions WiTHout ABSolute line
  20. ** information. (A power of two allows fast divisions.)
  21. */
  22. #if !defined(MAXIWTHABS)
  23. #define MAXIWTHABS 128
  24. #endif
  25. LUAI_FUNC int luaG_getfuncline (const Proto *f, int pc);
  26. LUAI_FUNC const char *luaG_findlocal (lua_State *L, CallInfo *ci, int n,
  27. StkId *pos);
  28. LUAI_FUNC l_noret luaG_typeerror (lua_State *L, const TValue *o,
  29. const char *opname);
  30. LUAI_FUNC l_noret luaG_callerror (lua_State *L, const TValue *o);
  31. LUAI_FUNC l_noret luaG_forerror (lua_State *L, const TValue *o,
  32. const char *what);
  33. LUAI_FUNC l_noret luaG_concaterror (lua_State *L, const TValue *p1,
  34. const TValue *p2);
  35. LUAI_FUNC l_noret luaG_opinterror (lua_State *L, const TValue *p1,
  36. const TValue *p2,
  37. const char *msg);
  38. LUAI_FUNC l_noret luaG_tointerror (lua_State *L, const TValue *p1,
  39. const TValue *p2);
  40. LUAI_FUNC l_noret luaG_ordererror (lua_State *L, const TValue *p1,
  41. const TValue *p2);
  42. LUAI_FUNC l_noret luaG_runerror (lua_State *L, const char *fmt, ...);
  43. LUAI_FUNC const char *luaG_addinfo (lua_State *L, const char *msg,
  44. TString *src, int line);
  45. LUAI_FUNC l_noret luaG_errormsg (lua_State *L);
  46. LUAI_FUNC int luaG_traceexec (lua_State *L, const Instruction *pc);
  47. #endif