mirror of
https://github.com/LuaJIT/LuaJIT.git
synced 2025-04-20 14:03:26 +00:00
add lua_getinfo_game
This commit is contained in:
parent
2efde665e7
commit
2a843e0286
@ -797,4 +797,8 @@ extern void *LJ_WIN_LOADLIBA(const char *path);
|
|||||||
#define LJ_DS_STR_HASH_PATCH LJ_DS
|
#define LJ_DS_STR_HASH_PATCH LJ_DS
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef LJ_DS_DEBUG_GETINFO_PATCH
|
||||||
|
#define LJ_DS_DEBUG_GETINFO_PATCH LJ_DS
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -538,6 +538,18 @@ LUA_API int lua_getinfo(lua_State *L, const char *what, lua_Debug *ar)
|
|||||||
return lj_debug_getinfo(L, what, (lj_Debug *)ar, 0);
|
return lj_debug_getinfo(L, what, (lj_Debug *)ar, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef LJ_DS_DEBUG_GETINFO_PATCH
|
||||||
|
// the api skip the @ path
|
||||||
|
LUA_API int lua_getinfo_game(lua_State *L, const char *what, lua_Debug *ar)
|
||||||
|
{
|
||||||
|
int res = lj_debug_getinfo(L, what, (lj_Debug *)ar, 0);
|
||||||
|
if (res) {
|
||||||
|
ar->source = ar->source[0] == '@' ? ar->source + 1 : ar->source;
|
||||||
|
}
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
LUA_API int lua_getstack(lua_State *L, int level, lua_Debug *ar)
|
LUA_API int lua_getstack(lua_State *L, int level, lua_Debug *ar)
|
||||||
{
|
{
|
||||||
int size;
|
int size;
|
||||||
|
Loading…
Reference in New Issue
Block a user