Sha256: 2e8471a2483604926ab076700e54dc01fc0c238b3ea22a8efcb0bfb91470b1b2

Contents?: true

Size: 1.87 KB

Versions: 7

Compression:

Stored size: 1.87 KB

Contents

#!/usr/bin/env ruby

require 'rubygems'
require 'optparse'
require "ostruct"
require 'ruby-debug'

$stdout.sync=true

options = OpenStruct.new(
  'host'        => nil,
  'port'        => 1234,
  'tracing'     => false,
  'frame_bind'  => false
)

opts = OptionParser.new do |opts|
  opts.banner = <<EOB
Using ruby-debug-base #{Debugger::VERSION}
Usage: rdebug-javaide is supposed to be called from RDT or NetBeans. The command line interface to ruby-debug is rdebug.
EOB
  opts.separator ""
  opts.separator "Options:"
  opts.on("-h", "--host HOST", "Host name used for remote debugging") {|options.host|}
  opts.on("-p", "--port PORT", Integer, "Port used for remote debugging") {|options.port|}
  opts.on("-x", "--trace", "turn on line tracing") {options.tracing = true}
  opts.on("-d", "--debug", "Debug self - prints information for debugging ruby-debug itself") do
    Debugger.is_debug = true
  end
  opts.on("-I", "--include PATH", String, "Add PATH to $LOAD_PATH") do |path|
    $LOAD_PATH.unshift(path)
  end
  
  opts.on("--keep-frame-binding", "Keep frame bindings") {options.frame_bind = true}
  opts.separator ""
  opts.separator "Common options:"
  opts.on_tail("-v", "--version", "Show version") do
    puts "Using ruby-debug-base #{Debugger::VERSION}"
    exit
  end
end

begin
  Debugger::ARGV = ARGV.clone
  rdebug_path = File.expand_path($0)
  if RUBY_PLATFORM =~ /mswin/
    rdebug_path += ".cmd" unless rdebug_path =~ /\.cmd$/i
  end
  Debugger::RDEBUG_SCRIPT = rdebug_path
  opts.parse! ARGV
rescue StandardError => e
  puts opts
  puts
  puts e.message
  exit(1)
end

if ARGV.empty?
  puts opts
  puts
  puts "Must specify a script to run"
  exit(1)
end    

# save script name
Debugger::PROG_SCRIPT = ARGV.shift
  
# install interruption handler
trap('INT') { Debugger.interrupt_last }
  
# set options
Debugger.keep_frame_binding = options.frame_bind

Debugger.main(options.host, options.port)

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
ruby-debug-ide-0.1.2 bin/rdebug-ide
ruby-debug-ide-0.1.3 bin/rdebug-ide
ruby-debug-ide-0.1.4 bin/rdebug-ide
ruby-debug-ide-0.1.5 bin/rdebug-ide
ruby-debug-ide-0.1.6 bin/rdebug-ide
ruby-debug-ide-0.1.8 bin/rdebug-ide
ruby-debug-ide-0.1.7 bin/rdebug-ide