xref: /netbsd-src/external/mit/lua/dist/src/ldebug.h (revision 80d9064ac03cbb6a4174695f0d5b237c8766d3d0)
1 /*	$NetBSD: ldebug.h,v 1.2 2014/07/19 18:38:34 lneto Exp $	*/
2 
3 /*
4 ** $Id: ldebug.h,v 1.2 2014/07/19 18:38:34 lneto Exp $
5 ** Auxiliary functions from Debug Interface module
6 ** See Copyright Notice in lua.h
7 */
8 
9 #ifndef ldebug_h
10 #define ldebug_h
11 
12 
13 #include "lstate.h"
14 
15 
16 #define pcRel(pc, p)	(cast(int, (pc) - (p)->code) - 1)
17 
18 #define getfuncline(f,pc)	(((f)->lineinfo) ? (f)->lineinfo[pc] : -1)
19 
20 #define resethookcount(L)	(L->hookcount = L->basehookcount)
21 
22 /* Active Lua function (given call info) */
23 #define ci_func(ci)		(clLvalue((ci)->func))
24 
25 
26 LUAI_FUNC l_noret luaG_typeerror (lua_State *L, const TValue *o,
27                                                 const char *opname);
28 LUAI_FUNC l_noret luaG_concaterror (lua_State *L, const TValue *p1,
29                                                   const TValue *p2);
30 LUAI_FUNC l_noret luaG_aritherror (lua_State *L, const TValue *p1,
31                                                  const TValue *p2);
32 LUAI_FUNC l_noret luaG_tointerror (lua_State *L, const TValue *p1,
33                                                  const TValue *p2);
34 LUAI_FUNC l_noret luaG_ordererror (lua_State *L, const TValue *p1,
35                                                  const TValue *p2);
36 LUAI_FUNC l_noret luaG_runerror (lua_State *L, const char *fmt, ...);
37 LUAI_FUNC l_noret luaG_errormsg (lua_State *L);
38 LUAI_FUNC void luaG_traceexec (lua_State *L);
39 
40 
41 #endif
42