197 @param line the received line |
192 @param line the received line |
198 =end |
193 =end |
199 |
194 |
200 # Remove any newline |
195 # Remove any newline |
201 if line[-1] == "\n" |
196 if line[-1] == "\n" |
202 line = line[1...-1] |
197 line = line[0...-1] |
203 end |
198 end |
204 |
199 |
205 ## STDOUT << line << "\n" ## debug |
200 ## STDOUT << line << "\n" ## debug |
206 |
201 |
207 eoc = line.index("<") |
202 eoc = line.index("<") |
208 |
203 |
209 if eoc and eoc >= 0 and line[0,1] == ">" |
204 if eoc and eoc >= 0 and line[0,1] == ">" |
210 # Get the command part and any argument |
205 # Get the command part and any argument |
211 cmd = line[0..eoc] |
206 cmd = line[0..eoc] |
212 arg = line[eoc+1...-1] |
207 arg = line[eoc+1..-1] |
213 |
208 |
214 case cmd |
209 case cmd |
215 when RequestOK |
210 when RequestOK |
216 write(@pendingResponse + "\n") |
211 write(@pendingResponse + "\n") |
217 @pendingResponse = ResponseOK |
212 @pendingResponse = ResponseOK |
302 else |
297 else |
303 Dir.chdir(wd) |
298 Dir.chdir(wd) |
304 end |
299 end |
305 @running = fn |
300 @running = fn |
306 command = "$0 = '%s'; require '%s'" % [fn, fn] |
301 command = "$0 = '%s'; require '%s'" % [fn, fn] |
|
302 RubyVM::InstructionSequence.compile_option = { |
|
303 trace_instruction: true |
|
304 } |
307 set_trace_func proc { |event, file, line, id, binding_, klass, *rest| |
305 set_trace_func proc { |event, file, line, id, binding_, klass, *rest| |
308 DEBUGGER__.context.trace_func(event, file, line, id, binding_, klass) |
306 DEBUGGER__.context.trace_func(event, file, line, id, binding_, klass) |
309 } |
307 } |
310 begin |
308 begin |
311 eval(command, @debugBinding) |
309 eval(command, @debugBinding) |