xref: /freebsd-src/contrib/lua/src/ldebug.h (revision 8e3e3a7ae841ccf6f6ac30a2eeab85df5d7f04bc)
1*8e3e3a7aSWarner Losh /*
2*8e3e3a7aSWarner Losh ** $Id: ldebug.h,v 2.14 2015/05/22 17:45:56 roberto Exp $
3*8e3e3a7aSWarner Losh ** Auxiliary functions from Debug Interface module
4*8e3e3a7aSWarner Losh ** See Copyright Notice in lua.h
5*8e3e3a7aSWarner Losh */
6*8e3e3a7aSWarner Losh 
7*8e3e3a7aSWarner Losh #ifndef ldebug_h
8*8e3e3a7aSWarner Losh #define ldebug_h
9*8e3e3a7aSWarner Losh 
10*8e3e3a7aSWarner Losh 
11*8e3e3a7aSWarner Losh #include "lstate.h"
12*8e3e3a7aSWarner Losh 
13*8e3e3a7aSWarner Losh 
14*8e3e3a7aSWarner Losh #define pcRel(pc, p)	(cast(int, (pc) - (p)->code) - 1)
15*8e3e3a7aSWarner Losh 
16*8e3e3a7aSWarner Losh #define getfuncline(f,pc)	(((f)->lineinfo) ? (f)->lineinfo[pc] : -1)
17*8e3e3a7aSWarner Losh 
18*8e3e3a7aSWarner Losh #define resethookcount(L)	(L->hookcount = L->basehookcount)
19*8e3e3a7aSWarner Losh 
20*8e3e3a7aSWarner Losh 
21*8e3e3a7aSWarner Losh LUAI_FUNC l_noret luaG_typeerror (lua_State *L, const TValue *o,
22*8e3e3a7aSWarner Losh                                                 const char *opname);
23*8e3e3a7aSWarner Losh LUAI_FUNC l_noret luaG_concaterror (lua_State *L, const TValue *p1,
24*8e3e3a7aSWarner Losh                                                   const TValue *p2);
25*8e3e3a7aSWarner Losh LUAI_FUNC l_noret luaG_opinterror (lua_State *L, const TValue *p1,
26*8e3e3a7aSWarner Losh                                                  const TValue *p2,
27*8e3e3a7aSWarner Losh                                                  const char *msg);
28*8e3e3a7aSWarner Losh LUAI_FUNC l_noret luaG_tointerror (lua_State *L, const TValue *p1,
29*8e3e3a7aSWarner Losh                                                  const TValue *p2);
30*8e3e3a7aSWarner Losh LUAI_FUNC l_noret luaG_ordererror (lua_State *L, const TValue *p1,
31*8e3e3a7aSWarner Losh                                                  const TValue *p2);
32*8e3e3a7aSWarner Losh LUAI_FUNC l_noret luaG_runerror (lua_State *L, const char *fmt, ...);
33*8e3e3a7aSWarner Losh LUAI_FUNC const char *luaG_addinfo (lua_State *L, const char *msg,
34*8e3e3a7aSWarner Losh                                                   TString *src, int line);
35*8e3e3a7aSWarner Losh LUAI_FUNC l_noret luaG_errormsg (lua_State *L);
36*8e3e3a7aSWarner Losh LUAI_FUNC void luaG_traceexec (lua_State *L);
37*8e3e3a7aSWarner Losh 
38*8e3e3a7aSWarner Losh 
39*8e3e3a7aSWarner Losh #endif
40