summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lauxlib.c3
-rw-r--r--lbaselib.c3
-rw-r--r--ldblib.c3
-rw-r--r--ldebug.c3
-rw-r--r--ldebug.h3
-rw-r--r--liolib.c3
-rw-r--r--lstate.h3
-rw-r--r--ltablib.c3
-rw-r--r--ltests.c3
-rw-r--r--lua.c3
-rw-r--r--lua.h56
-rw-r--r--luadebug.h57
12 files changed, 63 insertions, 80 deletions
diff --git a/lauxlib.c b/lauxlib.c
index 068e01f5..c37135e2 100644
--- a/lauxlib.c
+++ b/lauxlib.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lauxlib.c,v 1.80 2002/08/06 15:32:22 roberto Exp roberto $ 2** $Id: lauxlib.c,v 1.81 2002/08/06 17:26:45 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*/
@@ -23,7 +23,6 @@
23#include "lua.h" 23#include "lua.h"
24 24
25#include "lauxlib.h" 25#include "lauxlib.h"
26#include "luadebug.h"
27 26
28 27
29/* 28/*
diff --git a/lbaselib.c b/lbaselib.c
index 9658a1c6..4ae7ff40 100644
--- a/lbaselib.c
+++ b/lbaselib.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lbaselib.c,v 1.93 2002/08/06 15:32:22 roberto Exp roberto $ 2** $Id: lbaselib.c,v 1.94 2002/08/06 17:06:56 roberto Exp roberto $
3** Basic library 3** Basic library
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -14,7 +14,6 @@
14#include "lua.h" 14#include "lua.h"
15 15
16#include "lauxlib.h" 16#include "lauxlib.h"
17#include "luadebug.h"
18#include "lualib.h" 17#include "lualib.h"
19 18
20 19
diff --git a/ldblib.c b/ldblib.c
index c86a12b4..eb429acc 100644
--- a/ldblib.c
+++ b/ldblib.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: ldblib.c,v 1.64 2002/07/17 16:25:13 roberto Exp roberto $ 2** $Id: ldblib.c,v 1.65 2002/08/05 17:36:24 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*/
@@ -12,7 +12,6 @@
12#include "lua.h" 12#include "lua.h"
13 13
14#include "lauxlib.h" 14#include "lauxlib.h"
15#include "luadebug.h"
16#include "lualib.h" 15#include "lualib.h"
17 16
18 17
diff --git a/ldebug.c b/ldebug.c
index 0108b47e..c77278ec 100644
--- a/ldebug.c
+++ b/ldebug.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: ldebug.c,v 1.126 2002/08/05 14:51:21 roberto Exp roberto $ 2** $Id: ldebug.c,v 1.127 2002/08/06 15:32:22 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*/
@@ -21,7 +21,6 @@
21#include "lstring.h" 21#include "lstring.h"
22#include "ltable.h" 22#include "ltable.h"
23#include "ltm.h" 23#include "ltm.h"
24#include "luadebug.h"
25#include "lvm.h" 24#include "lvm.h"
26 25
27 26
diff --git a/ldebug.h b/ldebug.h
index c6cccd8c..19a96be4 100644
--- a/ldebug.h
+++ b/ldebug.h
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: ldebug.h,v 1.26 2002/08/05 14:51:21 roberto Exp roberto $ 2** $Id: ldebug.h,v 1.27 2002/08/06 15:32:22 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*/
@@ -9,7 +9,6 @@
9 9
10 10
11#include "lstate.h" 11#include "lstate.h"
12#include "luadebug.h"
13 12
14 13
15#define pcRel(pc, p) (cast(int, (pc) - (p)->code) - 1) 14#define pcRel(pc, p) (cast(int, (pc) - (p)->code) - 1)
diff --git a/liolib.c b/liolib.c
index 2798e2bf..8961652e 100644
--- a/liolib.c
+++ b/liolib.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: liolib.c,v 2.13 2002/07/12 18:54:53 roberto Exp roberto $ 2** $Id: liolib.c,v 2.14 2002/07/17 16:25: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*/
@@ -15,7 +15,6 @@
15#include "lua.h" 15#include "lua.h"
16 16
17#include "lauxlib.h" 17#include "lauxlib.h"
18#include "luadebug.h"
19#include "lualib.h" 18#include "lualib.h"
20 19
21 20
diff --git a/lstate.h b/lstate.h
index 2cbebc23..bcd411a6 100644
--- a/lstate.h
+++ b/lstate.h
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lstate.h,v 1.90 2002/08/05 17:36:24 roberto Exp roberto $ 2** $Id: lstate.h,v 1.91 2002/08/06 15:32:22 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*/
@@ -11,7 +11,6 @@
11 11
12#include "lobject.h" 12#include "lobject.h"
13#include "ltm.h" 13#include "ltm.h"
14#include "luadebug.h"
15 14
16 15
17/* 16/*
diff --git a/ltablib.c b/ltablib.c
index 4842a688..86eb31f3 100644
--- a/ltablib.c
+++ b/ltablib.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: ltablib.c,v 1.10 2002/07/08 16:51:20 roberto Exp roberto $ 2** $Id: ltablib.c,v 1.11 2002/08/06 17:06:56 roberto Exp roberto $
3** Library for Table Manipulation 3** Library for Table Manipulation
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -10,7 +10,6 @@
10#include "lua.h" 10#include "lua.h"
11 11
12#include "lauxlib.h" 12#include "lauxlib.h"
13#include "luadebug.h"
14#include "lualib.h" 13#include "lualib.h"
15 14
16 15
diff --git a/ltests.c b/ltests.c
index dcef65c3..cb11b4e1 100644
--- a/ltests.c
+++ b/ltests.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: ltests.c,v 1.131 2002/08/05 14:10:10 roberto Exp roberto $ 2** $Id: ltests.c,v 1.132 2002/08/06 15:32:22 roberto Exp roberto $
3** Internal Module for Debugging of the Lua Implementation 3** Internal Module for Debugging of the Lua Implementation
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -25,7 +25,6 @@
25#include "lstate.h" 25#include "lstate.h"
26#include "lstring.h" 26#include "lstring.h"
27#include "ltable.h" 27#include "ltable.h"
28#include "luadebug.h"
29#include "lualib.h" 28#include "lualib.h"
30 29
31 30
diff --git a/lua.c b/lua.c
index 19713f40..481fd948 100644
--- a/lua.c
+++ b/lua.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lua.c,v 1.97 2002/07/10 20:49:01 roberto Exp roberto $ 2** $Id: lua.c,v 1.98 2002/08/06 15:32:22 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*/
@@ -13,7 +13,6 @@
13#include "lua.h" 13#include "lua.h"
14 14
15#include "lauxlib.h" 15#include "lauxlib.h"
16#include "luadebug.h"
17#include "lualib.h" 16#include "lualib.h"
18 17
19 18
diff --git a/lua.h b/lua.h
index 786ba8d6..955b052a 100644
--- a/lua.h
+++ b/lua.h
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lua.h,v 1.150 2002/08/06 17:06:56 roberto Exp roberto $ 2** $Id: lua.h,v 1.151 2002/08/06 17:26:45 roberto Exp roberto $
3** Lua - An Extensible Extension Language 3** Lua - An Extensible Extension Language
4** Tecgraf: Computer Graphics Technology Group, PUC-Rio, Brazil 4** Tecgraf: Computer Graphics Technology Group, PUC-Rio, Brazil
5** http://www.lua.org mailto:info@lua.org 5** http://www.lua.org mailto:info@lua.org
@@ -282,8 +282,6 @@ LUA_API int lua_pushupvalues (lua_State *L);
282 282
283#define lua_getref(L,ref) lua_rawgeti(L, LUA_REGISTRYINDEX, ref) 283#define lua_getref(L,ref) lua_rawgeti(L, LUA_REGISTRYINDEX, ref)
284 284
285#endif
286
287 285
288 286
289/* 287/*
@@ -304,6 +302,56 @@ LUA_API int lua_pushupvalues (lua_State *L);
304/* }====================================================================== */ 302/* }====================================================================== */
305 303
306 304
305/*
306** {======================================================================
307** Debug API
308** =======================================================================
309*/
310
311typedef enum lua_Hookevent {
312 LUA_HOOKCALL, LUA_HOOKRET, LUA_HOOKLINE, LUA_HOOKCOUNT
313} lua_Hookevent;
314
315
316#define LUA_MASKCALL (2 << LUA_HOOKCALL)
317#define LUA_MASKRET (2 << LUA_HOOKRET)
318#define LUA_MASKLINE (2 << LUA_HOOKLINE)
319#define LUA_MASKCOUNT(count) ((count) << (LUA_HOOKCOUNT+1))
320#define lua_getmaskcount(mask) ((mask) >> (LUA_HOOKCOUNT+1))
321
322typedef struct lua_Debug lua_Debug; /* activation record */
323
324typedef void (*lua_Hook) (lua_State *L, lua_Debug *ar);
325
326
327LUA_API int lua_getstack (lua_State *L, int level, lua_Debug *ar);
328LUA_API int lua_getinfo (lua_State *L, const char *what, lua_Debug *ar);
329LUA_API const char *lua_getlocal (lua_State *L, const lua_Debug *ar, int n);
330LUA_API const char *lua_setlocal (lua_State *L, const lua_Debug *ar, int n);
331
332LUA_API int lua_sethook (lua_State *L, lua_Hook func, int mask);
333LUA_API lua_Hook lua_gethook (lua_State *L);
334LUA_API int lua_gethookmask (lua_State *L);
335
336
337#define LUA_IDSIZE 60
338
339struct lua_Debug {
340 lua_Hookevent event;
341 const char *name; /* (n) */
342 const char *namewhat; /* (n) `global', `local', `field', `method' */
343 const char *what; /* (S) `Lua' function, `C' function, Lua `main' */
344 const char *source; /* (S) */
345 int currentline; /* (l) */
346 int nups; /* (u) number of upvalues */
347 int linedefined; /* (S) */
348 char short_src[LUA_IDSIZE]; /* (S) */
349 /* private part */
350 int i_ci; /* active function */
351};
352
353/* }====================================================================== */
354
307 355
308/****************************************************************************** 356/******************************************************************************
309* Copyright (C) 2002 Tecgraf, PUC-Rio. All rights reserved. 357* Copyright (C) 2002 Tecgraf, PUC-Rio. All rights reserved.
@@ -328,3 +376,5 @@ LUA_API int lua_pushupvalues (lua_State *L);
328* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 376* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
329******************************************************************************/ 377******************************************************************************/
330 378
379
380#endif
diff --git a/luadebug.h b/luadebug.h
deleted file mode 100644
index 4a37c640..00000000
--- a/luadebug.h
+++ /dev/null
@@ -1,57 +0,0 @@
1/*
2** $Id: luadebug.h,v 1.30 2002/07/08 20:22:08 roberto Exp $
3** Debugging API
4** See Copyright Notice in lua.h
5*/
6
7
8#ifndef luadebug_h
9#define luadebug_h
10
11
12#include "lua.h"
13
14typedef enum lua_Hookevent {
15 LUA_HOOKCALL, LUA_HOOKRET, LUA_HOOKLINE, LUA_HOOKCOUNT
16} lua_Hookevent;
17
18
19#define LUA_MASKCALL (2 << LUA_HOOKCALL)
20#define LUA_MASKRET (2 << LUA_HOOKRET)
21#define LUA_MASKLINE (2 << LUA_HOOKLINE)
22#define LUA_MASKCOUNT(count) ((count) << (LUA_HOOKCOUNT+1))
23#define lua_getmaskcount(mask) ((mask) >> (LUA_HOOKCOUNT+1))
24
25typedef struct lua_Debug lua_Debug; /* activation record */
26
27typedef void (*lua_Hook) (lua_State *L, lua_Debug *ar);
28
29
30LUA_API int lua_getstack (lua_State *L, int level, lua_Debug *ar);
31LUA_API int lua_getinfo (lua_State *L, const char *what, lua_Debug *ar);
32LUA_API const char *lua_getlocal (lua_State *L, const lua_Debug *ar, int n);
33LUA_API const char *lua_setlocal (lua_State *L, const lua_Debug *ar, int n);
34
35LUA_API int lua_sethook (lua_State *L, lua_Hook func, int mask);
36LUA_API lua_Hook lua_gethook (lua_State *L);
37LUA_API int lua_gethookmask (lua_State *L);
38
39
40#define LUA_IDSIZE 60
41
42struct lua_Debug {
43 lua_Hookevent event;
44 const char *name; /* (n) */
45 const char *namewhat; /* (n) `global', `local', `field', `method' */
46 const char *what; /* (S) `Lua' function, `C' function, Lua `main' */
47 const char *source; /* (S) */
48 int currentline; /* (l) */
49 int nups; /* (u) number of upvalues */
50 int linedefined; /* (S) */
51 char short_src[LUA_IDSIZE]; /* (S) */
52 /* private part */
53 int i_ci; /* active function */
54};
55
56
57#endif