2 ** Debugging and introspection.
3 ** Copyright (C) 2005-2023 Mike Pall. See Copyright Notice in luajit.h
11 typedef struct lj_Debug
{
12 /* Common fields. Must be in the same order as in lua.h. */
22 char short_src
[LUA_IDSIZE
];
24 /* Extended fields. Only valid if lj_debug_getinfo() is called with ext = 1.*/
29 LJ_FUNC cTValue
*lj_debug_frame(lua_State
*L
, int level
, int *size
);
30 LJ_FUNC BCLine LJ_FASTCALL
lj_debug_line(GCproto
*pt
, BCPos pc
);
31 LJ_FUNC
const char *lj_debug_uvname(GCproto
*pt
, uint32_t idx
);
32 LJ_FUNC
const char *lj_debug_uvnamev(cTValue
*o
, uint32_t idx
, TValue
**tvp
,
34 LJ_FUNC
const char *lj_debug_slotname(GCproto
*pt
, const BCIns
*pc
,
35 BCReg slot
, const char **name
);
36 LJ_FUNC
const char *lj_debug_funcname(lua_State
*L
, cTValue
*frame
,
38 LJ_FUNC
void lj_debug_shortname(char *out
, GCstr
*str
, BCLine line
);
39 LJ_FUNC
void lj_debug_addloc(lua_State
*L
, const char *msg
,
40 cTValue
*frame
, cTValue
*nextframe
);
41 LJ_FUNC
void lj_debug_pushloc(lua_State
*L
, GCproto
*pt
, BCPos pc
);
42 LJ_FUNC
int lj_debug_getinfo(lua_State
*L
, const char *what
, lj_Debug
*ar
,
45 LJ_FUNC
void lj_debug_dumpstack(lua_State
*L
, SBuf
*sb
, const char *fmt
,
49 /* Fixed internal variable names. */
50 #define VARNAMEDEF(_) \
51 _(FOR_IDX, "(for index)") \
52 _(FOR_STOP, "(for limit)") \
53 _(FOR_STEP, "(for step)") \
54 _(FOR_GEN, "(for generator)") \
55 _(FOR_STATE, "(for state)") \
56 _(FOR_CTL, "(for control)")
60 #define VARNAMEENUM(name, str) VARNAME_##name,
61 VARNAMEDEF(VARNAMEENUM
)