ruby-debug-ide 0.6.1.beta9 → 0.6.1.beta11

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a2852711026ba805b67c3c434639bafe781c94fb
4
- data.tar.gz: 67501296e2f294e1c9cb3295cef40004d628593f
3
+ metadata.gz: 71726a834f8abd61b5cdbacf03fb2f1b2a20dad9
4
+ data.tar.gz: c2c8f6e03aa09b14cd1445258a88898ef72596ad
5
5
  SHA512:
6
- metadata.gz: 164dea0a96937cd8cfa702141ff3320e7c4b85469d9c26212774a8865ba21253d7560ec448ab6bb5da0d34fe760811b5a8447a0fb25ac4ce37b255a480aff473
7
- data.tar.gz: 42999728cea96ed4e609acc8c51e3e37f2f3d3db96e7790c36c886da4260219e52eb7611aa658f2015c973859f19ba90bf4ac693943860da67cf1617ab6fb5b1
6
+ metadata.gz: 993bdd8e22ebf94d03723ff6c938d1465e3b2c903ff67f28a93908f153b830631069061465adc7141b50b85339c344ee78644f170a4a4e124c29ae4bbd601308
7
+ data.tar.gz: 2034542f9d716c1edca4c3459b02fce2646a4010ecde0c8ba8fbb3de0d7d7956c15ab36eafafc77b0b9d9f00510ea953c83601efa80615d488890ddc890c7a2b
data/bin/rdebug-ide CHANGED
@@ -20,6 +20,9 @@ options = OpenStruct.new(
20
20
  'int_handler' => true,
21
21
  'dispatcher_port' => -1,
22
22
  'evaluation_timeout' => 10,
23
+ 'trace_to_s' => false,
24
+ 'debugger_memory_limit' => 10,
25
+ 'inspect_time_limit' => 100,
23
26
  'rm_protocol_extensions' => false,
24
27
  'catchpoint_deleted_event' => false,
25
28
  'value_as_nested_element' => false,
@@ -37,21 +40,6 @@ EOB
37
40
  opts.separator ""
38
41
  opts.separator "Options:"
39
42
 
40
- Debugger.trace_to_s = false
41
- opts.on("--evaluation-control", "trace to_s evaluation") do
42
- Debugger.trace_to_s = true
43
- end
44
-
45
- ENV['DEBUGGER_MEMORY_LIMIT'] = '10'
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
48
- end
49
-
50
- ENV['INSPECT_TIME_LIMIT'] = '100'
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
53
- end
54
-
55
43
  opts.on("-h", "--host HOST", "Host name used for remote debugging") {|host| options.host = host}
56
44
  opts.on("-p", "--port PORT", Integer, "Port used for remote debugging") {|port| options.port = port}
57
45
  opts.on("--dispatcher-port PORT", Integer, "Port used for multi-process debugging dispatcher") do |dp|
@@ -60,6 +48,22 @@ EOB
60
48
  opts.on('--evaluation-timeout TIMEOUT', Integer,'evaluation timeout in seconds (default: 10)') do |timeout|
61
49
  options.evaluation_timeout = timeout
62
50
  end
51
+ opts.on("--evaluation-control", "trace to_s evaluation") {options.trace_to_s = true}
52
+
53
+ opts.on("-m", "--memory-limit LIMIT", Integer, "evaluation memory limit in mb (default: 10)") do |limit|
54
+ if defined?(JRUBY_VERSION) || RUBY_VERSION < '2.0'
55
+ $stderr.puts "Evaluation memory limit is ineffective in JRuby and MRI < 2.0"
56
+ limit = 0
57
+ end
58
+ options.debugger_memory_limit = limit
59
+ options.trace_to_s ||= limit > 0
60
+ end
61
+
62
+ opts.on("-t", "--time-limit LIMIT", Integer, "evaluation time limit in milliseconds (default: 100)") do |limit|
63
+ options.inspect_time_limit = limit
64
+ options.trace_to_s ||= limit > 0
65
+ end
66
+
63
67
  opts.on('--stop', 'stop when the script is loaded') {options.stop = true}
64
68
  opts.on("-x", "--trace", "turn on line tracing") {options.tracing = true}
65
69
  opts.on("-l", "--load-mode", "load mode (experimental)") {options.load_mode = true}
@@ -157,6 +161,9 @@ end
157
161
  Debugger.keep_frame_binding = options.frame_bind
158
162
  Debugger.tracing = options.tracing
159
163
  Debugger.evaluation_timeout = options.evaluation_timeout
164
+ Debugger.trace_to_s = options.trace_to_s && (options.debugger_memory_limit > 0 || options.inspect_time_limit > 0)
165
+ Debugger.debugger_memory_limit = options.debugger_memory_limit
166
+ Debugger.inspect_time_limit = options.inspect_time_limit
160
167
  Debugger.catchpoint_deleted_event = options.catchpoint_deleted_event || options.rm_protocol_extensions
161
168
  Debugger.value_as_nested_element = options.value_as_nested_element || options.rm_protocol_extensions
162
169
 
@@ -9,7 +9,7 @@ module Debugger
9
9
  end
10
10
 
11
11
  def execute
12
- string_to_parse = Command.unescape_incoming(@match.post_match) + "\n\n\n"
12
+ string_to_parse = Command.unescape_incoming(@match.post_match) + " \n\n\n"
13
13
  total_lines = string_to_parse.count("\n") + 1
14
14
 
15
15
  lexer = RubyLex.new
@@ -17,7 +17,10 @@ module Debugger
17
17
  'int_handler' => true,
18
18
  'cli_debug' => (ENV['DEBUGGER_CLI_DEBUG'] == 'true'),
19
19
  'notify_dispatcher' => true,
20
- 'evaluation_timeout' => 10
20
+ 'evaluation_timeout' => 10,
21
+ 'trace_to_s' => false,
22
+ 'debugger_memory_limit' => 10,
23
+ 'inspect_time_limit' => 100
21
24
  )
22
25
 
23
26
  if(options.ignore_port)
@@ -45,6 +48,9 @@ module Debugger
45
48
  Debugger.keep_frame_binding = options.frame_bind
46
49
  Debugger.tracing = options.tracing
47
50
  Debugger.evaluation_timeout = options.evaluation_timeout
51
+ Debugger.trace_to_s = options.trace_to_s
52
+ Debugger.debugger_memory_limit = options.debugger_memory_limit
53
+ Debugger.inspect_time_limit = options.inspect_time_limit
48
54
  Debugger.cli_debug = options.cli_debug
49
55
  Debugger.prepare_debugger(options)
50
56
  end
@@ -1,3 +1,3 @@
1
1
  module Debugger
2
- IDE_VERSION='0.6.1.beta9'
2
+ IDE_VERSION='0.6.1.beta11'
3
3
  end
@@ -1,9 +1,6 @@
1
1
  require 'stringio'
2
2
  require 'cgi'
3
3
  require 'monitor'
4
- if (!defined?(JRUBY_VERSION))
5
- require 'objspace'
6
- end
7
4
 
8
5
  module Debugger
9
6
 
@@ -153,7 +150,7 @@ module Debugger
153
150
  if k.class.name == "String"
154
151
  name = '\'' + k + '\''
155
152
  else
156
- name = exec_with_allocation_control(k, ENV['DEBUGGER_MEMORY_LIMIT'].to_i, ENV['INSPECT_TIME_LIMIT'].to_i, :to_s, OverflowMessageType::EXCEPTION_MESSAGE)
153
+ name = exec_with_allocation_control(k, :to_s, OverflowMessageType::EXCEPTION_MESSAGE)
157
154
  end
158
155
  print_variable(name, hash[k], 'instance')
159
156
  }
@@ -188,16 +185,17 @@ module Debugger
188
185
  end
189
186
  end
190
187
 
191
- def exec_with_allocation_control(value, memory_limit, time_limit, exec_method, overflow_message_type)
192
- return value.send exec_method if !Debugger.trace_to_s
193
- return exec_with_timeout(time_limit * 1e-3, "Timeout: evaluation of #{exec_method} took longer than #{time_limit}ms.") {value.send exec_method} if defined?(JRUBY_VERSION) || memory_limit <= 0 || (RUBY_VERSION < '2.0' && time_limit > 0)
188
+ def exec_with_allocation_control(value, exec_method, overflow_message_type)
189
+ return value.send exec_method unless Debugger.trace_to_s
194
190
 
191
+ memory_limit = Debugger.debugger_memory_limit
192
+ time_limit = Debugger.inspect_time_limit
195
193
 
196
- curr_thread = Thread.current
197
- control_thread = Debugger.control_thread
198
-
199
- result = nil
194
+ if defined?(JRUBY_VERSION) || RUBY_VERSION < '2.0' || memory_limit <= 0
195
+ return exec_with_timeout(time_limit * 1e-3, "Timeout: evaluation of #{exec_method} took longer than #{time_limit}ms.") { value.send exec_method }
196
+ end
200
197
 
198
+ require 'objspace'
201
199
  trace_queue = Queue.new
202
200
 
203
201
  inspect_thread = DebugThread.start do
@@ -263,7 +261,7 @@ module Debugger
263
261
  else
264
262
  has_children = !value.instance_variables.empty? || !value.class.class_variables.empty?
265
263
 
266
- value_str = exec_with_allocation_control(value, ENV['DEBUGGER_MEMORY_LIMIT'].to_i, ENV['INSPECT_TIME_LIMIT'].to_i, :to_s, OverflowMessageType::EXCEPTION_MESSAGE) || 'nil' rescue "<#to_s method raised exception: #{$!}>"
264
+ value_str = exec_with_allocation_control(value, :to_s, OverflowMessageType::EXCEPTION_MESSAGE) || 'nil' rescue "<#to_s method raised exception: #{$!}>"
267
265
  unless value_str.is_a?(String)
268
266
  value_str = "ERROR: #{value.class}.to_s method returns #{value_str.class}. Should return String."
269
267
  end
@@ -489,7 +487,7 @@ module Debugger
489
487
  def compact_array_str(value)
490
488
  slice = value[0..10]
491
489
 
492
- compact = exec_with_allocation_control(slice, ENV['DEBUGGER_MEMORY_LIMIT'].to_i, ENV['INSPECT_TIME_LIMIT'].to_i, :inspect, OverflowMessageType::NIL_MESSAGE)
490
+ compact = exec_with_allocation_control(slice, :inspect, OverflowMessageType::NIL_MESSAGE)
493
491
 
494
492
  if compact && value.size != slice.size
495
493
  compact[0..compact.size - 2] + ", ...]"
@@ -501,14 +499,14 @@ module Debugger
501
499
  keys_strings = Hash.new
502
500
 
503
501
  slice = value.sort_by do |k, _|
504
- keys_string = exec_with_allocation_control(k, ENV['DEBUGGER_MEMORY_LIMIT'].to_i, ENV['INSPECT_TIME_LIMIT'].to_i, :to_s, OverflowMessageType::SPECIAL_SYMBOL_MESSAGE)
502
+ keys_string = exec_with_allocation_control(k, :to_s, OverflowMessageType::SPECIAL_SYMBOL_MESSAGE)
505
503
  keys_strings[k] = keys_string
506
504
  keys_string
507
505
  end[0..5]
508
506
 
509
507
  compact = slice.map do |kv|
510
508
  key_string = keys_strings[kv[0]]
511
- value_string = exec_with_allocation_control(kv[1], ENV['DEBUGGER_MEMORY_LIMIT'].to_i, ENV['INSPECT_TIME_LIMIT'].to_i, :to_s, OverflowMessageType::SPECIAL_SYMBOL_MESSAGE)
509
+ value_string = exec_with_allocation_control(kv[1], :to_s, OverflowMessageType::SPECIAL_SYMBOL_MESSAGE)
512
510
  "#{key_string}: #{handle_binary_data(value_string)}"
513
511
  end.join(", ")
514
512
  "{" + compact + (slice.size != value.size ? ", ..." : "") + "}"
@@ -44,7 +44,8 @@ module Debugger
44
44
  end
45
45
 
46
46
  attr_accessor :attached
47
- attr_accessor :cli_debug, :xml_debug, :evaluation_timeout, :trace_to_s
47
+ attr_accessor :cli_debug, :xml_debug, :evaluation_timeout
48
+ attr_accessor :trace_to_s, :debugger_memory_limit, :inspect_time_limit
48
49
  attr_accessor :control_thread
49
50
  attr_reader :interface
50
51
  # protocol extensions
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-debug-ide
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.1.beta9
4
+ version: 0.6.1.beta11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Markus Barchfeld, Martin Krauskopf, Mark Moseley, JetBrains RubyMine Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-09-01 00:00:00.000000000 Z
11
+ date: 2017-12-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -103,7 +103,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
103
103
  version: 1.3.1
104
104
  requirements: []
105
105
  rubyforge_project: debug-commons
106
- rubygems_version: 2.5.1
106
+ rubygems_version: 2.6.14
107
107
  signing_key:
108
108
  specification_version: 4
109
109
  summary: IDE interface for ruby-debug.