From 422318f6777d8d3bac13ade797d9c8eaa38686b6 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Sat, 17 Feb 2018 17:29:29 -0200 Subject: two new fields 'fTransfer'/'nTransfer' in 'lua_Debug' structure (for information about values being given and returned in function calls) --- ldblib.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'ldblib.c') diff --git a/ldblib.c b/ldblib.c index 0bcd2e9e..c1e26e0d 100644 --- a/ldblib.c +++ b/ldblib.c @@ -1,5 +1,5 @@ /* -** $Id: ldblib.c,v 1.150 2015/11/19 19:16:22 roberto Exp roberto $ +** $Id: ldblib.c,v 1.151 2015/11/23 11:29:43 roberto Exp roberto $ ** Interface from Lua to its debug API ** See Copyright Notice in lua.h */ @@ -146,7 +146,7 @@ static int db_getinfo (lua_State *L) { lua_Debug ar; int arg; lua_State *L1 = getthread(L, &arg); - const char *options = luaL_optstring(L, arg+2, "flnStu"); + const char *options = luaL_optstring(L, arg+2, "flnSrtu"); checkstack(L, L1, 3); if (lua_isfunction(L, arg + 1)) { /* info about a function? */ options = lua_pushfstring(L, ">%s", options); /* add '>' to 'options' */ @@ -180,6 +180,10 @@ static int db_getinfo (lua_State *L) { settabss(L, "name", ar.name); settabss(L, "namewhat", ar.namewhat); } + if (strchr(options, 'r')) { + settabsi(L, "fTransfer", ar.fTransfer); + settabsi(L, "nTransfer", ar.nTransfer); + } if (strchr(options, 't')) settabsb(L, "istailcall", ar.istailcall); if (strchr(options, 'L')) -- cgit v1.2.3-55-g6feb