diff options
Diffstat (limited to 'luadebug.h')
-rw-r--r-- | luadebug.h | 49 |
1 files changed, 34 insertions, 15 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: luadebug.h,v 1.7 1999/08/16 20:52:00 roberto Exp roberto $ | 2 | ** $Id: luadebug.h,v 1.8 1999/11/22 13:12:07 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,44 @@ | |||
11 | 11 | ||
12 | #include "lua.h" | 12 | #include "lua.h" |
13 | 13 | ||
14 | typedef lua_Object lua_Function; | 14 | typedef struct lua_Dbgactreg lua_Dbgactreg; /* activation record */ |
15 | typedef struct lua_Dbglocvar lua_Dbglocvar; /* local variable */ | ||
15 | 16 | ||
16 | typedef void (*lua_LHFunction) (lua_State *L, int line); | 17 | typedef void (*lua_Dbghook) (lua_State *L, lua_Dbgactreg *ar); |
17 | typedef void (*lua_CHFunction) (lua_State *L, lua_Function func, const char *file, int line); | ||
18 | 18 | ||
19 | lua_Function lua_stackedfunction (lua_State *L, int level); | ||
20 | void lua_funcinfo (lua_State *L, lua_Object func, const char **source, int *linedefined); | ||
21 | int lua_currentline (lua_State *L, lua_Function func); | ||
22 | const char *lua_getobjname (lua_State *L, lua_Object o, const char **name); | ||
23 | 19 | ||
24 | lua_Object lua_getlocal (lua_State *L, lua_Function func, int local_number, | 20 | int lua_getstack (lua_State *L, int level, lua_Dbgactreg *ar); |
25 | const char **name); | 21 | int lua_getinfo (lua_State *L, const char *what, lua_Dbgactreg *ar); |
26 | int lua_setlocal (lua_State *L, lua_Function func, int local_number); | 22 | int lua_getlocal (lua_State *L, const lua_Dbgactreg *ar, lua_Dbglocvar *v); |
23 | int lua_setlocal (lua_State *L, const lua_Dbgactreg *ar, lua_Dbglocvar *v); | ||
27 | 24 | ||
28 | int lua_nups (lua_State *L, lua_Function func); | ||
29 | |||
30 | lua_LHFunction lua_setlinehook (lua_State *L, lua_LHFunction func); | ||
31 | lua_CHFunction lua_setcallhook (lua_State *L, lua_CHFunction func); | ||
32 | int lua_setdebug (lua_State *L, int debug); | 25 | int lua_setdebug (lua_State *L, int debug); |
33 | 26 | ||
27 | lua_Dbghook lua_setcallhook (lua_State *L, lua_Dbghook func); | ||
28 | lua_Dbghook lua_setlinehook (lua_State *L, lua_Dbghook func); | ||
29 | |||
30 | |||
31 | |||
32 | struct lua_Dbgactreg { | ||
33 | const char *event; /* `call', `return' */ | ||
34 | const char *source; /* (S) */ | ||
35 | int linedefined; /* (S) */ | ||
36 | const char *what; /* (S) `Lua' function, `C' function, Lua `main' */ | ||
37 | int currentline; /* (l) */ | ||
38 | const char *name; /* (n) */ | ||
39 | const char *namewhat; /* (n) global, tag method, local, field */ | ||
40 | int nups; /* (u) number of upvalues */ | ||
41 | lua_Object func; /* (f) function being executed */ | ||
42 | /* private part */ | ||
43 | lua_Object _func; /* active function */ | ||
44 | }; | ||
45 | |||
46 | |||
47 | struct lua_Dbglocvar { | ||
48 | int index; | ||
49 | const char *name; | ||
50 | lua_Object value; | ||
51 | }; | ||
52 | |||
34 | 53 | ||
35 | #endif | 54 | #endif |