aboutsummaryrefslogtreecommitdiff
path: root/luadebug.h
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2000-01-19 10:00:45 -0200
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2000-01-19 10:00:45 -0200
commit2877bad4c260d11c22c3b12e633d6b1ca3415789 (patch)
tree2109684c4521c34b584bfd24e0eae05688c7fc32 /luadebug.h
parent27163f032eed6b851b98a0ab67b1387d701e61c0 (diff)
downloadlua-2877bad4c260d11c22c3b12e633d6b1ca3415789.tar.gz
lua-2877bad4c260d11c22c3b12e633d6b1ca3415789.tar.bz2
lua-2877bad4c260d11c22c3b12e633d6b1ca3415789.zip
new debug API (first version)
Diffstat (limited to 'luadebug.h')
-rw-r--r--luadebug.h49
1 files changed, 34 insertions, 15 deletions
diff --git a/luadebug.h b/luadebug.h
index 29c5a39c..9c3820a0 100644
--- a/luadebug.h
+++ b/luadebug.h
@@ -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
14typedef lua_Object lua_Function; 14typedef struct lua_Dbgactreg lua_Dbgactreg; /* activation record */
15typedef struct lua_Dbglocvar lua_Dbglocvar; /* local variable */
15 16
16typedef void (*lua_LHFunction) (lua_State *L, int line); 17typedef void (*lua_Dbghook) (lua_State *L, lua_Dbgactreg *ar);
17typedef void (*lua_CHFunction) (lua_State *L, lua_Function func, const char *file, int line);
18 18
19lua_Function lua_stackedfunction (lua_State *L, int level);
20void lua_funcinfo (lua_State *L, lua_Object func, const char **source, int *linedefined);
21int lua_currentline (lua_State *L, lua_Function func);
22const char *lua_getobjname (lua_State *L, lua_Object o, const char **name);
23 19
24lua_Object lua_getlocal (lua_State *L, lua_Function func, int local_number, 20int lua_getstack (lua_State *L, int level, lua_Dbgactreg *ar);
25 const char **name); 21int lua_getinfo (lua_State *L, const char *what, lua_Dbgactreg *ar);
26int lua_setlocal (lua_State *L, lua_Function func, int local_number); 22int lua_getlocal (lua_State *L, const lua_Dbgactreg *ar, lua_Dbglocvar *v);
23int lua_setlocal (lua_State *L, const lua_Dbgactreg *ar, lua_Dbglocvar *v);
27 24
28int lua_nups (lua_State *L, lua_Function func);
29
30lua_LHFunction lua_setlinehook (lua_State *L, lua_LHFunction func);
31lua_CHFunction lua_setcallhook (lua_State *L, lua_CHFunction func);
32int lua_setdebug (lua_State *L, int debug); 25int lua_setdebug (lua_State *L, int debug);
33 26
27lua_Dbghook lua_setcallhook (lua_State *L, lua_Dbghook func);
28lua_Dbghook lua_setlinehook (lua_State *L, lua_Dbghook func);
29
30
31
32struct 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
47struct lua_Dbglocvar {
48 int index;
49 const char *name;
50 lua_Object value;
51};
52
34 53
35#endif 54#endif