@@ -46,87 +46,91 @@ enum {
4646
4747void performAction (int command , char * * args , JSCDebug ::JSCDebugger * debugger , int socket );
4848int parseInput (int file , JSCDebug ::JSCDebugger * debugger );
49+ static bool shouldExit = false;
4950
5051
51- #line 78 "simple_debug.rl"
52+ #line 80 "simple_debug.rl"
5253
5354
5455
55- #line 56 "simple_debug.c"
56+ #line 57 "simple_debug.c"
5657static const char _simple_debug_actions [] = {
5758 0 , 1 , 0 , 1 , 2 , 1 , 3 , 1 ,
58- 4 , 1 , 5 , 2 , 1 , 6
59+ 4 , 1 , 5 , 1 , 7 , 2 , 1 , 6
60+
5961};
6062
6163static const char _simple_debug_key_offsets [] = {
62- 0 , 0 , 2 , 3 , 4 , 5 , 6 , 7 ,
63- 8 , 9 , 11 , 12 , 13 , 14 , 15 , 16 ,
64- 17 , 19 , 20 , 21
64+ 0 , 0 , 2 , 4 , 5 , 6 , 8 , 9 ,
65+ 10 , 11 , 12 , 14 , 15 , 16 , 17 , 18 ,
66+ 19 , 20 , 22 , 23 , 24
6567};
6668
6769static const char _simple_debug_trans_keys [] = {
68- 10 , 111 , 110 , 116 , 105 , 110 , 117 , 101 ,
69- 10 , 32 , 118 , 10 , 10 , 97 , 108 , 32 ,
70- 10 , 10 , 116 , 101 , 112 , 99 , 101 , 110 ,
71- 115 , 0
70+ 10 , 32 , 10 , 111 , 110 , 116 , 10 , 105 ,
71+ 110 , 117 , 101 , 10 , 32 , 118 , 10 , 10 ,
72+ 97 , 108 , 32 , 10 , 10 , 116 , 101 , 112 ,
73+ 10 , 32 , 99 , 101 , 110 , 115 , 0
7274};
7375
7476static const char _simple_debug_single_lengths [] = {
75- 0 , 2 , 1 , 1 , 1 , 1 , 1 , 1 ,
76- 1 , 2 , 1 , 1 , 1 , 1 , 1 , 1 ,
77- 2 , 1 , 1 , 4
77+ 0 , 2 , 2 , 1 , 1 , 2 , 1 , 1 ,
78+ 1 , 1 , 2 , 1 , 1 , 1 , 1 , 1 ,
79+ 1 , 2 , 1 , 1 , 6
7880};
7981
8082static const char _simple_debug_range_lengths [] = {
8183 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ,
8284 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ,
83- 0 , 0 , 0 , 0
85+ 0 , 0 , 0 , 0 , 0
8486};
8587
8688static const char _simple_debug_index_offsets [] = {
87- 0 , 0 , 3 , 5 , 7 , 9 , 11 , 13 ,
88- 15 , 17 , 20 , 22 , 24 , 26 , 28 , 30 ,
89- 32 , 35 , 37 , 39
89+ 0 , 0 , 3 , 6 , 8 , 10 , 13 , 15 ,
90+ 17 , 19 , 21 , 24 , 26 , 28 , 30 , 32 ,
91+ 34 , 36 , 39 , 41 , 43
9092};
9193
9294static const char _simple_debug_trans_targs [] = {
93- 19 , 2 , 0 , 3 , 0 , 4 , 0 , 5 ,
94- 0 , 6 , 0 , 7 , 0 , 8 , 0 , 19 ,
95- 0 , 10 , 12 , 0 , 0 , 11 , 19 , 11 ,
96- 13 , 0 , 14 , 0 , 10 , 0 , 19 , 0 ,
97- 19 , 17 , 0 , 18 , 0 , 15 , 0 , 1 ,
98- 9 , 15 , 16 , 0 , 0
95+ 20 , 1 , 0 , 20 , 3 , 0 , 4 , 0 ,
96+ 5 , 0 , 20 , 6 , 0 , 7 , 0 , 8 ,
97+ 0 , 9 , 0 , 20 , 0 , 11 , 13 , 0 ,
98+ 0 , 12 , 20 , 12 , 14 , 0 , 15 , 0 ,
99+ 11 , 0 , 20 , 0 , 20 , 18 , 0 , 19 ,
100+ 0 , 16 , 0 , 20 , 1 , 2 , 10 , 16 ,
101+ 17 , 0 , 0
99102};
100103
101104static const char _simple_debug_trans_actions [] = {
102- 9 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ,
103- 0 , 0 , 0 , 0 , 0 , 0 , 0 , 9 ,
104- 0 , 0 , 0 , 0 , 0 , 1 , 11 , 0 ,
105- 0 , 0 , 0 , 0 , 0 , 0 , 7 , 0 ,
106- 7 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ,
107- 0 , 0 , 0 , 0 , 0
105+ 11 , 0 , 0 , 9 , 0 , 0 , 0 , 0 ,
106+ 0 , 0 , 9 , 0 , 0 , 0 , 0 , 0 ,
107+ 0 , 0 , 0 , 9 , 0 , 0 , 0 , 0 ,
108+ 0 , 1 , 13 , 0 , 0 , 0 , 0 , 0 ,
109+ 0 , 0 , 7 , 0 , 7 , 0 , 0 , 0 ,
110+ 0 , 0 , 0 , 11 , 0 , 0 , 0 , 0 ,
111+ 0 , 0 , 0
108112};
109113
110114static const char _simple_debug_to_state_actions [] = {
111115 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ,
112116 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ,
113- 0 , 0 , 0 , 3
117+ 0 , 0 , 0 , 0 , 3
114118};
115119
116120static const char _simple_debug_from_state_actions [] = {
117121 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ,
118122 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ,
119- 0 , 0 , 0 , 5
123+ 0 , 0 , 0 , 0 , 5
120124};
121125
122- static const int simple_debug_start = 19 ;
123- static const int simple_debug_first_final = 19 ;
126+ static const int simple_debug_start = 20 ;
127+ static const int simple_debug_first_final = 20 ;
124128static const int simple_debug_error = 0 ;
125129
126- static const int simple_debug_en_main = 19 ;
130+ static const int simple_debug_en_main = 20 ;
127131
128132
129- #line 81 "simple_debug.rl"
133+ #line 83 "simple_debug.rl"
130134
131135void performAction (int command , char * * args , JSCDebug ::JSCDebugger * debugger , int socket )
132136{
@@ -141,12 +145,14 @@ void performAction(int command, char **args, JSCDebug::JSCDebugger *debugger, in
141145 break ;
142146 case kContinueCommand :
143147 debugger -> continueProgram ();
148+ shouldExit = true;
144149 break ;
145150 case kEvalCommand :
146151 printf ("eval: '%s'\n" , * args );
147152 unsigned outLen ;
148153 const unsigned char * result = debugger -> evaluateInCurrentFrame ((unsigned char * )* args , & outLen );
149154 write (socket , result , outLen );
155+ write (socket , "\n>> " , 4 );
150156 free (* args ); * args = NULL ;
151157 break ;
152158 }
@@ -164,22 +170,22 @@ int parseInput(int file, JSCDebug::JSCDebugger *debugger)
164170 char * args = NULL , * argsBegin = NULL ;
165171
166172
167- #line 168 "simple_debug.c"
173+ #line 174 "simple_debug.c"
168174 {
169175 cs = simple_debug_start ;
170176 ts = 0 ;
171177 te = 0 ;
172178 act = 0 ;
173179 }
174180
175- #line 118 "simple_debug.rl"
181+ #line 122 "simple_debug.rl"
176182 ssize_t readBytes ;
177- while ((readBytes = read (file , buff , BUF_SIZE ))) {
183+ while (! shouldExit && (readBytes = read (file , buff , BUF_SIZE ))) {
178184 char * p = buff , * eof = buff + readBytes ;
179185 char * pe = eof ;
180186
181187
182- #line 183 "simple_debug.c"
188+ #line 189 "simple_debug.c"
183189 {
184190 int _klen ;
185191 unsigned int _trans ;
@@ -200,7 +206,7 @@ int parseInput(int file, JSCDebug::JSCDebugger *debugger)
200206#line 1 "NONE"
201207 {ts = p ;}
202208 break ;
203- #line 204 "simple_debug.c"
209+ #line 210 "simple_debug.c"
204210 }
205211 }
206212
@@ -265,13 +271,13 @@ int parseInput(int file, JSCDebug::JSCDebugger *debugger)
265271 switch ( * _acts ++ )
266272 {
267273 case 0 :
268- #line 61 "simple_debug.rl"
274+ #line 62 "simple_debug.rl"
269275 {
270276 argsBegin = p ;
271277 }
272278 break ;
273279 case 1 :
274- #line 64 "simple_debug.rl"
280+ #line 65 "simple_debug.rl"
275281 {
276282 if (args ) {
277283 free (args );
@@ -282,18 +288,22 @@ int parseInput(int file, JSCDebug::JSCDebugger *debugger)
282288 }
283289 break ;
284290 case 4 :
285- #line 74 "simple_debug.rl"
291+ #line 75 "simple_debug.rl"
286292 {te = p + 1 ;{ performAction (kNextCommand , NULL , debugger , file ); }}
287293 break ;
288294 case 5 :
289- #line 75 "simple_debug.rl"
290- {te = p + 1 ;{ performAction (kContinueCommand , NULL , debugger , file ); }}
295+ #line 76 "simple_debug.rl"
296+ {te = p + 1 ;{ performAction (kContinueCommand , NULL , debugger , file ); { p ++ ; goto _out ; } }}
291297 break ;
292298 case 6 :
293- #line 76 "simple_debug.rl"
299+ #line 77 "simple_debug.rl"
294300 {te = p + 1 ;{ performAction (kEvalCommand , & args , debugger , file ); }}
295301 break ;
296- #line 297 "simple_debug.c"
302+ case 7 :
303+ #line 78 "simple_debug.rl"
304+ {te = p + 1 ;}
305+ break ;
306+ #line 307 "simple_debug.c"
297307 }
298308 }
299309
@@ -306,7 +316,7 @@ int parseInput(int file, JSCDebug::JSCDebugger *debugger)
306316#line 1 "NONE"
307317 {ts = 0 ;}
308318 break ;
309- #line 310 "simple_debug.c"
319+ #line 320 "simple_debug.c"
310320 }
311321 }
312322
@@ -318,10 +328,10 @@ int parseInput(int file, JSCDebug::JSCDebugger *debugger)
318328 _out : {}
319329 }
320330
321- #line 124 "simple_debug.rl"
331+ #line 128 "simple_debug.rl"
322332
323333 if (cs == simple_debug_error ) {
324- printf ("parser error @ '%s'" , p );
334+ printf ("parser error @ '%s'\n " , p );
325335 return -1 ;
326336 }
327337 }
0 commit comments