aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2000-03-30 14:19:48 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2000-03-30 14:19:48 -0300
commit556a89e53751135f45d8dd1e84651461b67e1f81 (patch)
tree85c4d8486d53e534100c4b8c9ab30c6990585496
parente2c60eda16d4aff7ea42513ba7c4d33ac45d9e99 (diff)
downloadlua-556a89e53751135f45d8dd1e84651461b67e1f81.tar.gz
lua-556a89e53751135f45d8dd1e84651461b67e1f81.tar.bz2
lua-556a89e53751135f45d8dd1e84651461b67e1f81.zip
new names for debug types
-rw-r--r--lauxlib.c4
-rw-r--r--ldblib.c16
-rw-r--r--ldebug.c22
-rw-r--r--ldo.c12
-rw-r--r--liolib.c4
-rw-r--r--lstate.h6
-rw-r--r--lua.c10
-rw-r--r--luadebug.h24
8 files changed, 49 insertions, 49 deletions
diff --git a/lauxlib.c b/lauxlib.c
index 42551e52..f0620236 100644
--- a/lauxlib.c
+++ b/lauxlib.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lauxlib.c,v 1.25 2000/01/19 12:00:45 roberto Exp roberto $ 2** $Id: lauxlib.c,v 1.26 2000/02/08 16:34:31 roberto Exp roberto $
3** Auxiliary functions for building Lua libraries 3** Auxiliary functions for building Lua libraries
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -31,7 +31,7 @@ int luaL_findstring (const char *name, const char *const list[]) {
31} 31}
32 32
33void luaL_argerror (lua_State *L, int narg, const char *extramsg) { 33void luaL_argerror (lua_State *L, int narg, const char *extramsg) {
34 lua_Dbgactreg ar; 34 lua_Debug ar;
35 lua_getstack(L, 0, &ar); 35 lua_getstack(L, 0, &ar);
36 lua_getinfo(L, "nu", &ar); 36 lua_getinfo(L, "nu", &ar);
37 narg -= ar.nups; 37 narg -= ar.nups;
diff --git a/ldblib.c b/ldblib.c
index ce6cfa2a..1859346e 100644
--- a/ldblib.c
+++ b/ldblib.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: ldblib.c,v 1.10 2000/01/19 12:00:45 roberto Exp roberto $ 2** $Id: ldblib.c,v 1.11 2000/03/03 14:58:26 roberto Exp roberto $
3** Interface from Lua to its debug API 3** Interface from Lua to its debug API
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -42,7 +42,7 @@ static void settabso (lua_State *L, lua_Object t, const char *i, lua_Object v) {
42 42
43 43
44static void getstack (lua_State *L) { 44static void getstack (lua_State *L) {
45 lua_Dbgactreg ar; 45 lua_Debug ar;
46 if (!lua_getstack(L, luaL_check_int(L, 1), &ar)) /* level out of range? */ 46 if (!lua_getstack(L, luaL_check_int(L, 1), &ar)) /* level out of range? */
47 return; 47 return;
48 else { 48 else {
@@ -79,8 +79,8 @@ static void getstack (lua_State *L) {
79 79
80 80
81static void getlocal (lua_State *L) { 81static void getlocal (lua_State *L) {
82 lua_Dbgactreg ar; 82 lua_Debug ar;
83 lua_Dbglocvar lvar; 83 lua_Localvar lvar;
84 if (!lua_getstack(L, luaL_check_int(L, 1), &ar)) /* level out of range? */ 84 if (!lua_getstack(L, luaL_check_int(L, 1), &ar)) /* level out of range? */
85 luaL_argerror(L, 1, "level out of range"); 85 luaL_argerror(L, 1, "level out of range");
86 lvar.index = luaL_check_int(L, 2); 86 lvar.index = luaL_check_int(L, 2);
@@ -92,8 +92,8 @@ static void getlocal (lua_State *L) {
92 92
93 93
94static void setlocal (lua_State *L) { 94static void setlocal (lua_State *L) {
95 lua_Dbgactreg ar; 95 lua_Debug ar;
96 lua_Dbglocvar lvar; 96 lua_Localvar lvar;
97 if (!lua_getstack(L, luaL_check_int(L, 1), &ar)) /* level out of range? */ 97 if (!lua_getstack(L, luaL_check_int(L, 1), &ar)) /* level out of range? */
98 luaL_argerror(L, 1, "level out of range"); 98 luaL_argerror(L, 1, "level out of range");
99 lvar.index = luaL_check_int(L, 2); 99 lvar.index = luaL_check_int(L, 2);
@@ -113,7 +113,7 @@ static int callhook = LUA_NOREF; /* Lua reference to call hook function */
113 113
114 114
115 115
116static void linef (lua_State *L, lua_Dbgactreg *ar) { 116static void linef (lua_State *L, lua_Debug *ar) {
117 if (linehook != LUA_NOREF) { 117 if (linehook != LUA_NOREF) {
118 lua_pushnumber(L, ar->currentline); 118 lua_pushnumber(L, ar->currentline);
119 lua_callfunction(L, lua_getref(L, linehook)); 119 lua_callfunction(L, lua_getref(L, linehook));
@@ -121,7 +121,7 @@ static void linef (lua_State *L, lua_Dbgactreg *ar) {
121} 121}
122 122
123 123
124static void callf (lua_State *L, lua_Dbgactreg *ar) { 124static void callf (lua_State *L, lua_Debug *ar) {
125 if (callhook != LUA_NOREF) { 125 if (callhook != LUA_NOREF) {
126 lua_pushstring(L, ar->event); 126 lua_pushstring(L, ar->event);
127 lua_callfunction(L, lua_getref(L, callhook)); 127 lua_callfunction(L, lua_getref(L, callhook));
diff --git a/ldebug.c b/ldebug.c
index 40bcb6e6..c392820c 100644
--- a/ldebug.c
+++ b/ldebug.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: ldebug.c,v 1.13 2000/03/27 20:10:21 roberto Exp roberto $ 2** $Id: ldebug.c,v 1.14 2000/03/29 20:19:20 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*/
@@ -41,15 +41,15 @@ static int hasdebuginfo (lua_State *L, StkId f) {
41} 41}
42 42
43 43
44lua_Dbghook lua_setcallhook (lua_State *L, lua_Dbghook func) { 44lua_Hook lua_setcallhook (lua_State *L, lua_Hook func) {
45 lua_Dbghook oldhook = L->callhook; 45 lua_Hook oldhook = L->callhook;
46 L->callhook = func; 46 L->callhook = func;
47 return oldhook; 47 return oldhook;
48} 48}
49 49
50 50
51lua_Dbghook lua_setlinehook (lua_State *L, lua_Dbghook func) { 51lua_Hook lua_setlinehook (lua_State *L, lua_Hook func) {
52 lua_Dbghook oldhook = L->linehook; 52 lua_Hook oldhook = L->linehook;
53 L->linehook = func; 53 L->linehook = func;
54 return oldhook; 54 return oldhook;
55} 55}
@@ -75,7 +75,7 @@ static StkId aux_stackedfunction (lua_State *L, int level, StkId top) {
75} 75}
76 76
77 77
78int lua_getstack (lua_State *L, int level, lua_Dbgactreg *ar) { 78int lua_getstack (lua_State *L, int level, lua_Debug *ar) {
79 StkId f = aux_stackedfunction(L, level, L->top); 79 StkId f = aux_stackedfunction(L, level, L->top);
80 if (f == NULL) return 0; /* there is no such level */ 80 if (f == NULL) return 0; /* there is no such level */
81 else { 81 else {
@@ -106,7 +106,7 @@ static Proto *getluaproto (StkId f) {
106} 106}
107 107
108 108
109int lua_getlocal (lua_State *L, const lua_Dbgactreg *ar, lua_Dbglocvar *v) { 109int lua_getlocal (lua_State *L, const lua_Debug *ar, lua_Localvar *v) {
110 StkId f = ar->_func; 110 StkId f = ar->_func;
111 Proto *fp = getluaproto(f); 111 Proto *fp = getluaproto(f);
112 if (!fp) return 0; /* `f' is not a Lua function? */ 112 if (!fp) return 0; /* `f' is not a Lua function? */
@@ -120,7 +120,7 @@ int lua_getlocal (lua_State *L, const lua_Dbgactreg *ar, lua_Dbglocvar *v) {
120} 120}
121 121
122 122
123int lua_setlocal (lua_State *L, const lua_Dbgactreg *ar, lua_Dbglocvar *v) { 123int lua_setlocal (lua_State *L, const lua_Debug *ar, lua_Localvar *v) {
124 StkId f = ar->_func; 124 StkId f = ar->_func;
125 Proto *fp = getluaproto(f); 125 Proto *fp = getluaproto(f);
126 if (!fp) return 0; /* `f' is not a Lua function? */ 126 if (!fp) return 0; /* `f' is not a Lua function? */
@@ -132,7 +132,7 @@ int lua_setlocal (lua_State *L, const lua_Dbgactreg *ar, lua_Dbglocvar *v) {
132} 132}
133 133
134 134
135static void lua_funcinfo (lua_Dbgactreg *ar) { 135static void lua_funcinfo (lua_Debug *ar) {
136 StkId func = ar->_func; 136 StkId func = ar->_func;
137 switch (ttype(func)) { 137 switch (ttype(func)) {
138 case TAG_LCLOSURE: case TAG_LCLMARK: 138 case TAG_LCLOSURE: case TAG_LCLMARK:
@@ -158,7 +158,7 @@ static int checkfunc (lua_State *L, TObject *o) {
158} 158}
159 159
160 160
161static void lua_getobjname (lua_State *L, StkId f, lua_Dbgactreg *ar) { 161static void lua_getobjname (lua_State *L, StkId f, lua_Debug *ar) {
162 GlobalVar *g; 162 GlobalVar *g;
163 /* try to find a name for given function */ 163 /* try to find a name for given function */
164 setnormalized(L->top, f); /* to be used by `checkfunc' */ 164 setnormalized(L->top, f); /* to be used by `checkfunc' */
@@ -176,7 +176,7 @@ static void lua_getobjname (lua_State *L, StkId f, lua_Dbgactreg *ar) {
176} 176}
177 177
178 178
179int lua_getinfo (lua_State *L, const char *what, lua_Dbgactreg *ar) { 179int lua_getinfo (lua_State *L, const char *what, lua_Debug *ar) {
180 StkId func = ar->_func; 180 StkId func = ar->_func;
181 LUA_ASSERT(L, is_T_MARK(ttype(func)), "invalid activation record"); 181 LUA_ASSERT(L, is_T_MARK(ttype(func)), "invalid activation record");
182 for (; *what; what++) { 182 for (; *what; what++) {
diff --git a/ldo.c b/ldo.c
index d9f6d14a..bd58c734 100644
--- a/ldo.c
+++ b/ldo.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: ldo.c,v 1.69 2000/03/10 18:37:44 roberto Exp roberto $ 2** $Id: ldo.c,v 1.70 2000/03/29 20:19:20 roberto Exp roberto $
3** Stack and Call structure of Lua 3** Stack and Call structure of Lua
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -55,7 +55,7 @@ void luaD_checkstack (lua_State *L, int n) {
55 lua_error(L, "BAD STACK OVERFLOW! DATA CORRUPTED!"); 55 lua_error(L, "BAD STACK OVERFLOW! DATA CORRUPTED!");
56 } 56 }
57 else { 57 else {
58 lua_Dbgactreg dummy; 58 lua_Debug dummy;
59 L->stack_last += EXTRA_STACK; /* to be used by error message */ 59 L->stack_last += EXTRA_STACK; /* to be used by error message */
60 if (lua_getstack(L, L->stacksize/SLOTS_PER_F, &dummy) == 0) { 60 if (lua_getstack(L, L->stacksize/SLOTS_PER_F, &dummy) == 0) {
61 /* too few funcs on stack: doesn't look like a recursion loop */ 61 /* too few funcs on stack: doesn't look like a recursion loop */
@@ -103,7 +103,7 @@ void luaD_openstack (lua_State *L, StkId pos) {
103 103
104void luaD_lineHook (lua_State *L, StkId func, int line) { 104void luaD_lineHook (lua_State *L, StkId func, int line) {
105 if (L->allowhooks) { 105 if (L->allowhooks) {
106 lua_Dbgactreg ar; 106 lua_Debug ar;
107 struct C_Lua_Stack oldCLS = L->Cstack; 107 struct C_Lua_Stack oldCLS = L->Cstack;
108 StkId old_top = L->Cstack.lua2C = L->Cstack.base = L->top; 108 StkId old_top = L->Cstack.lua2C = L->Cstack.base = L->top;
109 L->Cstack.num = 0; 109 L->Cstack.num = 0;
@@ -119,10 +119,10 @@ void luaD_lineHook (lua_State *L, StkId func, int line) {
119} 119}
120 120
121 121
122static void luaD_callHook (lua_State *L, StkId func, lua_Dbghook callhook, 122static void luaD_callHook (lua_State *L, StkId func, lua_Hook callhook,
123 const char *event) { 123 const char *event) {
124 if (L->allowhooks) { 124 if (L->allowhooks) {
125 lua_Dbgactreg ar; 125 lua_Debug ar;
126 struct C_Lua_Stack oldCLS = L->Cstack; 126 struct C_Lua_Stack oldCLS = L->Cstack;
127 StkId old_top = L->Cstack.lua2C = L->Cstack.base = L->top; 127 StkId old_top = L->Cstack.lua2C = L->Cstack.base = L->top;
128 L->Cstack.num = 0; 128 L->Cstack.num = 0;
@@ -179,7 +179,7 @@ void luaD_callTM (lua_State *L, const TObject *f, int nParams, int nResults) {
179*/ 179*/
180void luaD_call (lua_State *L, StkId func, int nResults) { 180void luaD_call (lua_State *L, StkId func, int nResults) {
181 StkId firstResult; 181 StkId firstResult;
182 lua_Dbghook callhook = L->callhook; 182 lua_Hook callhook = L->callhook;
183 retry: /* for `function' tag method */ 183 retry: /* for `function' tag method */
184 switch (ttype(func)) { 184 switch (ttype(func)) {
185 case TAG_LCLOSURE: { 185 case TAG_LCLOSURE: {
diff --git a/liolib.c b/liolib.c
index 81142793..68358f6a 100644
--- a/liolib.c
+++ b/liolib.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: liolib.c,v 1.59 2000/03/20 19:13:45 roberto Exp roberto $ 2** $Id: liolib.c,v 1.60 2000/03/22 16:24:13 roberto Exp roberto $
3** Standard I/O (and system) library 3** Standard I/O (and system) library
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -536,7 +536,7 @@ static void io_debug (lua_State *L) {
536static void errorfb (lua_State *L) { 536static void errorfb (lua_State *L) {
537 char buff[MAXMESSAGE]; 537 char buff[MAXMESSAGE];
538 int level = 1; /* skip level 0 (it's this function) */ 538 int level = 1; /* skip level 0 (it's this function) */
539 lua_Dbgactreg ar; 539 lua_Debug ar;
540 lua_Object alertfunc = lua_rawgetglobal(L, "_ALERT"); 540 lua_Object alertfunc = lua_rawgetglobal(L, "_ALERT");
541 sprintf(buff, "error: %.200s\n", lua_getstring(L, lua_getparam(L, 1))); 541 sprintf(buff, "error: %.200s\n", lua_getstring(L, lua_getparam(L, 1)));
542 while (lua_getstack(L, level++, &ar)) { 542 while (lua_getstack(L, level++, &ar)) {
diff --git a/lstate.h b/lstate.h
index bda30bb9..d099e6aa 100644
--- a/lstate.h
+++ b/lstate.h
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lstate.h,v 1.29 2000/02/08 16:34:31 roberto Exp roberto $ 2** $Id: lstate.h,v 1.30 2000/03/10 18:37:44 roberto Exp roberto $
3** Global State 3** Global State
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -76,8 +76,8 @@ struct lua_State {
76 unsigned long GCthreshold; 76 unsigned long GCthreshold;
77 unsigned long nblocks; /* number of `blocks' currently allocated */ 77 unsigned long nblocks; /* number of `blocks' currently allocated */
78 int debug; 78 int debug;
79 lua_Dbghook callhook; 79 lua_Hook callhook;
80 lua_Dbghook linehook; 80 lua_Hook linehook;
81 int allowhooks; 81 int allowhooks;
82}; 82};
83 83
diff --git a/lua.c b/lua.c
index 4afec88b..b387253f 100644
--- a/lua.c
+++ b/lua.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lua.c,v 1.34 2000/03/03 14:58:26 roberto Exp roberto $ 2** $Id: lua.c,v 1.35 2000/03/20 20:27:32 roberto Exp roberto $
3** Lua stand-alone interpreter 3** Lua stand-alone interpreter
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -30,8 +30,8 @@ typedef void (*handler)(int); /* type for signal actions */
30static void laction (int i); 30static void laction (int i);
31 31
32 32
33static lua_Dbghook old_linehook = NULL; 33static lua_Hook old_linehook = NULL;
34static lua_Dbghook old_callhook = NULL; 34static lua_Hook old_callhook = NULL;
35 35
36 36
37static handler lreset (void) { 37static handler lreset (void) {
@@ -51,8 +51,8 @@ static void laction (int i) {
51 (void)i; /* to avoid warnings */ 51 (void)i; /* to avoid warnings */
52 signal(SIGINT, SIG_DFL); /* if another SIGINT happens before lstop, 52 signal(SIGINT, SIG_DFL); /* if another SIGINT happens before lstop,
53 terminate process (default action) */ 53 terminate process (default action) */
54 old_linehook = lua_setlinehook(lua_state, (lua_Dbghook)lstop); 54 old_linehook = lua_setlinehook(lua_state, (lua_Hook)lstop);
55 old_callhook = lua_setcallhook(lua_state, (lua_Dbghook)lstop); 55 old_callhook = lua_setcallhook(lua_state, (lua_Hook)lstop);
56} 56}
57 57
58 58
diff --git a/luadebug.h b/luadebug.h
index 9c3820a0..09f2b1e4 100644
--- a/luadebug.h
+++ b/luadebug.h
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: luadebug.h,v 1.8 1999/11/22 13:12:07 roberto Exp roberto $ 2** $Id: luadebug.h,v 1.9 2000/01/19 12:00:45 roberto Exp roberto $
3** Debugging API 3** Debugging API
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -11,25 +11,25 @@
11 11
12#include "lua.h" 12#include "lua.h"
13 13
14typedef struct lua_Dbgactreg lua_Dbgactreg; /* activation record */ 14typedef struct lua_Debug lua_Debug; /* activation record */
15typedef struct lua_Dbglocvar lua_Dbglocvar; /* local variable */ 15typedef struct lua_Localvar lua_Localvar;
16 16
17typedef void (*lua_Dbghook) (lua_State *L, lua_Dbgactreg *ar); 17typedef void (*lua_Hook) (lua_State *L, lua_Debug *ar);
18 18
19 19
20int lua_getstack (lua_State *L, int level, lua_Dbgactreg *ar); 20int lua_getstack (lua_State *L, int level, lua_Debug *ar);
21int lua_getinfo (lua_State *L, const char *what, lua_Dbgactreg *ar); 21int lua_getinfo (lua_State *L, const char *what, lua_Debug *ar);
22int lua_getlocal (lua_State *L, const lua_Dbgactreg *ar, lua_Dbglocvar *v); 22int lua_getlocal (lua_State *L, const lua_Debug *ar, lua_Localvar *v);
23int lua_setlocal (lua_State *L, const lua_Dbgactreg *ar, lua_Dbglocvar *v); 23int lua_setlocal (lua_State *L, const lua_Debug *ar, lua_Localvar *v);
24 24
25int lua_setdebug (lua_State *L, int debug); 25int lua_setdebug (lua_State *L, int debug);
26 26
27lua_Dbghook lua_setcallhook (lua_State *L, lua_Dbghook func); 27lua_Hook lua_setcallhook (lua_State *L, lua_Hook func);
28lua_Dbghook lua_setlinehook (lua_State *L, lua_Dbghook func); 28lua_Hook lua_setlinehook (lua_State *L, lua_Hook func);
29 29
30 30
31 31
32struct lua_Dbgactreg { 32struct lua_Debug {
33 const char *event; /* `call', `return' */ 33 const char *event; /* `call', `return' */
34 const char *source; /* (S) */ 34 const char *source; /* (S) */
35 int linedefined; /* (S) */ 35 int linedefined; /* (S) */
@@ -44,7 +44,7 @@ struct lua_Dbgactreg {
44}; 44};
45 45
46 46
47struct lua_Dbglocvar { 47struct lua_Localvar {
48 int index; 48 int index;
49 const char *name; 49 const char *name;
50 lua_Object value; 50 lua_Object value;