Skip to content

Commit 02148f5

Browse files
committed
option to disable 'to_s' tracing added
1 parent 90bbdb6 commit 02148f5

File tree

2 files changed

+28
-23
lines changed

2 files changed

+28
-23
lines changed

bin/rdebug-ide

Lines changed: 27 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,20 @@ end
1111
$stdout.sync=true
1212

1313
options = OpenStruct.new(
14-
'frame_bind' => false,
15-
'host' => nil,
16-
'load_mode' => false,
17-
'port' => 1234,
18-
'stop' => false,
19-
'tracing' => false,
20-
'int_handler' => true,
21-
'dispatcher_port' => -1,
22-
'evaluation_timeout' => 10,
23-
'rm_protocol_extensions' => false,
24-
'catchpoint_deleted_event' => false,
25-
'value_as_nested_element' => false,
26-
'attach_mode' => false,
27-
'cli_debug' => false
14+
'frame_bind' => false,
15+
'host' => nil,
16+
'load_mode' => false,
17+
'port' => 1234,
18+
'stop' => false,
19+
'tracing' => false,
20+
'int_handler' => true,
21+
'dispatcher_port' => -1,
22+
'evaluation_timeout' => 10,
23+
'rm_protocol_extensions' => false,
24+
'catchpoint_deleted_event' => false,
25+
'value_as_nested_element' => false,
26+
'attach_mode' => false,
27+
'cli_debug' => false
2828
)
2929

3030
opts = OptionParser.new do |opts|
@@ -36,20 +36,25 @@ Usage: rdebug-ide is supposed to be called from RDT, NetBeans, RubyMine, or
3636
EOB
3737
opts.separator ""
3838
opts.separator "Options:"
39-
39+
40+
Debugger.trace_to_s = true
41+
opts.on("--evaluation-control", "trace to_s evaluation") do
42+
Debugger.trace_to_s = true
43+
end
44+
4045
ENV['DEBUGGER_MEMORY_LIMIT'] = '10'
41-
opts.on("-m", "--memory-limit LIMIT", Integer, "evaluation memory limit in mb (default: 10)") do |limit|
42-
ENV['DEBUGGER_MEMORY_LIMIT'] = limit
46+
opts.on("-m", "--memory-limit LIMIT", Integer, "evaluation memory limit in mb (default: 10)") do |limit|
47+
ENV['DEBUGGER_MEMORY_LIMIT'] = limit.to_s
4348
end
44-
49+
4550
ENV['INSPECT_TIME_LIMIT'] = '100'
46-
opts.on("-t", "--time-limit LIMIT", Integer, "evaluation time limit in milliseconds (default: 100)") do |limit|
47-
ENV['INSPECT_TIME_LIMIT'] = limit
51+
opts.on("-t", "--time-limit LIMIT", Integer, "evaluation time limit in milliseconds (default: 100)") do |limit|
52+
ENV['INSPECT_TIME_LIMIT'] = limit.to_s
4853
end
4954

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

136-
ENV['DEBUGGER_STORED_RUBYLIB'] = ENV['RUBYLIB']
141+
ENV['DEBUGGER_STORED_RUBYLIB'] = ENV['RUBYLIB']
137142
old_opts = ENV['RUBYOPT'] || ''
138143
starter = "-r#{File.expand_path(File.dirname(__FILE__))}/../lib/ruby-debug-ide/multiprocess/starter"
139144
unless old_opts.include? starter

lib/ruby-debug-ide/xml_printer.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ def exec_with_timeout(sec)
190190

191191
def exec_with_allocation_control(value, memory_limit, time_limit, exec_method, overflow_message_type)
192192
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)
193-
return value.send exec_method if RUBY_VERSION < '2.0'
193+
return value.send exec_method if !Debugger.trace_to_s
194194

195195
curr_thread = Thread.current
196196
control_thread = Debugger.control_thread

0 commit comments

Comments
 (0)