xref: /freebsd/contrib/lua/src/ldebug.h (revision 0495ed398c4f64013bab2327eb13a303e1f90c13)
18e3e3a7aSWarner Losh /*
2*0495ed39SKyle Evans ** $Id: ldebug.h $
38e3e3a7aSWarner Losh ** Auxiliary functions from Debug Interface module
48e3e3a7aSWarner Losh ** See Copyright Notice in lua.h
58e3e3a7aSWarner Losh */
68e3e3a7aSWarner Losh 
78e3e3a7aSWarner Losh #ifndef ldebug_h
88e3e3a7aSWarner Losh #define ldebug_h
98e3e3a7aSWarner Losh 
108e3e3a7aSWarner Losh 
118e3e3a7aSWarner Losh #include "lstate.h"
128e3e3a7aSWarner Losh 
138e3e3a7aSWarner Losh 
14*0495ed39SKyle Evans #define pcRel(pc, p)	(cast_int((pc) - (p)->code) - 1)
158e3e3a7aSWarner Losh 
16*0495ed39SKyle Evans 
17*0495ed39SKyle Evans /* Active Lua function (given call info) */
18*0495ed39SKyle Evans #define ci_func(ci)		(clLvalue(s2v((ci)->func)))
19*0495ed39SKyle Evans 
208e3e3a7aSWarner Losh 
218e3e3a7aSWarner Losh #define resethookcount(L)	(L->hookcount = L->basehookcount)
228e3e3a7aSWarner Losh 
23*0495ed39SKyle Evans /*
24*0495ed39SKyle Evans ** mark for entries in 'lineinfo' array that has absolute information in
25*0495ed39SKyle Evans ** 'abslineinfo' array
26*0495ed39SKyle Evans */
27*0495ed39SKyle Evans #define ABSLINEINFO	(-0x80)
288e3e3a7aSWarner Losh 
29*0495ed39SKyle Evans LUAI_FUNC int luaG_getfuncline (const Proto *f, int pc);
30*0495ed39SKyle Evans LUAI_FUNC const char *luaG_findlocal (lua_State *L, CallInfo *ci, int n,
31*0495ed39SKyle Evans                                                     StkId *pos);
328e3e3a7aSWarner Losh LUAI_FUNC l_noret luaG_typeerror (lua_State *L, const TValue *o,
338e3e3a7aSWarner Losh                                                 const char *opname);
34*0495ed39SKyle Evans LUAI_FUNC l_noret luaG_forerror (lua_State *L, const TValue *o,
35*0495ed39SKyle Evans                                                const char *what);
368e3e3a7aSWarner Losh LUAI_FUNC l_noret luaG_concaterror (lua_State *L, const TValue *p1,
378e3e3a7aSWarner Losh                                                   const TValue *p2);
388e3e3a7aSWarner Losh LUAI_FUNC l_noret luaG_opinterror (lua_State *L, const TValue *p1,
398e3e3a7aSWarner Losh                                                  const TValue *p2,
408e3e3a7aSWarner Losh                                                  const char *msg);
418e3e3a7aSWarner Losh LUAI_FUNC l_noret luaG_tointerror (lua_State *L, const TValue *p1,
428e3e3a7aSWarner Losh                                                  const TValue *p2);
438e3e3a7aSWarner Losh LUAI_FUNC l_noret luaG_ordererror (lua_State *L, const TValue *p1,
448e3e3a7aSWarner Losh                                                  const TValue *p2);
458e3e3a7aSWarner Losh LUAI_FUNC l_noret luaG_runerror (lua_State *L, const char *fmt, ...);
468e3e3a7aSWarner Losh LUAI_FUNC const char *luaG_addinfo (lua_State *L, const char *msg,
478e3e3a7aSWarner Losh                                                   TString *src, int line);
488e3e3a7aSWarner Losh LUAI_FUNC l_noret luaG_errormsg (lua_State *L);
49*0495ed39SKyle Evans LUAI_FUNC int luaG_traceexec (lua_State *L, const Instruction *pc);
508e3e3a7aSWarner Losh 
518e3e3a7aSWarner Losh 
528e3e3a7aSWarner Losh #endif
53