9
3

ldebug.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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)))
  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. LUAI_FUNC int luaG_getfuncline (const Proto *f, int pc);
  19. LUAI_FUNC const char *luaG_findlocal (lua_State *L, CallInfo *ci, int n,
  20. StkId *pos);
  21. LUAI_FUNC l_noret luaG_typeerror (lua_State *L, const TValue *o,
  22. const char *opname);
  23. LUAI_FUNC l_noret luaG_forerror (lua_State *L, const TValue *o,
  24. const char *what);
  25. LUAI_FUNC l_noret luaG_concaterror (lua_State *L, const TValue *p1,
  26. const TValue *p2);
  27. LUAI_FUNC l_noret luaG_opinterror (lua_State *L, const TValue *p1,
  28. const TValue *p2,
  29. const char *msg);
  30. LUAI_FUNC l_noret luaG_tointerror (lua_State *L, const TValue *p1,
  31. const TValue *p2);
  32. LUAI_FUNC l_noret luaG_ordererror (lua_State *L, const TValue *p1,
  33. const TValue *p2);
  34. LUAI_FUNC l_noret luaG_runerror (lua_State *L, const char *fmt, ...);
  35. LUAI_FUNC const char *luaG_addinfo (lua_State *L, const char *msg,
  36. TString *src, int line);
  37. LUAI_FUNC l_noret luaG_errormsg (lua_State *L);
  38. LUAI_FUNC int luaG_traceexec (lua_State *L, const Instruction *pc);
  39. #endif