diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2018-02-17 17:29:29 -0200 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2018-02-17 17:29:29 -0200 |
commit | 422318f6777d8d3bac13ade797d9c8eaa38686b6 (patch) | |
tree | 5cfabc21fcebb714daf237bff783fe9630e70582 /ldebug.c | |
parent | 49dae52d0808776f5861eb33efa1d13b05e44512 (diff) | |
download | lua-422318f6777d8d3bac13ade797d9c8eaa38686b6.tar.gz lua-422318f6777d8d3bac13ade797d9c8eaa38686b6.tar.bz2 lua-422318f6777d8d3bac13ade797d9c8eaa38686b6.zip |
two new fields 'fTransfer'/'nTransfer' in 'lua_Debug' structure
(for information about values being given and returned in function calls)
Diffstat (limited to 'ldebug.c')
-rw-r--r-- | ldebug.c | 14 |
1 files changed, 11 insertions, 3 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: ldebug.c,v 2.153 2018/02/06 19:16:56 roberto Exp roberto $ | 2 | ** $Id: ldebug.c,v 2.154 2018/02/09 15:16:06 roberto Exp roberto $ |
3 | ** Debug Interface | 3 | ** Debug Interface |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -356,6 +356,14 @@ static int auxgetinfo (lua_State *L, const char *what, lua_Debug *ar, | |||
356 | } | 356 | } |
357 | break; | 357 | break; |
358 | } | 358 | } |
359 | case 'r': { | ||
360 | if (ci == NULL || !(ci->callstatus & CIST_TRAN)) | ||
361 | ar->fTransfer = ar->nTransfer = 0; | ||
362 | else { | ||
363 | ar->fTransfer = ci->u2.transferinfo.fTransfer; | ||
364 | ar->nTransfer = ci->u2.transferinfo.nTransfer; | ||
365 | } | ||
366 | } | ||
359 | case 'L': | 367 | case 'L': |
360 | case 'f': /* handled by lua_getinfo */ | 368 | case 'f': /* handled by lua_getinfo */ |
361 | break; | 369 | break; |
@@ -790,7 +798,7 @@ void luaG_traceexec (lua_State *L) { | |||
790 | if (!isIT(*(ci->u.l.savedpc - 1))) | 798 | if (!isIT(*(ci->u.l.savedpc - 1))) |
791 | L->top = ci->top; /* prepare top */ | 799 | L->top = ci->top; /* prepare top */ |
792 | if (counthook) | 800 | if (counthook) |
793 | luaD_hook(L, LUA_HOOKCOUNT, -1); /* call count hook */ | 801 | luaD_hook(L, LUA_HOOKCOUNT, -1, 0, 0); /* call count hook */ |
794 | if (mask & LUA_MASKLINE) { | 802 | if (mask & LUA_MASKLINE) { |
795 | Proto *p = ci_func(ci)->p; | 803 | Proto *p = ci_func(ci)->p; |
796 | const Instruction *npc = ci->u.l.savedpc; | 804 | const Instruction *npc = ci->u.l.savedpc; |
@@ -799,7 +807,7 @@ void luaG_traceexec (lua_State *L) { | |||
799 | npc <= L->oldpc || /* when jump back (loop), or when */ | 807 | npc <= L->oldpc || /* when jump back (loop), or when */ |
800 | changedline(p, pcRel(L->oldpc, p), npci)) { /* enter new line */ | 808 | changedline(p, pcRel(L->oldpc, p), npci)) { /* enter new line */ |
801 | int newline = luaG_getfuncline(p, npci); /* new line */ | 809 | int newline = luaG_getfuncline(p, npci); /* new line */ |
802 | luaD_hook(L, LUA_HOOKLINE, newline); /* call line hook */ | 810 | luaD_hook(L, LUA_HOOKLINE, newline, 0, 0); /* call line hook */ |
803 | } | 811 | } |
804 | L->oldpc = npc; | 812 | L->oldpc = npc; |
805 | } | 813 | } |