ldebug.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /*
  2. ** $Id: ldebug.h,v 2.3.1.1 2007/12/27 13:02:25 roberto Exp $
  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. # include "lvm.h"
  11. # define getline(f,pc) (((f)->packedlineinfo) ? luaG_getline((f), pc) : 0)
  12. # define INFO_FILL_BYTE 0x7F
  13. # define INFO_DELTA_MASK 0x80
  14. # define INFO_SIGN_MASK 0x40
  15. # define INFO_DELTA_6BITS 0x3F
  16. # define INFO_DELTA_7BITS 0x7F
  17. # define INFO_MAX_LINECNT 126
  18. # define lineInfoTop(fs) ((fs)->f->packedlineinfo + (fs)->lastlineOffset)
  19. #define resethookcount(L) (L->hookcount = L->basehookcount)
  20. LUAI_FUNC void luaG_typeerror (lua_State *L, const TValue *o,
  21. const char *opname);
  22. LUAI_FUNC void luaG_concaterror (lua_State *L, StkId p1, StkId p2);
  23. LUAI_FUNC void luaG_aritherror (lua_State *L, const TValue *p1,
  24. const TValue *p2);
  25. LUAI_FUNC int luaG_ordererror (lua_State *L, const TValue *p1,
  26. const TValue *p2);
  27. LUAI_FUNC void luaG_runerror (lua_State *L, const char *fmt, ...);
  28. LUAI_FUNC void luaG_errormsg (lua_State *L);
  29. LUAI_FUNC int luaG_checkcode (const Proto *pt);
  30. LUAI_FUNC int luaG_checkopenop (Instruction i);
  31. LUAI_FUNC int luaG_getline (const Proto *f, int pc);
  32. LUAI_FUNC int luaG_stripdebug (lua_State *L, Proto *f, int level, int recv);
  33. #endif