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 /ldblib.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 'ldblib.c')
| -rw-r--r-- | ldblib.c | 8 |
1 files changed, 6 insertions, 2 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: ldblib.c,v 1.150 2015/11/19 19:16:22 roberto Exp roberto $ | 2 | ** $Id: ldblib.c,v 1.151 2015/11/23 11:29:43 roberto Exp roberto $ |
| 3 | ** Interface from Lua to its debug API | 3 | ** Interface from Lua to its debug API |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -146,7 +146,7 @@ static int db_getinfo (lua_State *L) { | |||
| 146 | lua_Debug ar; | 146 | lua_Debug ar; |
| 147 | int arg; | 147 | int arg; |
| 148 | lua_State *L1 = getthread(L, &arg); | 148 | lua_State *L1 = getthread(L, &arg); |
| 149 | const char *options = luaL_optstring(L, arg+2, "flnStu"); | 149 | const char *options = luaL_optstring(L, arg+2, "flnSrtu"); |
| 150 | checkstack(L, L1, 3); | 150 | checkstack(L, L1, 3); |
| 151 | if (lua_isfunction(L, arg + 1)) { /* info about a function? */ | 151 | if (lua_isfunction(L, arg + 1)) { /* info about a function? */ |
| 152 | options = lua_pushfstring(L, ">%s", options); /* add '>' to 'options' */ | 152 | options = lua_pushfstring(L, ">%s", options); /* add '>' to 'options' */ |
| @@ -180,6 +180,10 @@ static int db_getinfo (lua_State *L) { | |||
| 180 | settabss(L, "name", ar.name); | 180 | settabss(L, "name", ar.name); |
| 181 | settabss(L, "namewhat", ar.namewhat); | 181 | settabss(L, "namewhat", ar.namewhat); |
| 182 | } | 182 | } |
| 183 | if (strchr(options, 'r')) { | ||
| 184 | settabsi(L, "fTransfer", ar.fTransfer); | ||
| 185 | settabsi(L, "nTransfer", ar.nTransfer); | ||
| 186 | } | ||
| 183 | if (strchr(options, 't')) | 187 | if (strchr(options, 't')) |
| 184 | settabsb(L, "istailcall", ar.istailcall); | 188 | settabsb(L, "istailcall", ar.istailcall); |
| 185 | if (strchr(options, 'L')) | 189 | if (strchr(options, 'L')) |
