diff options
Diffstat (limited to 'ldebug.c')
| -rw-r--r-- | ldebug.c | 11 |
1 files changed, 6 insertions, 5 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: ldebug.c,v 1.15 2000/03/30 17:19:48 roberto Exp roberto $ | 2 | ** $Id: ldebug.c,v 1.16 2000/03/30 20:55:50 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,12 +159,13 @@ static int checkfunc (lua_State *L, TObject *o) { | |||
| 159 | 159 | ||
| 160 | 160 | ||
| 161 | static void lua_getobjname (lua_State *L, StkId f, lua_Debug *ar) { | 161 | static void lua_getobjname (lua_State *L, StkId f, lua_Debug *ar) { |
| 162 | GlobalVar *g; | 162 | Hash *g = L->gt; |
| 163 | int i; | ||
| 163 | /* try to find a name for given function */ | 164 | /* try to find a name for given function */ |
| 164 | setnormalized(L->top, f); /* to be used by `checkfunc' */ | 165 | setnormalized(L->top, f); /* to be used by `checkfunc' */ |
| 165 | for (g=L->rootglobal; g; g=g->next) { | 166 | for (i=0; i<=g->size; i++) { |
| 166 | if (checkfunc(L, &g->value)) { | 167 | if (checkfunc(L, val(node(g,i))) && ttype(key(node(g,i))) == TAG_STRING) { |
| 167 | ar->name = g->name->str; | 168 | ar->name = tsvalue(key(node(g,i)))->str; |
| 168 | ar->namewhat = "global"; | 169 | ar->namewhat = "global"; |
| 169 | return; | 170 | return; |
| 170 | } | 171 | } |
