ruby-debug-ide 0.4.23 → 0.4.24.beta4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- NjRjOTFkYzU1MWZiMmE5MGY3NDEzZWVhZmRlMzZjMDBhNmFjODJmNA==
4
+ NGU4NDUzY2M3ZWY5YjExYmU1YTY3MTJiYzA1ZTFhNGU2MDc4NDc2Yw==
5
5
  data.tar.gz: !binary |-
6
- YjVmM2NlM2FmZjNmN2JhZWIzNzI0MWUzMTkzYTcxYjFjODAyMTI2OQ==
6
+ ZTQyNDJlZjIwN2UzZjRiZWU2Yzc5YTVkYjA0NzJlMGRiNGFkOGNmNQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- NDAxYjlhNDY2YzhiN2Y0M2Y1YzMzOTRmZThiYjMyZThjMmQ1ZjA3N2YxMDVm
10
- ZWZhMzU1NTdiZTQ5YmUzYjNmMTUyYjc1NmY0ZjI0NzQ0MTc4MDlhNGRkNjYw
11
- ZDM2ZmNlNzEzODZlMTk0MDVkZjlmYmM0OTg4M2M3MDc2MjU0YmM=
9
+ MGE1MDU5ZWEzNDFiM2IwZjY5ZjVkYTc5NjE3MzAwNTU5Y2M5MTU0NGU0OWU3
10
+ NmQwZjJiZmVmZjUzMGNiYzQ2YTMxMDVhYmE2MGNiNGE0ZWVjMjBjMzM5NWQ4
11
+ NDczZjEyMTdiN2QxMmZlNWVkYTYzMjFlNmQ4OTU5YjE4MmQ3YmE=
12
12
  data.tar.gz: !binary |-
13
- YzkyNWUzODdkNTFlOTMxNWQ5ODU0ZTNiYWQ2YmNmYzI5NTcwNDE0MWE0NWZk
14
- ZjA0ZWJjNDE2YzI4N2I4ZjBmMDFjYjM0MmFiZjkxZGU3ZmQzNjIyMTczOThm
15
- NTE4ZDQwM2U1YTkxOGYwMDY5N2UwMTFjNTE3NTMwNDU1Y2Y2YTY=
13
+ OWE2YzFjNDExY2UyNjM0ZDUwMDhmNmZkODVmOTNiZTllYmI3MDdhNDA1ZGRm
14
+ ODkxN2U5NTY5ZWIyZWUwNDBlZWEwN2M5ZjFiODMyNjI3MmZjYzI2M2ExNjE4
15
+ NTE2YWI2NzdhYjVkZWNmMDllZGIxNWRlY2JlNmFkZTQxZjI1ZWY=
@@ -1,3 +1,9 @@
1
+ ## [0.4.24.beta4](https://github.com/ruby-debug/ruby-debug-ide/compare/v0.4.23...v0.4.24.beta4)
2
+
3
+ * Performance optimisation for variable representation [RUBY-16055](https://youtrack.jetbrains.com/issue/RUBY-16055)
4
+ * Added command line argument to enable RubyMine-specific protocol extensions
5
+ * Several fixes to make debugger more robust [RUBY-16070](https://youtrack.jetbrains.com/issue/RUBY-16070)
6
+
1
7
  ## [0.4.23](https://github.com/ruby-debug/ruby-debug-ide/compare/v0.4.23.beta11...v0.4.23)
2
8
 
3
9
  * fixed problem with compact name for binary params (strings with invalid encoding)
@@ -19,7 +19,8 @@ options = OpenStruct.new(
19
19
  'tracing' => false,
20
20
  'int_handler' => true,
21
21
  'dispatcher_port' => -1,
22
- 'evaluation_timeout' => 10
22
+ 'evaluation_timeout' => 10,
23
+ 'rm_protocol_extensions' => false
23
24
  )
24
25
 
25
26
  opts = OptionParser.new do |opts|
@@ -54,6 +55,9 @@ EOB
54
55
 
55
56
  opts.on("--keep-frame-binding", "Keep frame bindings") {options.frame_bind = true}
56
57
  opts.on("--disable-int-handler", "Disables interrupt signal handler") {options.int_handler = false}
58
+ opts.on("--rubymine-protocol-extensions", "Enable RubyMine-specific incompatible protocol extensions") do
59
+ options.rm_protocol_extensions = true
60
+ end
57
61
  opts.separator ""
58
62
  opts.separator "Common options:"
59
63
  opts.on_tail("-v", "--version", "Show version") do
@@ -112,6 +116,7 @@ end
112
116
  Debugger.keep_frame_binding = options.frame_bind
113
117
  Debugger.tracing = options.tracing
114
118
  Debugger.evaluation_timeout = options.evaluation_timeout
119
+ Debugger.rm_protocol_extensions = options.rm_protocol_extensions
115
120
 
116
121
  Debugger.debug_program(options)
117
122
 
@@ -41,7 +41,7 @@ module Debugger
41
41
  cleared
42
42
  end
43
43
 
44
- attr_accessor :cli_debug, :xml_debug, :evaluation_timeout
44
+ attr_accessor :cli_debug, :xml_debug, :evaluation_timeout, :rm_protocol_extensions
45
45
  attr_accessor :control_thread
46
46
  attr_reader :interface
47
47
 
@@ -129,7 +129,7 @@ module Debugger
129
129
  locals = @state.context.frame_locals(@state.frame_pos)
130
130
  _self = @state.context.frame_self(@state.frame_pos)
131
131
  begin
132
- locals['self'] = _self unless _self.to_s == "main"
132
+ locals['self'] = _self unless "main" == _self.to_s
133
133
  rescue => ex
134
134
  locals['self'] = "<Cannot evaluate self>"
135
135
  $stderr << "Cannot evaluate self\n#{ex.class.name}: #{ex.message}\n #{ex.backtrace.join("\n ")}"
@@ -28,13 +28,13 @@ module Debugger
28
28
  s.interface = @interface
29
29
  end
30
30
  event_cmds = Command.commands.map{|cmd| cmd.new(state, @printer) }
31
- while !state.proceed? do
31
+ until state.proceed? do
32
32
  input = @interface.command_queue.pop
33
33
  catch(:debug_error) do
34
34
  splitter[input].each do |input|
35
35
  # escape % since print_debug might use printf
36
36
  @printer.print_debug "Processing in context: #{input.gsub('%', '%%')}"
37
- if cmd = event_cmds.find { |c| c.match(input) }
37
+ if (cmd = event_cmds.find { |c| c.match(input) })
38
38
  if context.dead? && cmd.class.need_context
39
39
  @printer.print_msg "Command is unavailable\n"
40
40
  else
@@ -42,15 +42,12 @@ module Debugger
42
42
  end
43
43
  else
44
44
  @printer.print_msg "Unknown command: #{input}"
45
- end
45
+ end
46
46
  end
47
47
  end
48
48
  state.restore_context
49
49
  end
50
- rescue IOError, SystemCallError
51
- @printer.print_error "INTERNAL ERROR!!! #{$!}\n" rescue nil
52
- @printer.print_error $!.backtrace.map{|l| "\t#{l}"}.join("\n") rescue nil
53
- rescue Exception
50
+ rescue ::Exception
54
51
  @printer.print_error "INTERNAL ERROR!!! #{$!}\n" rescue nil
55
52
  @printer.print_error $!.backtrace.map{|l| "\t#{l}"}.join("\n") rescue nil
56
53
  end
@@ -1,3 +1,3 @@
1
1
  module Debugger
2
- IDE_VERSION='0.4.23'
2
+ IDE_VERSION='0.4.24.beta4'
3
3
  end
@@ -78,7 +78,7 @@ module Debugger
78
78
  def print_frame(context, frame_id, current_frame_id)
79
79
  # idx + 1: one-based numbering as classic-debugger
80
80
  file = context.frame_file(frame_id)
81
- print "<frame no=\'%s\' file=\'%s\' line=\'%s\' #{"current='true' " if frame_id == current_frame_id}/>",
81
+ print "<frame no=\"%s\" file=\"%s\" line=\"%s\" #{"current='true' " if frame_id == current_frame_id}/>",
82
82
  frame_id + 1, File.expand_path(file), context.frame_line(frame_id)
83
83
  end
84
84
 
@@ -171,31 +171,14 @@ module Debugger
171
171
  end
172
172
  end
173
173
  value_str = handle_binary_data(value_str)
174
- compact_value_str = build_compact_name(value_str, value)
175
- print("<variable name=\"%s\" compactValue=\"%s\" kind=\"%s\" value=\"%s\" type=\"%s\" hasChildren=\"%s\" objectId=\"%#+x\">",
176
- CGI.escapeHTML(name), CGI.escapeHTML(compact_value_str), kind, CGI.escapeHTML(value_str), value.class,
174
+ escaped_value_str = CGI.escapeHTML(value_str)
175
+ print("<variable name=\"%s\" %s kind=\"%s\" value=\"%s\" type=\"%s\" hasChildren=\"%s\" objectId=\"%#+x\">",
176
+ CGI.escapeHTML(name), build_compact_value_attr(value), kind, build_value_attr(escaped_value_str), value.class,
177
177
  has_children, value.respond_to?(:object_id) ? value.object_id : value.id)
178
- print("<value><![CDATA[%s]]></value>", CGI.escapeHTML(value_str))
178
+ print("<value><![CDATA[%s]]></value>", escaped_value_str) if Debugger.rm_protocol_extensions
179
179
  print('</variable>')
180
180
  end
181
181
 
182
- def build_compact_name(value_str, value)
183
- compact = value_str
184
- if value.is_a?(Array)
185
- slice = value[0..10]
186
- compact = slice.inspect
187
- if value.size != slice.size
188
- compact = compact[0..compact.size-2] + ", ...]"
189
- end
190
- end
191
- if value.is_a?(Hash)
192
- slice = value.sort_by { |k, _| k.to_s }[0..5]
193
- compact = slice.map {|kv| "#{kv[0]}: #{handle_binary_data(kv[1])}"}.join(", ")
194
- compact = "{" + compact + (slice.size != value.size ? ", ..." : "") + "}"
195
- end
196
- compact
197
- end
198
-
199
182
  def print_breakpoints(breakpoints)
200
183
  print_element 'breakpoints' do
201
184
  breakpoints.sort_by{|b| b.id }.each do |b|
@@ -298,7 +281,7 @@ module Debugger
298
281
  end
299
282
 
300
283
  def print_at_line(context, file, line)
301
- print "<suspended file=\'%s\' line=\'%s\' threadId=\'%d\' frames=\'%d\'/>",
284
+ print "<suspended file=\"%s\" line=\"%s\" threadId=\"%d\" frames=\"%d\"/>",
302
285
  File.expand_path(file), line, context.thnum, context.stack_size
303
286
  end
304
287
 
@@ -344,6 +327,7 @@ module Debugger
344
327
  end
345
328
 
346
329
  def handle_binary_data(value)
330
+ # noinspection RubyResolve
347
331
  return '[Binary Data]' if (value.respond_to?('is_binary_data?') && value.is_binary_data?)
348
332
  return '[Invalid encoding]' if (value.respond_to?('valid_encoding?') && !value.valid_encoding?)
349
333
  value
@@ -357,6 +341,39 @@ module Debugger
357
341
  end
358
342
  end
359
343
 
344
+ def build_compact_name(value)
345
+ return compact_array_str(value) if value.is_a?(Array)
346
+ return compact_hash_str(value) if value.is_a?(Hash)
347
+ nil
348
+ rescue ::Exception => e
349
+ print_debug(e)
350
+ nil
351
+ end
352
+
353
+ def compact_array_str(value)
354
+ slice = value[0..10]
355
+ compact = slice.inspect
356
+ if value.size != slice.size
357
+ compact[0..compact.size-2] + ", ...]"
358
+ end
359
+ compact
360
+ end
361
+
362
+ def compact_hash_str(value)
363
+ slice = value.sort_by { |k, _| k.to_s }[0..5]
364
+ compact = slice.map { |kv| "#{kv[0]}: #{handle_binary_data(kv[1])}" }.join(", ")
365
+ "{" + compact + (slice.size != value.size ? ", ..." : "") + "}"
366
+ end
367
+
368
+ def build_compact_value_attr(value)
369
+ compact_value_str = build_compact_name(value)
370
+ compact_value_str.nil? ? '' : "compactValue=\"#{CGI.escapeHTML(compact_value_str)}\""
371
+ end
372
+
373
+ def build_value_attr(escaped_value_str)
374
+ Debugger.rm_protocol_extensions ? '' : escaped_value_str
375
+ end
376
+
360
377
  instance_methods.each do |m|
361
378
  if m.to_s.index('print_') == 0
362
379
  protect m
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.4.23
4
+ version: 0.4.24.beta4
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: 2014-11-17 00:00:00.000000000 Z
11
+ date: 2014-12-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -86,12 +86,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
86
86
  version: 1.8.2
87
87
  required_rubygems_version: !ruby/object:Gem::Requirement
88
88
  requirements:
89
- - - ! '>='
89
+ - - ! '>'
90
90
  - !ruby/object:Gem::Version
91
- version: '0'
91
+ version: 1.3.1
92
92
  requirements: []
93
93
  rubyforge_project: debug-commons
94
- rubygems_version: 2.2.2
94
+ rubygems_version: 2.4.5
95
95
  signing_key:
96
96
  specification_version: 4
97
97
  summary: IDE interface for ruby-debug.