lib/ruby-debug.rb in ruby-debug-ide-0.4.5 vs lib/ruby-debug.rb in ruby-debug-ide-0.4.6
- old
+ new
@@ -78,18 +78,20 @@
context.interrupt
end
context
end
end
-
- def debug_program(options)
+
+ def start_server(host = nil, port = 1234)
return if started?
-
start
-
- start_control(options.host, options.port)
-
+ start_control(host, port)
+ end
+
+ def debug_program(options)
+ start_server(options.host, options.port)
+
raise "Control thread did not start (#{@control_thread}}" unless @control_thread && @control_thread.alive?
@mutex = Mutex.new
@proceed = ConditionVariable.new
@@ -104,10 +106,11 @@
$stderr.print "Uncaught exception: #{bt}\n"
end
end
def run_prog_script
+ return unless @mutex
@mutex.synchronize do
@proceed.signal
end
end
@@ -117,10 +120,10 @@
@control_thread = DebugThread.new do
begin
unless RUBY_PLATFORM =~ /darwin/i # Mac OS X seems to have problem with 'localhost'
host ||= 'localhost' # nil does not seem to work for IPv6, localhost does
end
- $stderr.printf "Fast Debugger (ruby-debug-ide 0.4.5) listens on #{host}:#{port}\n"
+ $stderr.printf "Fast Debugger (ruby-debug-ide 0.4.6) listens on #{host}:#{port}\n"
server = TCPServer.new(host, port)
while (session = server.accept)
begin
interface = RemoteInterface.new(session)
@event_processor = EventProcessor.new(interface)