From: Sergey Kaplun <skaplun@tarantool.org> To: Igor Munkin <imun@tarantool.org>, Sergey Ostanevich <sergos@tarantool.org> Cc: tarantool-patches@dev.tarantool.org Subject: [Tarantool-patches] [PATCH luajit v1 07/11] debug: move debug_frameline to public module API Date: Wed, 16 Dec 2020 22:13:42 +0300 [thread overview] Message-ID: <99c1138ecb4d0d76873409793ad1fbfaa0b449e3.1608142899.git.skaplun@tarantool.org> (raw) In-Reply-To: <cover.1608142899.git.skaplun@tarantool.org> This patch renames debug_frameline to lj_debug_frameline and moves it to public <lj_debug.h> 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
next prev parent reply other threads:[~2020-12-16 19:14 UTC|newest] Thread overview: 42+ messages / expand[flat|nested] mbox.gz Atom feed top 2020-12-16 19:13 [Tarantool-patches] [PATCH luajit v1 00/11] LuaJIT memory profiler Sergey Kaplun 2020-12-16 19:13 ` [Tarantool-patches] [PATCH luajit v1 01/11] build: add src dir in building Sergey Kaplun 2020-12-20 21:27 ` Igor Munkin 2020-12-23 18:20 ` Sergey Kaplun 2020-12-16 19:13 ` [Tarantool-patches] [PATCH luajit v1 02/11] utils: introduce leb128 reader and writer Sergey Kaplun 2020-12-20 22:44 ` Igor Munkin 2020-12-23 22:34 ` Sergey Kaplun 2020-12-24 9:11 ` Igor Munkin 2020-12-25 8:46 ` Sergey Kaplun 2020-12-23 16:50 ` Sergey Ostanevich 2020-12-23 22:36 ` Sergey Kaplun 2020-12-16 19:13 ` [Tarantool-patches] [PATCH luajit v1 03/11] profile: introduce profiler writing module Sergey Kaplun 2020-12-21 9:24 ` Igor Munkin 2020-12-24 6:46 ` Sergey Kaplun 2020-12-24 15:45 ` Sergey Ostanevich 2020-12-24 21:20 ` Sergey Kaplun 2020-12-25 9:37 ` Igor Munkin 2020-12-25 10:13 ` Sergey Kaplun 2020-12-16 19:13 ` [Tarantool-patches] [PATCH luajit v1 04/11] profile: introduce symtab write module Sergey Kaplun 2020-12-21 10:30 ` Igor Munkin 2020-12-24 7:00 ` Sergey Kaplun 2020-12-24 9:36 ` Igor Munkin 2020-12-25 8:45 ` Sergey Kaplun 2020-12-16 19:13 ` [Tarantool-patches] [PATCH luajit v1 05/11] vm: introduce LFUNC and FFUNC vmstates Sergey Kaplun 2020-12-25 11:07 ` Sergey Ostanevich 2020-12-25 11:23 ` Sergey Kaplun 2020-12-16 19:13 ` [Tarantool-patches] [PATCH luajit v1 06/11] core: introduce new mem_L field Sergey Kaplun 2020-12-16 19:13 ` Sergey Kaplun [this message] 2020-12-20 22:46 ` [Tarantool-patches] [PATCH luajit v1 07/11] debug: move debug_frameline to public module API Igor Munkin 2020-12-24 6:50 ` Sergey Kaplun 2020-12-16 19:13 ` [Tarantool-patches] [PATCH luajit v1 08/11] profile: introduce memory profiler Sergey Kaplun 2020-12-16 19:13 ` [Tarantool-patches] [PATCH luajit v1 09/11] misc: add Lua API for " Sergey Kaplun 2020-12-24 16:32 ` Sergey Ostanevich 2020-12-24 21:25 ` Sergey Kaplun 2020-12-16 19:13 ` [Tarantool-patches] [PATCH luajit v1 10/11] tools: introduce tools directory Sergey Kaplun 2020-12-20 22:46 ` Igor Munkin 2020-12-24 6:47 ` Sergey Kaplun 2020-12-16 19:13 ` [Tarantool-patches] [PATCH luajit v1 11/11] profile: introduce profile parser Sergey Kaplun 2020-12-24 23:09 ` Igor Munkin 2020-12-25 8:41 ` Sergey Kaplun 2020-12-21 10:43 ` [Tarantool-patches] [PATCH luajit v1 00/11] LuaJIT memory profiler Igor Munkin 2020-12-24 7:02 ` Sergey Kaplun
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=99c1138ecb4d0d76873409793ad1fbfaa0b449e3.1608142899.git.skaplun@tarantool.org \ --to=skaplun@tarantool.org \ --cc=imun@tarantool.org \ --cc=sergos@tarantool.org \ --cc=tarantool-patches@dev.tarantool.org \ --subject='Re: [Tarantool-patches] [PATCH luajit v1 07/11] debug: move debug_frameline to public module API' \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox