Sha256: 389df6615eb0e10c874aec7c2c58b38f62761c10694b41fd47ae694187d5ff9c

Contents?: true

Size: 1.86 KB

Versions: 27

Compression:

Stored size: 1.86 KB

Contents

module Debugger
  module MultiProcess
    class << self
      def pre_child(options = nil)
        require 'socket'
        require 'ostruct'

        host = ENV['DEBUGGER_HOST']

        options ||= OpenStruct.new(
            'frame_bind'  => false,
            'host'        => host,
            'load_mode'   => false,
            'port'        => Debugger.find_free_port(host),
            'stop'        => false,
            'tracing'     => false,
            'int_handler' => true,
            'cli_debug'   => (ENV['DEBUGGER_CLI_DEBUG'] == 'true'),
            'notify_dispatcher' => true,
            'evaluation_timeout' => 10,
            'trace_to_s' => false,
            'debugger_memory_limit' => 10,
            'inspect_time_limit' => 100
        )

        if(options.ignore_port)
          options.port = Debugger.find_free_port(options.host)
          options.notify_dispatcher = true
        end
      
        start_debugger(options)
      end

      def start_debugger(options)
        if Debugger.started?
          # we're in forked child, only need to restart control thread
          Debugger.breakpoints.clear
          Debugger.control_thread = nil
          Debugger.start_control(options.host, options.port, options.notify_dispatcher)
        end

        if options.int_handler
          # install interruption handler
          trap('INT') { Debugger.interrupt_last }
        end

        # set options
        Debugger.keep_frame_binding = options.frame_bind
        Debugger.tracing = options.tracing
        Debugger.evaluation_timeout = options.evaluation_timeout
        Debugger.trace_to_s = options.trace_to_s
        Debugger.debugger_memory_limit = options.debugger_memory_limit
        Debugger.inspect_time_limit = options.inspect_time_limit
        Debugger.cli_debug = options.cli_debug
        Debugger.prepare_debugger(options)
      end
    end
  end
end

Version data entries

27 entries across 19 versions & 4 rubygems

Version Path
avalara_sdk-24.2.29 vendor/bundle/ruby/2.7.0/gems/ruby-debug-ide-0.7.3/lib/ruby-debug-ide/multiprocess/pre_child.rb
ruby-debug-ide22-0.7.5 lib/ruby-debug-ide/multiprocess/pre_child.rb
tdiary-5.2.0 vendor/bundle/ruby/3.0.0/gems/ruby-debug-ide-0.7.3/lib/ruby-debug-ide/multiprocess/pre_child.rb
tdiary-5.2.0 vendor/bundle/ruby/2.7.0/gems/ruby-debug-ide-0.7.2/lib/ruby-debug-ide/multiprocess/pre_child.rb
ruby-debug-ide-0.7.3 lib/ruby-debug-ide/multiprocess/pre_child.rb
tdiary-5.1.7 vendor/bundle/ruby/3.0.0/gems/ruby-debug-ide-0.7.2/lib/ruby-debug-ide/multiprocess/pre_child.rb
tdiary-5.1.7 vendor/bundle/ruby/2.7.0/gems/ruby-debug-ide-0.7.2/lib/ruby-debug-ide/multiprocess/pre_child.rb
tdiary-5.1.6 vendor/bundle/ruby/2.7.0/gems/tdiary-5.1.5/vendor/bundle/ruby/2.7.0/gems/ruby-debug-ide-0.7.2/lib/ruby-debug-ide/multiprocess/pre_child.rb
tdiary-5.1.6 vendor/bundle/ruby/3.0.0/gems/ruby-debug-ide-0.7.2/lib/ruby-debug-ide/multiprocess/pre_child.rb
tdiary-5.1.6 vendor/bundle/ruby/2.7.0/gems/tdiary-5.1.5/vendor/bundle/ruby/3.0.0/gems/tdiary-5.1.4/vendor/bundle/ruby/2.7.0/gems/ruby-debug-ide-0.7.2/lib/ruby-debug-ide/multiprocess/pre_child.rb
tdiary-5.1.6 vendor/bundle/ruby/2.7.0/gems/tdiary-5.1.5/vendor/bundle/ruby/3.0.0/gems/ruby-debug-ide-0.7.2/lib/ruby-debug-ide/multiprocess/pre_child.rb
tdiary-5.1.6 vendor/bundle/ruby/2.7.0/gems/ruby-debug-ide-0.7.2/lib/ruby-debug-ide/multiprocess/pre_child.rb
tdiary-5.1.5 vendor/bundle/ruby/2.7.0/gems/ruby-debug-ide-0.7.2/lib/ruby-debug-ide/multiprocess/pre_child.rb
tdiary-5.1.5 vendor/bundle/ruby/3.0.0/gems/ruby-debug-ide-0.7.2/lib/ruby-debug-ide/multiprocess/pre_child.rb
tdiary-5.1.5 vendor/bundle/ruby/3.0.0/gems/tdiary-5.1.4/vendor/bundle/ruby/2.7.0/gems/ruby-debug-ide-0.7.2/lib/ruby-debug-ide/multiprocess/pre_child.rb
tdiary-5.1.4 vendor/bundle/ruby/2.7.0/gems/ruby-debug-ide-0.7.2/lib/ruby-debug-ide/multiprocess/pre_child.rb
tdiary-5.1.3 vendor/bundle/ruby/2.7.0/gems/ruby-debug-ide-0.7.2/lib/ruby-debug-ide/multiprocess/pre_child.rb
ruby-debug-ide-0.7.2 lib/ruby-debug-ide/multiprocess/pre_child.rb
ruby-debug-ide-0.7.1.beta3 lib/ruby-debug-ide/multiprocess/pre_child.rb
ruby-debug-ide-0.7.1.beta2 lib/ruby-debug-ide/multiprocess/pre_child.rb