From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp54.i.mail.ru (smtp54.i.mail.ru [217.69.128.34]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 7720045C30B for ; Wed, 16 Dec 2020 22:14:42 +0300 (MSK) From: Sergey Kaplun Date: Wed, 16 Dec 2020 22:13:42 +0300 Message-Id: <99c1138ecb4d0d76873409793ad1fbfaa0b449e3.1608142899.git.skaplun@tarantool.org> In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [Tarantool-patches] [PATCH luajit v1 07/11] debug: move debug_frameline to public module API List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Igor Munkin , Sergey Ostanevich Cc: tarantool-patches@dev.tarantool.org This patch renames debug_frameline to lj_debug_frameline and moves it to public module API (does not provide it with LUA_API). It will be used for memory profiler in the next patches. Part of tarantool/tarantool#5442 --- src/lj_debug.c | 8 ++++---- src/lj_debug.h | 1 + 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/lj_debug.c b/src/lj_debug.c index 73bd196..bb9ab28 100644 --- a/src/lj_debug.c +++ b/src/lj_debug.c @@ -128,7 +128,7 @@ BCLine LJ_FASTCALL lj_debug_line(GCproto *pt, BCPos pc) } /* Get line number for function/frame. */ -static BCLine debug_frameline(lua_State *L, GCfunc *fn, cTValue *nextframe) +BCLine lj_debug_frameline(lua_State *L, GCfunc *fn, cTValue *nextframe) { BCPos pc = debug_framepc(L, fn, nextframe); if (pc != NO_BCPOS) { @@ -353,7 +353,7 @@ void lj_debug_addloc(lua_State *L, const char *msg, if (frame) { GCfunc *fn = frame_func(frame); if (isluafunc(fn)) { - BCLine line = debug_frameline(L, fn, nextframe); + BCLine line = lj_debug_frameline(L, fn, nextframe); if (line >= 0) { GCproto *pt = funcproto(fn); char buf[LUA_IDSIZE]; @@ -470,7 +470,7 @@ int lj_debug_getinfo(lua_State *L, const char *what, lj_Debug *ar, int ext) ar->what = "C"; } } else if (*what == 'l') { - ar->currentline = frame ? debug_frameline(L, fn, nextframe) : -1; + ar->currentline = frame ? lj_debug_frameline(L, fn, nextframe) : -1; } else if (*what == 'u') { ar->nups = fn->c.nupvalues; if (ext) { @@ -616,7 +616,7 @@ void lj_debug_dumpstack(lua_State *L, SBuf *sb, const char *fmt, int depth) GCproto *pt = funcproto(fn); if (debug_putchunkname(sb, pt, pathstrip)) { /* Regular Lua function. */ - BCLine line = c == 'l' ? debug_frameline(L, fn, nextframe) : + BCLine line = c == 'l' ? lj_debug_frameline(L, fn, nextframe) : pt->firstline; lj_buf_putb(sb, ':'); lj_strfmt_putint(sb, line >= 0 ? line : pt->firstline); diff --git a/src/lj_debug.h b/src/lj_debug.h index 5917c00..1b5ef29 100644 --- a/src/lj_debug.h +++ b/src/lj_debug.h @@ -40,6 +40,7 @@ LJ_FUNC void lj_debug_addloc(lua_State *L, const char *msg, 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); +LJ_FUNC BCLine lj_debug_frameline(lua_State *L, GCfunc *fn, cTValue *nextframe); #if LJ_HASPROFILE LJ_FUNC void lj_debug_dumpstack(lua_State *L, SBuf *sb, const char *fmt, int depth); -- 2.28.0