summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ldblib.c4
-rw-r--r--ldebug.h4
-rw-r--r--llimits.h6
-rw-r--r--lstate.h4
-rw-r--r--luadebug.h5
-rw-r--r--lvm.c4
6 files changed, 15 insertions, 12 deletions
diff --git a/ldblib.c b/ldblib.c
index b6c78588..fc056cce 100644
--- a/ldblib.c
+++ b/ldblib.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: ldblib.c,v 1.61 2002/06/25 19:16:44 roberto Exp roberto $ 2** $Id: ldblib.c,v 1.62 2002/07/08 18:21:33 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*/
@@ -132,7 +132,7 @@ static int makemask (const char *smask, int count) {
132 if (strchr(smask, 'c')) mask |= LUA_MASKCALL; 132 if (strchr(smask, 'c')) mask |= LUA_MASKCALL;
133 if (strchr(smask, 'r')) mask |= LUA_MASKRET; 133 if (strchr(smask, 'r')) mask |= LUA_MASKRET;
134 if (strchr(smask, 'l')) mask |= LUA_MASKLINE; 134 if (strchr(smask, 'l')) mask |= LUA_MASKLINE;
135 return mask | lua_maskcount(count); 135 return mask | LUA_MASKCOUNT(count);
136} 136}
137 137
138 138
diff --git a/ldebug.h b/ldebug.h
index 0849a302..735e914e 100644
--- a/ldebug.h
+++ b/ldebug.h
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: ldebug.h,v 1.23 2002/06/24 15:07:21 roberto Exp roberto $ 2** $Id: ldebug.h,v 1.24 2002/07/08 18:21:33 roberto Exp roberto $
3** Auxiliary functions from Debug Interface module 3** Auxiliary functions from Debug Interface module
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -17,7 +17,7 @@
17#define getline(f,pc) (((f)->lineinfo) ? (f)->lineinfo[pc] : 0) 17#define getline(f,pc) (((f)->lineinfo) ? (f)->lineinfo[pc] : 0)
18 18
19#define resethookcount(L) \ 19#define resethookcount(L) \
20 (L->hookcount = (1 << lua_getmaskcount(L->hookmask)) >> 1) 20 (L->hookcount = lua_getmaskcount(L->hookmask), L->hookcount *= L->hookcount)
21 21
22#define setallowhook(L,cond) ((L->hookmask) = ((L->hookmask) & ~1) | (cond)) 22#define setallowhook(L,cond) ((L->hookmask) = ((L->hookmask) & ~1) | (cond))
23#define allowhook(L) ((L->hookmask) & 1) 23#define allowhook(L) ((L->hookmask) & 1)
diff --git a/llimits.h b/llimits.h
index bc686a4f..ca7dce5e 100644
--- a/llimits.h
+++ b/llimits.h
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: llimits.h,v 1.43 2002/04/23 14:59:35 roberto Exp roberto $ 2** $Id: llimits.h,v 1.44 2002/06/13 13:45:31 roberto Exp roberto $
3** Limits, basic types, and some other `installation-dependent' definitions 3** Limits, basic types, and some other `installation-dependent' definitions
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -52,6 +52,10 @@ typedef unsigned long lu_mem;
52/* an integer big enough to count the number of strings in use */ 52/* an integer big enough to count the number of strings in use */
53typedef long ls_nstr; 53typedef long ls_nstr;
54 54
55/* an integer big enough to count the number of steps when calling a
56** `count' hook */
57typedef long ls_count;
58
55 59
56/* chars used as small naturals (so that `char' is reserved for characteres) */ 60/* chars used as small naturals (so that `char' is reserved for characteres) */
57typedef unsigned char lu_byte; 61typedef unsigned char lu_byte;
diff --git a/lstate.h b/lstate.h
index 4f3290ef..ef47de36 100644
--- a/lstate.h
+++ b/lstate.h
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lstate.h,v 1.86 2002/07/02 16:43:28 roberto Exp roberto $ 2** $Id: lstate.h,v 1.87 2002/07/08 18:21:33 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*/
@@ -131,7 +131,7 @@ struct lua_State {
131 CallInfo *base_ci; /* array of CallInfo's */ 131 CallInfo *base_ci; /* array of CallInfo's */
132 global_State *l_G; 132 global_State *l_G;
133 int hookmask; 133 int hookmask;
134 int hookcount; 134 ls_count hookcount;
135 lua_Hook hook; 135 lua_Hook hook;
136 TObject globs[NUMGLOBS]; /* registry, table of globals, etc. */ 136 TObject globs[NUMGLOBS]; /* registry, table of globals, etc. */
137 struct lua_longjmp *errorJmp; /* current error recover point */ 137 struct lua_longjmp *errorJmp; /* current error recover point */
diff --git a/luadebug.h b/luadebug.h
index d8c82c2d..0f277727 100644
--- a/luadebug.h
+++ b/luadebug.h
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: luadebug.h,v 1.28 2002/06/18 17:10:43 roberto Exp roberto $ 2** $Id: luadebug.h,v 1.29 2002/07/08 18:21:33 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*/
@@ -19,9 +19,8 @@ typedef enum lua_Hookevent {
19#define LUA_MASKCALL (2 << LUA_HOOKCALL) 19#define LUA_MASKCALL (2 << LUA_HOOKCALL)
20#define LUA_MASKRET (2 << LUA_HOOKRET) 20#define LUA_MASKRET (2 << LUA_HOOKRET)
21#define LUA_MASKLINE (2 << LUA_HOOKLINE) 21#define LUA_MASKLINE (2 << LUA_HOOKLINE)
22#define lua_maskcount(count) ((count) << (LUA_HOOKCOUNT+1)) 22#define LUA_MASKCOUNT(count) ((count) << (LUA_HOOKCOUNT+1))
23#define lua_getmaskcount(mask) ((mask) >> (LUA_HOOKCOUNT+1)) 23#define lua_getmaskcount(mask) ((mask) >> (LUA_HOOKCOUNT+1))
24#define LUA_MASKCOUNT (lua_maskcount(1))
25 24
26typedef struct lua_Debug lua_Debug; /* activation record */ 25typedef struct lua_Debug lua_Debug; /* activation record */
27 26
diff --git a/lvm.c b/lvm.c
index 20674c61..ced4d7f1 100644
--- a/lvm.c
+++ b/lvm.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lvm.c,v 1.244 2002/07/05 18:27:39 roberto Exp roberto $ 2** $Id: lvm.c,v 1.245 2002/07/08 18:21:33 roberto Exp roberto $
3** Lua virtual machine 3** Lua virtual machine
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -70,7 +70,7 @@ int luaV_tostring (lua_State *L, TObject *obj) {
70 70
71static void traceexec (lua_State *L) { 71static void traceexec (lua_State *L) {
72 int mask = L->hookmask; 72 int mask = L->hookmask;
73 if (mask >= LUA_MASKCOUNT) { /* instruction hook set? */ 73 if (mask > LUA_MASKLINE) { /* instruction hook set? */
74 if (L->hookcount == 0) { 74 if (L->hookcount == 0) {
75 luaD_callhook(L, LUA_HOOKCOUNT, -1); 75 luaD_callhook(L, LUA_HOOKCOUNT, -1);
76 resethookcount(L); 76 resethookcount(L);