Disable loading bytecode with an extra header (BOM or #!).
[luajit-2.0.git] / src / lj_debug.h
blobe00769aeace71bf3e6f98b41d1f8a8a40e8d8270
1 /*
2 ** Debugging and introspection.
3 ** Copyright (C) 2005-2012 Mike Pall. See Copyright Notice in luajit.h
4 */
6 #ifndef _LJ_DEBUG_H
7 #define _LJ_DEBUG_H
9 #include "lj_obj.h"
11 LJ_FUNC cTValue *lj_debug_frame(lua_State *L, int level, int *size);
12 LJ_FUNC BCLine LJ_FASTCALL lj_debug_line(GCproto *pt, BCPos pc);
13 LJ_FUNC const char *lj_debug_uvname(GCproto *pt, uint32_t idx);
14 LJ_FUNC const char *lj_debug_uvnamev(cTValue *o, uint32_t idx, TValue **tvp);
15 LJ_FUNC const char *lj_debug_slotname(GCproto *pt, const BCIns *pc,
16 BCReg slot, const char **name);
17 LJ_FUNC const char *lj_debug_funcname(lua_State *L, TValue *frame,
18 const char **name);
19 LJ_FUNC void lj_debug_shortname(char *out, GCstr *str);
20 LJ_FUNC void lj_debug_addloc(lua_State *L, const char *msg,
21 cTValue *frame, cTValue *nextframe);
22 LJ_FUNC void lj_debug_pushloc(lua_State *L, GCproto *pt, BCPos pc);
24 /* Fixed internal variable names. */
25 #define VARNAMEDEF(_) \
26 _(FOR_IDX, "(for index)") \
27 _(FOR_STOP, "(for limit)") \
28 _(FOR_STEP, "(for step)") \
29 _(FOR_GEN, "(for generator)") \
30 _(FOR_STATE, "(for state)") \
31 _(FOR_CTL, "(for control)")
33 enum {
34 VARNAME_END,
35 #define VARNAMEENUM(name, str) VARNAME_##name,
36 VARNAMEDEF(VARNAMEENUM)
37 #undef VARNAMEENUM
38 VARNAME__MAX
41 #endif