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) --- ldebug.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'ldebug.c') diff --git a/ldebug.c b/ldebug.c index 3ddac547..bede7e37 100644 --- a/ldebug.c +++ b/ldebug.c @@ -1,5 +1,5 @@ /* -** $Id: ldebug.c,v 2.153 2018/02/06 19:16:56 roberto Exp roberto $ +** $Id: ldebug.c,v 2.154 2018/02/09 15:16:06 roberto Exp roberto $ ** Debug Interface ** See Copyright Notice in lua.h */ @@ -356,6 +356,14 @@ static int auxgetinfo (lua_State *L, const char *what, lua_Debug *ar, } break; } + case 'r': { + if (ci == NULL || !(ci->callstatus & CIST_TRAN)) + ar->fTransfer = ar->nTransfer = 0; + else { + ar->fTransfer = ci->u2.transferinfo.fTransfer; + ar->nTransfer = ci->u2.transferinfo.nTransfer; + } + } case 'L': case 'f': /* handled by lua_getinfo */ break; @@ -790,7 +798,7 @@ void luaG_traceexec (lua_State *L) { if (!isIT(*(ci->u.l.savedpc - 1))) L->top = ci->top; /* prepare top */ if (counthook) - luaD_hook(L, LUA_HOOKCOUNT, -1); /* call count hook */ + luaD_hook(L, LUA_HOOKCOUNT, -1, 0, 0); /* call count hook */ if (mask & LUA_MASKLINE) { Proto *p = ci_func(ci)->p; const Instruction *npc = ci->u.l.savedpc; @@ -799,7 +807,7 @@ void luaG_traceexec (lua_State *L) { npc <= L->oldpc || /* when jump back (loop), or when */ changedline(p, pcRel(L->oldpc, p), npci)) { /* enter new line */ int newline = luaG_getfuncline(p, npci); /* new line */ - luaD_hook(L, LUA_HOOKLINE, newline); /* call line hook */ + luaD_hook(L, LUA_HOOKLINE, newline, 0, 0); /* call line hook */ } L->oldpc = npc; } -- cgit v1.2.3-55-g6feb