diff --git a/lauxlib.c b/lauxlib.c index 068e01f5..c37135e2 100644 --- a/lauxlib.c +++ b/lauxlib.c @@ -1,5 +1,5 @@ /* -** $Id: lauxlib.c,v 1.80 2002/08/06 15:32:22 roberto Exp roberto $ +** $Id: lauxlib.c,v 1.81 2002/08/06 17:26:45 roberto Exp roberto $ ** Auxiliary functions for building Lua libraries ** See Copyright Notice in lua.h */ @@ -23,7 +23,6 @@ #include "lua.h" #include "lauxlib.h" -#include "luadebug.h" /* diff --git a/lbaselib.c b/lbaselib.c index 9658a1c6..4ae7ff40 100644 --- a/lbaselib.c +++ b/lbaselib.c @@ -1,5 +1,5 @@ /* -** $Id: lbaselib.c,v 1.93 2002/08/06 15:32:22 roberto Exp roberto $ +** $Id: lbaselib.c,v 1.94 2002/08/06 17:06:56 roberto Exp roberto $ ** Basic library ** See Copyright Notice in lua.h */ @@ -14,7 +14,6 @@ #include "lua.h" #include "lauxlib.h" -#include "luadebug.h" #include "lualib.h" diff --git a/ldblib.c b/ldblib.c index c86a12b4..eb429acc 100644 --- a/ldblib.c +++ b/ldblib.c @@ -1,5 +1,5 @@ /* -** $Id: ldblib.c,v 1.64 2002/07/17 16:25:13 roberto Exp roberto $ +** $Id: ldblib.c,v 1.65 2002/08/05 17:36:24 roberto Exp roberto $ ** Interface from Lua to its debug API ** See Copyright Notice in lua.h */ @@ -12,7 +12,6 @@ #include "lua.h" #include "lauxlib.h" -#include "luadebug.h" #include "lualib.h" diff --git a/ldebug.c b/ldebug.c index 0108b47e..c77278ec 100644 --- a/ldebug.c +++ b/ldebug.c @@ -1,5 +1,5 @@ /* -** $Id: ldebug.c,v 1.126 2002/08/05 14:51:21 roberto Exp roberto $ +** $Id: ldebug.c,v 1.127 2002/08/06 15:32:22 roberto Exp roberto $ ** Debug Interface ** See Copyright Notice in lua.h */ @@ -21,7 +21,6 @@ #include "lstring.h" #include "ltable.h" #include "ltm.h" -#include "luadebug.h" #include "lvm.h" diff --git a/ldebug.h b/ldebug.h index c6cccd8c..19a96be4 100644 --- a/ldebug.h +++ b/ldebug.h @@ -1,5 +1,5 @@ /* -** $Id: ldebug.h,v 1.26 2002/08/05 14:51:21 roberto Exp roberto $ +** $Id: ldebug.h,v 1.27 2002/08/06 15:32:22 roberto Exp roberto $ ** Auxiliary functions from Debug Interface module ** See Copyright Notice in lua.h */ @@ -9,7 +9,6 @@ #include "lstate.h" -#include "luadebug.h" #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 @@ /* -** $Id: liolib.c,v 2.13 2002/07/12 18:54:53 roberto Exp roberto $ +** $Id: liolib.c,v 2.14 2002/07/17 16:25:13 roberto Exp roberto $ ** Standard I/O (and system) library ** See Copyright Notice in lua.h */ @@ -15,7 +15,6 @@ #include "lua.h" #include "lauxlib.h" -#include "luadebug.h" #include "lualib.h" diff --git a/lstate.h b/lstate.h index 2cbebc23..bcd411a6 100644 --- a/lstate.h +++ b/lstate.h @@ -1,5 +1,5 @@ /* -** $Id: lstate.h,v 1.90 2002/08/05 17:36:24 roberto Exp roberto $ +** $Id: lstate.h,v 1.91 2002/08/06 15:32:22 roberto Exp roberto $ ** Global State ** See Copyright Notice in lua.h */ @@ -11,7 +11,6 @@ #include "lobject.h" #include "ltm.h" -#include "luadebug.h" /* diff --git a/ltablib.c b/ltablib.c index 4842a688..86eb31f3 100644 --- a/ltablib.c +++ b/ltablib.c @@ -1,5 +1,5 @@ /* -** $Id: ltablib.c,v 1.10 2002/07/08 16:51:20 roberto Exp roberto $ +** $Id: ltablib.c,v 1.11 2002/08/06 17:06:56 roberto Exp roberto $ ** Library for Table Manipulation ** See Copyright Notice in lua.h */ @@ -10,7 +10,6 @@ #include "lua.h" #include "lauxlib.h" -#include "luadebug.h" #include "lualib.h" diff --git a/ltests.c b/ltests.c index dcef65c3..cb11b4e1 100644 --- a/ltests.c +++ b/ltests.c @@ -1,5 +1,5 @@ /* -** $Id: ltests.c,v 1.131 2002/08/05 14:10:10 roberto Exp roberto $ +** $Id: ltests.c,v 1.132 2002/08/06 15:32:22 roberto Exp roberto $ ** Internal Module for Debugging of the Lua Implementation ** See Copyright Notice in lua.h */ @@ -25,7 +25,6 @@ #include "lstate.h" #include "lstring.h" #include "ltable.h" -#include "luadebug.h" #include "lualib.h" diff --git a/lua.c b/lua.c index 19713f40..481fd948 100644 --- a/lua.c +++ b/lua.c @@ -1,5 +1,5 @@ /* -** $Id: lua.c,v 1.97 2002/07/10 20:49:01 roberto Exp roberto $ +** $Id: lua.c,v 1.98 2002/08/06 15:32:22 roberto Exp roberto $ ** Lua stand-alone interpreter ** See Copyright Notice in lua.h */ @@ -13,7 +13,6 @@ #include "lua.h" #include "lauxlib.h" -#include "luadebug.h" #include "lualib.h" diff --git a/lua.h b/lua.h index 786ba8d6..955b052a 100644 --- a/lua.h +++ b/lua.h @@ -1,5 +1,5 @@ /* -** $Id: lua.h,v 1.150 2002/08/06 17:06:56 roberto Exp roberto $ +** $Id: lua.h,v 1.151 2002/08/06 17:26:45 roberto Exp roberto $ ** Lua - An Extensible Extension Language ** Tecgraf: Computer Graphics Technology Group, PUC-Rio, Brazil ** http://www.lua.org mailto:info@lua.org @@ -282,8 +282,6 @@ LUA_API int lua_pushupvalues (lua_State *L); #define lua_getref(L,ref) lua_rawgeti(L, LUA_REGISTRYINDEX, ref) -#endif - /* @@ -304,6 +302,56 @@ LUA_API int lua_pushupvalues (lua_State *L); /* }====================================================================== */ +/* +** {====================================================================== +** Debug API +** ======================================================================= +*/ + +typedef enum lua_Hookevent { + LUA_HOOKCALL, LUA_HOOKRET, LUA_HOOKLINE, LUA_HOOKCOUNT +} lua_Hookevent; + + +#define LUA_MASKCALL (2 << LUA_HOOKCALL) +#define LUA_MASKRET (2 << LUA_HOOKRET) +#define LUA_MASKLINE (2 << LUA_HOOKLINE) +#define LUA_MASKCOUNT(count) ((count) << (LUA_HOOKCOUNT+1)) +#define lua_getmaskcount(mask) ((mask) >> (LUA_HOOKCOUNT+1)) + +typedef struct lua_Debug lua_Debug; /* activation record */ + +typedef void (*lua_Hook) (lua_State *L, lua_Debug *ar); + + +LUA_API int lua_getstack (lua_State *L, int level, lua_Debug *ar); +LUA_API int lua_getinfo (lua_State *L, const char *what, lua_Debug *ar); +LUA_API const char *lua_getlocal (lua_State *L, const lua_Debug *ar, int n); +LUA_API const char *lua_setlocal (lua_State *L, const lua_Debug *ar, int n); + +LUA_API int lua_sethook (lua_State *L, lua_Hook func, int mask); +LUA_API lua_Hook lua_gethook (lua_State *L); +LUA_API int lua_gethookmask (lua_State *L); + + +#define LUA_IDSIZE 60 + +struct lua_Debug { + lua_Hookevent event; + const char *name; /* (n) */ + const char *namewhat; /* (n) `global', `local', `field', `method' */ + const char *what; /* (S) `Lua' function, `C' function, Lua `main' */ + const char *source; /* (S) */ + int currentline; /* (l) */ + int nups; /* (u) number of upvalues */ + int linedefined; /* (S) */ + char short_src[LUA_IDSIZE]; /* (S) */ + /* private part */ + int i_ci; /* active function */ +}; + +/* }====================================================================== */ + /****************************************************************************** * Copyright (C) 2002 Tecgraf, PUC-Rio. All rights reserved. @@ -328,3 +376,5 @@ LUA_API int lua_pushupvalues (lua_State *L); * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ******************************************************************************/ + +#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 @@ -/* -** $Id: luadebug.h,v 1.30 2002/07/08 20:22:08 roberto Exp $ -** Debugging API -** See Copyright Notice in lua.h -*/ - - -#ifndef luadebug_h -#define luadebug_h - - -#include "lua.h" - -typedef enum lua_Hookevent { - LUA_HOOKCALL, LUA_HOOKRET, LUA_HOOKLINE, LUA_HOOKCOUNT -} lua_Hookevent; - - -#define LUA_MASKCALL (2 << LUA_HOOKCALL) -#define LUA_MASKRET (2 << LUA_HOOKRET) -#define LUA_MASKLINE (2 << LUA_HOOKLINE) -#define LUA_MASKCOUNT(count) ((count) << (LUA_HOOKCOUNT+1)) -#define lua_getmaskcount(mask) ((mask) >> (LUA_HOOKCOUNT+1)) - -typedef struct lua_Debug lua_Debug; /* activation record */ - -typedef void (*lua_Hook) (lua_State *L, lua_Debug *ar); - - -LUA_API int lua_getstack (lua_State *L, int level, lua_Debug *ar); -LUA_API int lua_getinfo (lua_State *L, const char *what, lua_Debug *ar); -LUA_API const char *lua_getlocal (lua_State *L, const lua_Debug *ar, int n); -LUA_API const char *lua_setlocal (lua_State *L, const lua_Debug *ar, int n); - -LUA_API int lua_sethook (lua_State *L, lua_Hook func, int mask); -LUA_API lua_Hook lua_gethook (lua_State *L); -LUA_API int lua_gethookmask (lua_State *L); - - -#define LUA_IDSIZE 60 - -struct lua_Debug { - lua_Hookevent event; - const char *name; /* (n) */ - const char *namewhat; /* (n) `global', `local', `field', `method' */ - const char *what; /* (S) `Lua' function, `C' function, Lua `main' */ - const char *source; /* (S) */ - int currentline; /* (l) */ - int nups; /* (u) number of upvalues */ - int linedefined; /* (S) */ - char short_src[LUA_IDSIZE]; /* (S) */ - /* private part */ - int i_ci; /* active function */ -}; - - -#endif