lib/ruby-debug.rb in ruby-debug-ide-0.4.0 vs lib/ruby-debug.rb in ruby-debug-ide-0.4.1
- old
+ new
@@ -38,11 +38,15 @@
def at_catchpoint(excpt)
event_processor.at_catchpoint(self, excpt)
end
def at_tracing(file, line)
- event_processor.at_tracing(self, file, line)
+ if event_processor
+ event_processor.at_tracing(self, file, line)
+ else
+ Debugger::print_debug "trace: location=\"%s:%s\", threadId=%d", file, line, self.thnum
+ end
end
def at_line(file, line)
event_processor.at_line(self, file, line)
end
@@ -75,16 +79,16 @@
end
context
end
end
- def main(host, port, load_mode)
+ def debug_program(options)
return if started?
start
- start_control(host, port)
+ start_control(options.host, options.port)
raise "Control thread did not start (#{@control_thread}}" unless @control_thread && @control_thread.alive?
@mutex = Mutex.new
@proceed = ConditionVariable.new
@@ -92,11 +96,11 @@
# wait for 'start' command
@mutex.synchronize do
@proceed.wait(@mutex)
end
- debug_load(Debugger::PROG_SCRIPT, false, load_mode)
+ debug_load(Debugger::PROG_SCRIPT, options.stop, options.load_mode)
end
def run_prog_script
@mutex.synchronize do
@proceed.signal
@@ -109,10 +113,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.0) listens on #{host}:#{port}\n"
+ $stderr.printf "Fast Debugger (ruby-debug-ide 0.4.1) listens on #{host}:#{port}\n"
server = TCPServer.new(host, port)
while (session = server.accept)
begin
interface = RemoteInterface.new(session)
@event_processor = EventProcessor.new(interface)