aboutsummaryrefslogtreecommitdiff
path: root/ldebug.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2000-05-08 16:32:53 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2000-05-08 16:32:53 -0300
commit11a70220670f25a9929439f0b27331f09f05235c (patch)
treec4a962b5a3e53ac6df8894fb3ad2248c4a1256cb /ldebug.c
parent35a6ed283881f313152457f24cc6c677122d5058 (diff)
downloadlua-11a70220670f25a9929439f0b27331f09f05235c.tar.gz
lua-11a70220670f25a9929439f0b27331f09f05235c.tar.bz2
lua-11a70220670f25a9929439f0b27331f09f05235c.zip
global variables are stored in a Lua table
Diffstat (limited to 'ldebug.c')
-rw-r--r--ldebug.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/ldebug.c b/ldebug.c
index ef934d86..3a381455 100644
--- a/ldebug.c
+++ b/ldebug.c
@@ -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
161static void lua_getobjname (lua_State *L, StkId f, lua_Debug *ar) { 161static 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 }