Skip to content

Commit

Permalink
option to disable 'to_s' tracing added
Browse files Browse the repository at this point in the history
  • Loading branch information
ViugiNick committed Aug 31, 2017
1 parent 90bbdb6 commit 02148f5
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 23 deletions.
49 changes: 27 additions & 22 deletions bin/rdebug-ide
Expand Up @@ -11,20 +11,20 @@ end
$stdout.sync=true

options = OpenStruct.new(
'frame_bind' => false,
'host' => nil,
'load_mode' => false,
'port' => 1234,
'stop' => false,
'tracing' => false,
'int_handler' => true,
'dispatcher_port' => -1,
'evaluation_timeout' => 10,
'rm_protocol_extensions' => false,
'catchpoint_deleted_event' => false,
'value_as_nested_element' => false,
'attach_mode' => false,
'cli_debug' => false
'frame_bind' => false,
'host' => nil,
'load_mode' => false,
'port' => 1234,
'stop' => false,
'tracing' => false,
'int_handler' => true,
'dispatcher_port' => -1,
'evaluation_timeout' => 10,
'rm_protocol_extensions' => false,
'catchpoint_deleted_event' => false,
'value_as_nested_element' => false,
'attach_mode' => false,
'cli_debug' => false
)

opts = OptionParser.new do |opts|
Expand All @@ -36,20 +36,25 @@ Usage: rdebug-ide is supposed to be called from RDT, NetBeans, RubyMine, or
EOB
opts.separator ""
opts.separator "Options:"


Debugger.trace_to_s = true
opts.on("--evaluation-control", "trace to_s evaluation") do
Debugger.trace_to_s = true
end

ENV['DEBUGGER_MEMORY_LIMIT'] = '10'
opts.on("-m", "--memory-limit LIMIT", Integer, "evaluation memory limit in mb (default: 10)") do |limit|
ENV['DEBUGGER_MEMORY_LIMIT'] = limit
opts.on("-m", "--memory-limit LIMIT", Integer, "evaluation memory limit in mb (default: 10)") do |limit|
ENV['DEBUGGER_MEMORY_LIMIT'] = limit.to_s
end

ENV['INSPECT_TIME_LIMIT'] = '100'
opts.on("-t", "--time-limit LIMIT", Integer, "evaluation time limit in milliseconds (default: 100)") do |limit|
ENV['INSPECT_TIME_LIMIT'] = limit
opts.on("-t", "--time-limit LIMIT", Integer, "evaluation time limit in milliseconds (default: 100)") do |limit|
ENV['INSPECT_TIME_LIMIT'] = limit.to_s
end

opts.on("-h", "--host HOST", "Host name used for remote debugging") {|host| options.host = host}
opts.on("-p", "--port PORT", Integer, "Port used for remote debugging") {|port| options.port = port}
opts.on("--dispatcher-port PORT", Integer, "Port used for multi-process debugging dispatcher") do |dp|
opts.on("--dispatcher-port PORT", Integer, "Port used for multi-process debugging dispatcher") do |dp|
options.dispatcher_port = dp
end
opts.on('--evaluation-timeout TIMEOUT', Integer,'evaluation timeout in seconds (default: 10)') do |timeout|
Expand Down Expand Up @@ -133,7 +138,7 @@ if options.dispatcher_port != -1
end
Debugger::MultiProcess.do_monkey

ENV['DEBUGGER_STORED_RUBYLIB'] = ENV['RUBYLIB']
ENV['DEBUGGER_STORED_RUBYLIB'] = ENV['RUBYLIB']
old_opts = ENV['RUBYOPT'] || ''
starter = "-r#{File.expand_path(File.dirname(__FILE__))}/../lib/ruby-debug-ide/multiprocess/starter"
unless old_opts.include? starter
Expand Down
2 changes: 1 addition & 1 deletion lib/ruby-debug-ide/xml_printer.rb
Expand Up @@ -190,7 +190,7 @@ def exec_with_timeout(sec)

def exec_with_allocation_control(value, memory_limit, time_limit, exec_method, overflow_message_type)
return exec_with_timeout(time_limit * 1e-3) {value.send exec_method} if defined?(JRUBY_VERSION) || memory_limit <= 0 || (RUBY_VERSION < '2.0' && time_limit > 0)
return value.send exec_method if RUBY_VERSION < '2.0'
return value.send exec_method if !Debugger.trace_to_s

curr_thread = Thread.current
control_thread = Debugger.control_thread
Expand Down

0 comments on commit 02148f5

Please sign in to comment.