diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2003-10-20 16:42:28 -0200 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2003-10-20 16:42:28 -0200 |
commit | 07201066bd124976053e6a8ab63a0ce09f28d896 (patch) | |
tree | a29aeb969cf4128dd22ec63f87d5d6c3d43b9547 | |
parent | 97b838d9ab5621f99263b81b591c98da935c8a6c (diff) | |
download | lua-07201066bd124976053e6a8ab63a0ce09f28d896.tar.gz lua-07201066bd124976053e6a8ab63a0ce09f28d896.tar.bz2 lua-07201066bd124976053e6a8ab63a0ce09f28d896.zip |
core does not look for function name in globals (too particular)
-rw-r--r-- | ldebug.c | 20 |
1 files changed, 3 insertions, 17 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: ldebug.c,v 1.155 2003/07/16 20:49:02 roberto Exp roberto $ | 2 | ** $Id: ldebug.c,v 1.156 2003/10/02 19:21:09 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 | */ |
@@ -159,18 +159,6 @@ static void funcinfo (lua_Debug *ar, StkId func) { | |||
159 | } | 159 | } |
160 | 160 | ||
161 | 161 | ||
162 | static const char *travglobals (lua_State *L, const TObject *o) { | ||
163 | Table *g = hvalue(gt(L)); | ||
164 | int i = sizenode(g); | ||
165 | while (i--) { | ||
166 | Node *n = gnode(g, i); | ||
167 | if (luaO_rawequalObj(o, gval(n)) && ttisstring(gkey(n))) | ||
168 | return getstr(tsvalue(gkey(n))); | ||
169 | } | ||
170 | return NULL; | ||
171 | } | ||
172 | |||
173 | |||
174 | static void info_tailcall (lua_State *L, lua_Debug *ar) { | 162 | static void info_tailcall (lua_State *L, lua_Debug *ar) { |
175 | ar->name = ar->namewhat = ""; | 163 | ar->name = ar->namewhat = ""; |
176 | ar->what = "tail"; | 164 | ar->what = "tail"; |
@@ -202,10 +190,8 @@ static int auxgetinfo (lua_State *L, const char *what, lua_Debug *ar, | |||
202 | case 'n': { | 190 | case 'n': { |
203 | ar->namewhat = (ci) ? getfuncname(ci, &ar->name) : NULL; | 191 | ar->namewhat = (ci) ? getfuncname(ci, &ar->name) : NULL; |
204 | if (ar->namewhat == NULL) { | 192 | if (ar->namewhat == NULL) { |
205 | /* try to find a global name */ | 193 | ar->namewhat = ""; /* not found */ |
206 | if ((ar->name = travglobals(L, f)) != NULL) | 194 | ar->name = NULL; |
207 | ar->namewhat = "global"; | ||
208 | else ar->namewhat = ""; /* not found */ | ||
209 | } | 195 | } |
210 | break; | 196 | break; |
211 | } | 197 | } |