diff options
author | chai <chaifix@163.com> | 2021-11-08 01:17:11 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2021-11-08 01:17:11 +0800 |
commit | efce5b6bd5c9d4f8214a71e0f7a7c35751710a4c (patch) | |
tree | 0789475ded5c377667165a3ddb047ca6703bcf33 /ThirdParty/tolua_runtime/luajit-2.1/src/lj_debug.h | |
parent | ed78df90944bbe6b7de7308bda2bf3a7f1bc3de6 (diff) |
+ tolua
+ lpeg
Diffstat (limited to 'ThirdParty/tolua_runtime/luajit-2.1/src/lj_debug.h')
-rw-r--r-- | ThirdParty/tolua_runtime/luajit-2.1/src/lj_debug.h | 77 |
1 files changed, 77 insertions, 0 deletions
diff --git a/ThirdParty/tolua_runtime/luajit-2.1/src/lj_debug.h b/ThirdParty/tolua_runtime/luajit-2.1/src/lj_debug.h new file mode 100644 index 0000000..2cb66e5 --- /dev/null +++ b/ThirdParty/tolua_runtime/luajit-2.1/src/lj_debug.h @@ -0,0 +1,77 @@ +/* +** Debugging and introspection. +** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h +*/ + +#ifndef _LJ_DEBUG_H +#define _LJ_DEBUG_H + +#include "lj_obj.h" + +typedef struct lj_Debug { + /* Common fields. Must be in the same order as in lua.h. */ + int event; + const char *name; + const char *namewhat; + const char *what; + const char *source; + int currentline; + int nups; + int linedefined; + int lastlinedefined; + char short_src[LUA_IDSIZE]; + int i_ci; + /* Extended fields. Only valid if lj_debug_getinfo() is called with ext = 1.*/ + int nparams; + int isvararg; +} lj_Debug; + +LJ_FUNC BCPos lj_debug_framepc(lua_State *L, GCfunc *fn, cTValue *nextframe); +LJ_FUNC cTValue *lj_debug_frame(lua_State *L, int level, int *size); +LJ_FUNC BCLine LJ_FASTCALL lj_debug_line(GCproto *pt, BCPos pc); +LJ_FUNC const char *lj_debug_uvname(GCproto *pt, uint32_t idx); +LJ_FUNC const char *lj_debug_uvnamev(cTValue *o, uint32_t idx, TValue **tvp); +LJ_FUNC const char *lj_debug_slotname(GCproto *pt, const BCIns *pc, + BCReg slot, const char **name); +LJ_FUNC const char *lj_debug_funcname(lua_State *L, cTValue *frame, + const char **name); +LJ_FUNC void lj_debug_shortname(char *out, GCstr *str, BCLine line); +LJ_FUNC void lj_debug_addloc(lua_State *L, const char *msg, + cTValue *frame, cTValue *nextframe); +LJ_FUNC void lj_debug_pushloc(lua_State *L, GCproto *pt, BCPos pc); +LJ_FUNC int lj_debug_getinfo(lua_State *L, const char *what, lj_Debug *ar, + int ext); +#if LJ_HASPROFILE +LJ_FUNC void lj_debug_dumpstack(lua_State *L, SBuf *sb, const char *fmt, + int depth); +#endif + +/* Fixed internal variable names. */ +#define VARNAMEDEF(_) \ + _(FOR_IDX, "(for index)") \ + _(FOR_STOP, "(for limit)") \ + _(FOR_STEP, "(for step)") \ + _(FOR_GEN, "(for generator)") \ + _(FOR_STATE, "(for state)") \ + _(FOR_CTL, "(for control)") + +enum { + VARNAME_END, +#define VARNAMEENUM(name, str) VARNAME_##name, + VARNAMEDEF(VARNAMEENUM) +#undef VARNAMEENUM + VARNAME__MAX +}; + +#ifdef LUA_USE_TRACE_LOGS +LJ_FUNC void LJ_FASTCALL lj_log_trace_direct_exit(lua_State *L, + int vmstate, const BCIns *pc); +LJ_FUNC void LJ_FASTCALL lj_log_trace_normal_exit(lua_State *L, + int vmstate, const BCIns *pc); +LJ_FUNC void LJ_FASTCALL lj_log_trace_entry(lua_State *L, + unsigned traceno, const BCIns *pc); +LJ_FUNC void LJ_FASTCALL lj_log_trace_start_record(lua_State *L, unsigned traceno, + const BCIns *pc, GCfunc *fn); +#endif + +#endif |