diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2000-06-26 16:28:31 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2000-06-26 16:28:31 -0300 |
commit | afef009fcea199bd4eff28ea6e5206b59cda9939 (patch) | |
tree | 3954490fd4149900be8e795f630104637cd02f4b /lobject.h | |
parent | b69e712713785394ceefa11ab3e5f9636abea733 (diff) | |
download | lua-afef009fcea199bd4eff28ea6e5206b59cda9939.tar.gz lua-afef009fcea199bd4eff28ea6e5206b59cda9939.tar.bz2 lua-afef009fcea199bd4eff28ea6e5206b59cda9939.zip |
new version of debug system
Diffstat (limited to 'lobject.h')
-rw-r--r-- | lobject.h | 24 |
1 files changed, 18 insertions, 6 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lobject.h,v 1.66 2000/05/30 19:00:31 roberto Exp roberto $ | 2 | ** $Id: lobject.h,v 1.67 2000/06/08 18:27:13 roberto Exp roberto $ |
3 | ** Type definitions for Lua objects | 3 | ** Type definitions for Lua objects |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -46,9 +46,8 @@ typedef enum { | |||
46 | TAG_NIL, /* last "pre-defined" tag */ | 46 | TAG_NIL, /* last "pre-defined" tag */ |
47 | 47 | ||
48 | TAG_LMARK, /* mark for Lua closures */ | 48 | TAG_LMARK, /* mark for Lua closures */ |
49 | TAG_CMARK, /* mark for C closures */ | 49 | TAG_CMARK /* mark for C closures */ |
50 | 50 | ||
51 | TAG_LINE | ||
52 | } lua_Type; | 51 | } lua_Type; |
53 | 52 | ||
54 | /* tags for values visible from Lua == first user-created tag */ | 53 | /* tags for values visible from Lua == first user-created tag */ |
@@ -63,10 +62,10 @@ typedef enum { | |||
63 | 62 | ||
64 | typedef union { | 63 | typedef union { |
65 | struct TString *ts; /* TAG_STRING, TAG_USERDATA */ | 64 | struct TString *ts; /* TAG_STRING, TAG_USERDATA */ |
66 | struct Closure *cl; /* TAG_[CL]CLOSURE, TAG_[CL]MARK */ | 65 | struct Closure *cl; /* TAG_[CL]CLOSURE, TAG_CMARK */ |
67 | struct Hash *a; /* TAG_TABLE */ | 66 | struct Hash *a; /* TAG_TABLE */ |
67 | struct CallInfo *i; /* TAG_LMARK */ | ||
68 | Number n; /* TAG_NUMBER */ | 68 | Number n; /* TAG_NUMBER */ |
69 | int i; /* TAG_LINE */ | ||
70 | } Value; | 69 | } Value; |
71 | 70 | ||
72 | 71 | ||
@@ -76,6 +75,7 @@ typedef union { | |||
76 | #define tsvalue(o) ((o)->value.ts) | 75 | #define tsvalue(o) ((o)->value.ts) |
77 | #define clvalue(o) ((o)->value.cl) | 76 | #define clvalue(o) ((o)->value.cl) |
78 | #define hvalue(o) ((o)->value.a) | 77 | #define hvalue(o) ((o)->value.a) |
78 | #define infovalue(o) ((o)->value.i) | ||
79 | #define svalue(o) (tsvalue(o)->str) | 79 | #define svalue(o) (tsvalue(o)->str) |
80 | 80 | ||
81 | 81 | ||
@@ -119,8 +119,10 @@ typedef struct Proto { | |||
119 | struct Proto **kproto; /* functions defined inside the function */ | 119 | struct Proto **kproto; /* functions defined inside the function */ |
120 | int nkproto; /* size of `kproto' */ | 120 | int nkproto; /* size of `kproto' */ |
121 | Instruction *code; /* ends with opcode ENDCODE */ | 121 | Instruction *code; /* ends with opcode ENDCODE */ |
122 | int *lines; /* source line that generated each opcode */ | ||
122 | int lineDefined; | 123 | int lineDefined; |
123 | TString *source; | 124 | TString *source; |
125 | int debug; /* flag for debug information */ | ||
124 | int numparams; | 126 | int numparams; |
125 | int is_vararg; | 127 | int is_vararg; |
126 | int maxstacksize; | 128 | int maxstacksize; |
@@ -130,7 +132,7 @@ typedef struct Proto { | |||
130 | 132 | ||
131 | typedef struct LocVar { | 133 | typedef struct LocVar { |
132 | TString *varname; /* NULL signals end of scope */ | 134 | TString *varname; /* NULL signals end of scope */ |
133 | int line; | 135 | int pc; |
134 | } LocVar; | 136 | } LocVar; |
135 | 137 | ||
136 | 138 | ||
@@ -165,6 +167,16 @@ typedef struct Hash { | |||
165 | } Hash; | 167 | } Hash; |
166 | 168 | ||
167 | 169 | ||
170 | /* | ||
171 | ** informations about a call (for debugging) | ||
172 | */ | ||
173 | typedef struct CallInfo { | ||
174 | int pc; /* current pc of called function */ | ||
175 | int line; /* current line */ | ||
176 | struct Closure *func; /* function being called */ | ||
177 | } CallInfo; | ||
178 | |||
179 | |||
168 | extern const char *const luaO_typenames[]; | 180 | extern const char *const luaO_typenames[]; |
169 | extern const TObject luaO_nilobject; | 181 | extern const TObject luaO_nilobject; |
170 | 182 | ||