diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2009-04-27 15:58:31 -0300 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2009-04-27 15:58:31 -0300 |
| commit | c1f78ff3d32298fbae950bf655bdca11179343ce (patch) | |
| tree | 0938ec28a92f98f459b6c9a140fae899a4ee0475 | |
| parent | e5249b9fb54fce969dbdfffaaee3deff9e58e096 (diff) | |
| download | lua-c1f78ff3d32298fbae950bf655bdca11179343ce.tar.gz lua-c1f78ff3d32298fbae950bf655bdca11179343ce.tar.bz2 lua-c1f78ff3d32298fbae950bf655bdca11179343ce.zip | |
unused arguments removed
| -rw-r--r-- | ldebug.c | 18 |
1 files changed, 9 insertions, 9 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: ldebug.c,v 2.46 2009/04/17 14:28:06 roberto Exp roberto $ | 2 | ** $Id: ldebug.c,v 2.47 2009/04/17 22:00:01 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 | */ |
| @@ -33,14 +33,14 @@ | |||
| 33 | static const char *getfuncname (lua_State *L, CallInfo *ci, const char **name); | 33 | static const char *getfuncname (lua_State *L, CallInfo *ci, const char **name); |
| 34 | 34 | ||
| 35 | 35 | ||
| 36 | static int currentpc (lua_State *L, CallInfo *ci) { | 36 | static int currentpc (CallInfo *ci) { |
| 37 | if (!isLua(ci)) return -1; /* function is not a Lua function? */ | 37 | if (!isLua(ci)) return -1; /* function is not a Lua function? */ |
| 38 | return pcRel(ci->u.l.savedpc, ci_func(ci)->l.p); | 38 | return pcRel(ci->u.l.savedpc, ci_func(ci)->l.p); |
| 39 | } | 39 | } |
| 40 | 40 | ||
| 41 | 41 | ||
| 42 | static int currentline (lua_State *L, CallInfo *ci) { | 42 | static int currentline (CallInfo *ci) { |
| 43 | int pc = currentpc(L, ci); | 43 | int pc = currentpc(ci); |
| 44 | if (pc < 0) | 44 | if (pc < 0) |
| 45 | return -1; /* only active lua functions have current-line information */ | 45 | return -1; /* only active lua functions have current-line information */ |
| 46 | else | 46 | else |
| @@ -111,7 +111,7 @@ static Proto *getluaproto (CallInfo *ci) { | |||
| 111 | static const char *findlocal (lua_State *L, CallInfo *ci, int n) { | 111 | static const char *findlocal (lua_State *L, CallInfo *ci, int n) { |
| 112 | const char *name; | 112 | const char *name; |
| 113 | Proto *fp = getluaproto(ci); | 113 | Proto *fp = getluaproto(ci); |
| 114 | if (fp && (name = luaF_getlocalname(fp, n, currentpc(L, ci))) != NULL) | 114 | if (fp && (name = luaF_getlocalname(fp, n, currentpc(ci))) != NULL) |
| 115 | return name; /* is a local variable in a Lua function */ | 115 | return name; /* is a local variable in a Lua function */ |
| 116 | else { | 116 | else { |
| 117 | StkId limit = (ci == L->ci) ? L->top : ci->next->func; | 117 | StkId limit = (ci == L->ci) ? L->top : ci->next->func; |
| @@ -207,7 +207,7 @@ static int auxgetinfo (lua_State *L, const char *what, lua_Debug *ar, | |||
| 207 | break; | 207 | break; |
| 208 | } | 208 | } |
| 209 | case 'l': { | 209 | case 'l': { |
| 210 | ar->currentline = (ci) ? currentline(L, ci) : -1; | 210 | ar->currentline = (ci) ? currentline(ci) : -1; |
| 211 | break; | 211 | break; |
| 212 | } | 212 | } |
| 213 | case 'u': { | 213 | case 'u': { |
| @@ -477,7 +477,7 @@ static const char *getobjname (lua_State *L, CallInfo *ci, int stackpos, | |||
| 477 | const char **name) { | 477 | const char **name) { |
| 478 | if (isLua(ci)) { /* a Lua function? */ | 478 | if (isLua(ci)) { /* a Lua function? */ |
| 479 | Proto *p = ci_func(ci)->l.p; | 479 | Proto *p = ci_func(ci)->l.p; |
| 480 | int pc = currentpc(L, ci); | 480 | int pc = currentpc(ci); |
| 481 | Instruction i; | 481 | Instruction i; |
| 482 | *name = luaF_getlocalname(p, stackpos+1, pc); | 482 | *name = luaF_getlocalname(p, stackpos+1, pc); |
| 483 | if (*name) /* is a local? */ | 483 | if (*name) /* is a local? */ |
| @@ -526,7 +526,7 @@ static const char *getfuncname (lua_State *L, CallInfo *ci, const char **name) { | |||
| 526 | if ((isLua(ci) && ci->u.l.tailcalls > 0) || !isLua(ci->previous)) | 526 | if ((isLua(ci) && ci->u.l.tailcalls > 0) || !isLua(ci->previous)) |
| 527 | return NULL; /* calling function is not Lua (or is unknown) */ | 527 | return NULL; /* calling function is not Lua (or is unknown) */ |
| 528 | ci = ci->previous; /* calling function */ | 528 | ci = ci->previous; /* calling function */ |
| 529 | i = ci_func(ci)->l.p->code[currentpc(L, ci)]; | 529 | i = ci_func(ci)->l.p->code[currentpc(ci)]; |
| 530 | switch (GET_OPCODE(i)) { | 530 | switch (GET_OPCODE(i)) { |
| 531 | case OP_CALL: | 531 | case OP_CALL: |
| 532 | case OP_TAILCALL: | 532 | case OP_TAILCALL: |
| @@ -610,7 +610,7 @@ static void addinfo (lua_State *L, const char *msg) { | |||
| 610 | CallInfo *ci = L->ci; | 610 | CallInfo *ci = L->ci; |
| 611 | if (isLua(ci)) { /* is Lua code? */ | 611 | if (isLua(ci)) { /* is Lua code? */ |
| 612 | char buff[LUA_IDSIZE]; /* add file:line information */ | 612 | char buff[LUA_IDSIZE]; /* add file:line information */ |
| 613 | int line = currentline(L, ci); | 613 | int line = currentline(ci); |
| 614 | luaO_chunkid(buff, getstr(getluaproto(ci)->source), LUA_IDSIZE); | 614 | luaO_chunkid(buff, getstr(getluaproto(ci)->source), LUA_IDSIZE); |
| 615 | luaO_pushfstring(L, "%s:%d: %s", buff, line, msg); | 615 | luaO_pushfstring(L, "%s:%d: %s", buff, line, msg); |
| 616 | } | 616 | } |
