ldebug.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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. #ifdef LUA_OPTIMIZE_DEBUG
  11. # include "lvm.h"
  12. # define getline(f,pc) (((f)->packedlineinfo) ? luaG_getline((f), pc) : 0)
  13. # define INFO_FILL_BYTE 0x7F
  14. # define INFO_DELTA_MASK 0x80
  15. # define INFO_SIGN_MASK 0x40
  16. # define INFO_DELTA_6BITS 0x3F
  17. # define INFO_DELTA_7BITS 0x7F
  18. # define INFO_MAX_LINECNT 126
  19. # define lineInfoTop(fs) ((fs)->f->packedlineinfo + (fs)->lastlineOffset)
  20. #else
  21. # define getline(f,pc) (((f)->lineinfo) ? (f)->lineinfo[pc] : 0)
  22. #endif
  23. #define resethookcount(L) (L->hookcount = L->basehookcount)
  24. LUAI_FUNC void luaG_typeerror (lua_State *L, const TValue *o,
  25. const char *opname);
  26. LUAI_FUNC void luaG_concaterror (lua_State *L, StkId p1, StkId p2);
  27. LUAI_FUNC void luaG_aritherror (lua_State *L, const TValue *p1,
  28. const TValue *p2);
  29. LUAI_FUNC int luaG_ordererror (lua_State *L, const TValue *p1,
  30. const TValue *p2);
  31. LUAI_FUNC void luaG_runerror (lua_State *L, const char *fmt, ...);
  32. LUAI_FUNC void luaG_errormsg (lua_State *L);
  33. LUAI_FUNC int luaG_checkcode (const Proto *pt);
  34. LUAI_FUNC int luaG_checkopenop (Instruction i);
  35. #ifdef LUA_OPTIMIZE_DEBUG
  36. LUAI_FUNC int luaG_getline (const Proto *f, int pc);
  37. LUAI_FUNC int luaG_stripdebug (lua_State *L, Proto *f, int level, int recv);
  38. #endif
  39. #endif