aboutsummaryrefslogtreecommitdiff
path: root/ldebug.c
diff options
context:
space:
mode:
Diffstat (limited to 'ldebug.c')
-rw-r--r--ldebug.c17
1 files changed, 5 insertions, 12 deletions
diff --git a/ldebug.c b/ldebug.c
index 60fdfa37..40d1a003 100644
--- a/ldebug.c
+++ b/ldebug.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: ldebug.c,v 1.28 2000/08/07 20:21:34 roberto Exp roberto $ 2** $Id: ldebug.c,v 1.29 2000/08/08 18:26:05 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*/
@@ -57,13 +57,6 @@ lua_Hook lua_setlinehook (lua_State *L, lua_Hook func) {
57} 57}
58 58
59 59
60int lua_setdebug (lua_State *L, int debug) {
61 int old = L->debug;
62 L->debug = debug;
63 return old;
64}
65
66
67static StkId aux_stackedfunction (lua_State *L, int level, StkId top) { 60static StkId aux_stackedfunction (lua_State *L, int level, StkId top) {
68 int i; 61 int i;
69 for (i = (top-1)-L->stack; i>=0; i--) { 62 for (i = (top-1)-L->stack; i>=0; i--) {
@@ -140,9 +133,7 @@ static int lua_currentline (StkId f) {
140 else { 133 else {
141 CallInfo *ci = infovalue(f); 134 CallInfo *ci = infovalue(f);
142 int *lineinfo = ci->func->f.l->lineinfo; 135 int *lineinfo = ci->func->f.l->lineinfo;
143 if (!lineinfo) return -1; /* no static debug information */ 136 return luaG_getline(lineinfo, lua_currentpc(f), 1, NULL);
144 else
145 return luaG_getline(lineinfo, lua_currentpc(f), 1, NULL);
146 } 137 }
147} 138}
148 139
@@ -382,7 +373,8 @@ static const char *getname (lua_State *L, StkId obj, const char **name) {
382 } 373 }
383 case OP_GETLOCAL: { 374 case OP_GETLOCAL: {
384 *name = luaF_getlocalname(p, GETARG_U(i)+1, pc); 375 *name = luaF_getlocalname(p, GETARG_U(i)+1, pc);
385 return (*name) ? "local" : NULL; 376 LUA_ASSERT(*name, "local must exist");
377 return "local";
386 } 378 }
387 case OP_PUSHSELF: 379 case OP_PUSHSELF:
388 case OP_GETDOTTED: { 380 case OP_GETDOTTED: {
@@ -418,3 +410,4 @@ void luaG_callerror (lua_State *L, StkId func) {
418void luaG_indexerror (lua_State *L, StkId t) { 410void luaG_indexerror (lua_State *L, StkId t) {
419 call_index_error(L, t, "index", "table"); 411 call_index_error(L, t, "index", "table");
420} 412}
413