lib/ruby-debug.rb in ruby-debug-ide-0.1.10 vs lib/ruby-debug.rb in ruby-debug-ide-0.2.0
- old
+ new
@@ -44,10 +44,14 @@
end
def at_line(file, line)
event_processor.at_line(self, file, line)
end
+
+ def at_return(file, line)
+ event_processor.at_return(self, file, line)
+ end
end
class << self
attr_accessor :event_processor, :is_debug
attr_reader :control_thread
@@ -77,17 +81,19 @@
start
start_control(host, port)
+ raise "Control thread did not start (#{@control_thread}}" unless @control_thread && @control_thread.alive?
+
@mutex = Mutex.new
@proceed = ConditionVariable.new
- # wait for start command
+ # wait for 'start' command
@mutex.synchronize do
@proceed.wait(@mutex)
- end
+ end
debug_load Debugger::PROG_SCRIPT
end
def run_prog_script
@@ -98,10 +104,12 @@
def start_control(host, port)
raise "Debugger is not started" unless started?
return if @control_thread
@control_thread = DebugThread.new do
+ host ||= 'localhost' # nil does not seem to work for IPv6, localhost does
Debugger.print_debug("Waiting for connection on '#{host}:#{port}'")
+ $stderr.puts "Fast Debugger (ruby-debug-ide 0.2.0) listens on #{host}:#{port}"
server = TCPServer.new(host, port)
while (session = server.accept)
begin
interface = RemoteInterface.new(session)
@event_processor = EventProcessor.new(interface)