bin/rdebug-ide in debugger-xml-0.1.9 vs bin/rdebug-ide in debugger-xml-0.2.0

- old
+ new

@@ -18,10 +18,15 @@ Debugger.tracing = options.tracing Debugger.wait_for_start = options.wait_for_start Debugger.wait_connection = true Debugger.printer = Printers::Xml.new Debugger.const_set("PROG_SCRIPT", ARGV.shift) + Debugger::Xml.logger = if options.debug_mode + Debugger::Xml::Ide::Logger.new + else + Debugger::Xml::FakeLogger.new + end end def run Debugger.start_remote_ide(options.host, options.port) bt = Debugger.debug_load(Debugger::PROG_SCRIPT, false, false) @@ -59,19 +64,23 @@ @options end def opts @opts ||= begin - @options = OpenStruct.new(host: "127.0.0.1", port: 12345, stop: false, tracing: false, wait_for_start: true, int_handler: true) + @options = OpenStruct.new( + host: "127.0.0.1", port: 12345, stop: false, tracing: false, wait_for_start: true, + int_handler: true, debug_mode: false + ) opts = OptionParser.new do |opts| opts.banner = %{ Using rdebug-ide Usage: rdebug-ide is supposed to be called from RDT, NetBeans, RubyMine or vim-ruby-debugger. The command line interface to 'debugger' is rdebug. }.gsub(/^\s*/, '') opts.separator "" opts.separator "Options:" opts.on("-h", "--host HOST", "Host name used for remote debugging") { |host| @options.host = host } + opts.on("-d", "--debug", "Enable debug mode") { |host| @options.debug_mode = true } opts.on("--cport PORT", Integer, "Port used for control commands") { |cport| @options.cport = cport } opts.on("-p", "--port PORT", Integer, "Port used for remote debugging") { |port| @options.port = port } opts.on("--wait", String, "Wait for 'start' command") do |bool| @options.wait_for_start = (bool == "false" ? false : true) end