diff options
Diffstat (limited to 'ldblib.c')
-rw-r--r-- | ldblib.c | 19 |
1 files changed, 13 insertions, 6 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: ldblib.c,v 1.117 2009/11/24 12:05:44 roberto Exp roberto $ | 2 | ** $Id: ldblib.c,v 1.118 2009/11/25 15:27:51 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 | */ |
@@ -73,6 +73,12 @@ static void settabsi (lua_State *L, const char *i, int v) { | |||
73 | } | 73 | } |
74 | 74 | ||
75 | 75 | ||
76 | static void settabsb (lua_State *L, const char *i, int v) { | ||
77 | lua_pushboolean(L, v); | ||
78 | lua_setfield(L, -2, i); | ||
79 | } | ||
80 | |||
81 | |||
76 | static lua_State *getthread (lua_State *L, int *arg) { | 82 | static lua_State *getthread (lua_State *L, int *arg) { |
77 | if (lua_isthread(L, 1)) { | 83 | if (lua_isthread(L, 1)) { |
78 | *arg = 1; | 84 | *arg = 1; |
@@ -127,16 +133,17 @@ static int db_getinfo (lua_State *L) { | |||
127 | } | 133 | } |
128 | if (strchr(options, 'l')) | 134 | if (strchr(options, 'l')) |
129 | settabsi(L, "currentline", ar.currentline); | 135 | settabsi(L, "currentline", ar.currentline); |
130 | if (strchr(options, 'u')) | 136 | if (strchr(options, 'u')) { |
131 | settabsi(L, "nups", ar.nups); | 137 | settabsi(L, "nups", ar.nups); |
138 | settabsi(L, "nparams", ar.nparams); | ||
139 | settabsb(L, "isvararg", ar.isvararg); | ||
140 | } | ||
132 | if (strchr(options, 'n')) { | 141 | if (strchr(options, 'n')) { |
133 | settabss(L, "name", ar.name); | 142 | settabss(L, "name", ar.name); |
134 | settabss(L, "namewhat", ar.namewhat); | 143 | settabss(L, "namewhat", ar.namewhat); |
135 | } | 144 | } |
136 | if (strchr(options, 't')) { | 145 | if (strchr(options, 't')) |
137 | lua_pushboolean(L, ar.istailcall); | 146 | settabsb(L, "istailcall", ar.istailcall); |
138 | lua_setfield(L, -2, "istailcall"); | ||
139 | } | ||
140 | if (strchr(options, 'L')) | 147 | if (strchr(options, 'L')) |
141 | treatstackoption(L, L1, "activelines"); | 148 | treatstackoption(L, L1, "activelines"); |
142 | if (strchr(options, 'f')) | 149 | if (strchr(options, 'f')) |