Sha256: 400ed2c87ff0993840495d9a970580a6f35b3ef18485c6dbefa98333142d5341

Contents?: true

Size: 856 Bytes

Versions: 18

Compression:

Stored size: 856 Bytes

Contents

#!/usr/bin/env ruby

require_relative '../lib/debug/config'
config = DEBUGGER__::Config::parse_argv(ARGV)

case config[:mode]
when :start
  require 'rbconfig'

  libpath = File.join(File.expand_path(File.dirname(__dir__)), 'lib/debug')
  start_mode = config[:remote] ? "open" : 'start'
  cmd = config[:command] ? ARGV.shift : (ENV['RUBY'] || RbConfig.ruby)

  env = ::DEBUGGER__::Config.config_to_env_hash(config)
  env['RUBYOPT'] = "-r #{libpath}/#{start_mode}"

  exec(env, cmd, *ARGV)

when :attach
  require_relative "../lib/debug/client"
  ::DEBUGGER__::CONFIG.update config

  begin
    if ARGV.empty? && config[:port]
      DEBUGGER__::Client.new([config[:host], config[:port]].compact).connect
    else
      DEBUGGER__::Client.new(ARGV).connect
    end
  rescue DEBUGGER__::CommandLineOptionError
    puts opt.help
  end
else
  raise # assert
end

Version data entries

18 entries across 18 versions & 3 rubygems

Version Path
scrapbook-0.3.2 vendor/ruby/2.7.0/gems/debug-1.4.0/exe/rdbg
scrapbook-0.3.1 vendor/ruby/2.7.0/gems/debug-1.4.0/exe/rdbg
tdiary-5.2.2 vendor/bundle/ruby/3.1.0/gems/debug-1.5.0/exe/rdbg
debug-1.5.0 exe/rdbg
tdiary-5.2.1 vendor/bundle/ruby/3.1.0/gems/debug-1.4.0/exe/rdbg
debug-1.4.0 exe/rdbg
debug-1.3.4 exe/rdbg
debug-1.3.3 exe/rdbg
debug-1.3.2 exe/rdbg
debug-1.3.1 exe/rdbg
debug-1.3.0 exe/rdbg
debug-1.2.4 exe/rdbg
debug-1.2.3 exe/rdbg
debug-1.2.2 exe/rdbg
debug-1.2.1 exe/rdbg
debug-1.2.0 exe/rdbg
debug-1.1.0 exe/rdbg
debug-1.0.0 exe/rdbg