ldebug.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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_callerror (lua_State *L, const TValue *o);
  24. LUAI_FUNC l_noret luaG_forerror (lua_State *L, const TValue *o,
  25. const char *what);
  26. LUAI_FUNC l_noret luaG_concaterror (lua_State *L, const TValue *p1,
  27. const TValue *p2);
  28. LUAI_FUNC l_noret luaG_opinterror (lua_State *L, const TValue *p1,
  29. const TValue *p2,
  30. const char *msg);
  31. LUAI_FUNC l_noret luaG_tointerror (lua_State *L, const TValue *p1,
  32. const TValue *p2);
  33. LUAI_FUNC l_noret luaG_ordererror (lua_State *L, const TValue *p1,
  34. const TValue *p2);
  35. LUAI_FUNC l_noret luaG_runerror (lua_State *L, const char *fmt, ...);
  36. LUAI_FUNC const char *luaG_addinfo (lua_State *L, const char *msg,
  37. TString *src, int line);
  38. LUAI_FUNC l_noret luaG_errormsg (lua_State *L);
  39. LUAI_FUNC int luaG_traceexec (lua_State *L, const Instruction *pc);
  40. #endif