ruby-debug-ide 0.4.23.beta11 → 0.4.23
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/ChangeLog.md +5 -0
- data/lib/ruby-debug-ide/version.rb +1 -1
- data/lib/ruby-debug-ide/xml_printer.rb +30 -16
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
NjRjOTFkYzU1MWZiMmE5MGY3NDEzZWVhZmRlMzZjMDBhNmFjODJmNA==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
YjVmM2NlM2FmZjNmN2JhZWIzNzI0MWUzMTkzYTcxYjFjODAyMTI2OQ==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
NDAxYjlhNDY2YzhiN2Y0M2Y1YzMzOTRmZThiYjMyZThjMmQ1ZjA3N2YxMDVm
|
10
|
+
ZWZhMzU1NTdiZTQ5YmUzYjNmMTUyYjc1NmY0ZjI0NzQ0MTc4MDlhNGRkNjYw
|
11
|
+
ZDM2ZmNlNzEzODZlMTk0MDVkZjlmYmM0OTg4M2M3MDc2MjU0YmM=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
YzkyNWUzODdkNTFlOTMxNWQ5ODU0ZTNiYWQ2YmNmYzI5NTcwNDE0MWE0NWZk
|
14
|
+
ZjA0ZWJjNDE2YzI4N2I4ZjBmMDFjYjM0MmFiZjkxZGU3ZmQzNjIyMTczOThm
|
15
|
+
NTE4ZDQwM2U1YTkxOGYwMDY5N2UwMTFjNTE3NTMwNDU1Y2Y2YTY=
|
data/ChangeLog.md
CHANGED
@@ -1,3 +1,8 @@
|
|
1
|
+
## [0.4.23](https://github.com/ruby-debug/ruby-debug-ide/compare/v0.4.23.beta11...v0.4.23)
|
2
|
+
|
3
|
+
* fixed problem with compact name for binary params (strings with invalid encoding)
|
4
|
+
[RUBY-15960](https://youtrack.jetbrains.com/issue/RUBY-15960)
|
5
|
+
|
1
6
|
## [0.4.23.beta11](https://github.com/ruby-debug/ruby-debug-ide/compare/v0.4.23.beta10...v0.4.23.beta11)
|
2
7
|
|
3
8
|
* adding breakpoint in non-existing file should not break debugger
|
@@ -91,8 +91,7 @@ module Debugger
|
|
91
91
|
end
|
92
92
|
|
93
93
|
def print_context(context)
|
94
|
-
|
95
|
-
print "<thread id=\"%s\" status=\"%s\" pid=\"%s\" #{current}/>", context.thnum, context.thread.status, Process.pid
|
94
|
+
print "<thread id=\"%s\" status=\"%s\" pid=\"%s\" #{current_thread_attr(context)}/>", context.thnum, context.thread.status, Process.pid
|
96
95
|
end
|
97
96
|
|
98
97
|
def print_variables(vars, kind)
|
@@ -147,30 +146,31 @@ module Debugger
|
|
147
146
|
end
|
148
147
|
if value.is_a?(Array) || value.is_a?(Hash)
|
149
148
|
has_children = !value.empty?
|
150
|
-
|
151
|
-
|
152
|
-
else
|
153
|
-
size = value.size
|
149
|
+
if has_children
|
150
|
+
size = value.size
|
154
151
|
value_str = "#{value.class} (#{value.size} element#{size > 1 ? "s" : "" })"
|
152
|
+
else
|
153
|
+
value_str = "Empty #{value.class}"
|
155
154
|
end
|
156
155
|
elsif value.is_a?(String)
|
157
156
|
has_children = value.respond_to?('bytes') || value.respond_to?('encoding')
|
158
157
|
value_str = value
|
159
158
|
else
|
160
159
|
has_children = !value.instance_variables.empty? || !value.class.class_variables.empty?
|
161
|
-
value_str = value.to_s || 'nil' rescue "<#to_s method raised exception:
|
160
|
+
value_str = value.to_s || 'nil' rescue "<#to_s method raised exception: #{$!}>"
|
162
161
|
unless value_str.is_a?(String)
|
163
162
|
value_str = "ERROR: #{value.class}.to_s method returns #{value_str.class}. Should return String."
|
164
163
|
end
|
165
164
|
end
|
166
165
|
|
167
166
|
if value_str.respond_to?('encode')
|
167
|
+
# noinspection RubyEmptyRescueBlockInspection
|
168
168
|
begin
|
169
169
|
value_str = value_str.encode("UTF-8")
|
170
170
|
rescue
|
171
|
-
end
|
171
|
+
end
|
172
172
|
end
|
173
|
-
value_str =
|
173
|
+
value_str = handle_binary_data(value_str)
|
174
174
|
compact_value_str = build_compact_name(value_str, value)
|
175
175
|
print("<variable name=\"%s\" compactValue=\"%s\" kind=\"%s\" value=\"%s\" type=\"%s\" hasChildren=\"%s\" objectId=\"%#+x\">",
|
176
176
|
CGI.escapeHTML(name), CGI.escapeHTML(compact_value_str), kind, CGI.escapeHTML(value_str), value.class,
|
@@ -184,13 +184,13 @@ module Debugger
|
|
184
184
|
if value.is_a?(Array)
|
185
185
|
slice = value[0..10]
|
186
186
|
compact = slice.inspect
|
187
|
-
if
|
187
|
+
if value.size != slice.size
|
188
188
|
compact = compact[0..compact.size-2] + ", ...]"
|
189
189
|
end
|
190
190
|
end
|
191
191
|
if value.is_a?(Hash)
|
192
|
-
slice = value.sort_by { |k,
|
193
|
-
compact = slice.map {|kv| "#{kv[0]}: #{kv[1]}"}.join(", ")
|
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
194
|
compact = "{" + compact + (slice.size != value.size ? ", ..." : "") + "}"
|
195
195
|
end
|
196
196
|
compact
|
@@ -255,7 +255,7 @@ module Debugger
|
|
255
255
|
|
256
256
|
def print_list(b, e, file, line)
|
257
257
|
print "[%d, %d] in %s\n", b, e, file
|
258
|
-
if lines = Debugger.source_for(file)
|
258
|
+
if (lines = Debugger.source_for(file))
|
259
259
|
b.upto(e) do |n|
|
260
260
|
if n > 0 && lines[n-1]
|
261
261
|
if n == line
|
@@ -266,7 +266,7 @@ module Debugger
|
|
266
266
|
end
|
267
267
|
end
|
268
268
|
else
|
269
|
-
print "No
|
269
|
+
print "No source-file available for %s\n", file
|
270
270
|
end
|
271
271
|
end
|
272
272
|
|
@@ -280,7 +280,7 @@ module Debugger
|
|
280
280
|
|
281
281
|
# Events
|
282
282
|
|
283
|
-
def print_breakpoint(
|
283
|
+
def print_breakpoint(_, breakpoint)
|
284
284
|
print("<breakpoint file=\"%s\" line=\"%s\" threadId=\"%d\"/>",
|
285
285
|
breakpoint.source, breakpoint.pos, Debugger.current_context.thnum)
|
286
286
|
end
|
@@ -302,7 +302,7 @@ module Debugger
|
|
302
302
|
File.expand_path(file), line, context.thnum, context.stack_size
|
303
303
|
end
|
304
304
|
|
305
|
-
def print_exception(exception,
|
305
|
+
def print_exception(exception, _)
|
306
306
|
print_element("variables") do
|
307
307
|
proxy = ExceptionProxy.new(exception)
|
308
308
|
InspectCommand.reference_result(proxy)
|
@@ -343,6 +343,20 @@ module Debugger
|
|
343
343
|
@interface.print(*params)
|
344
344
|
end
|
345
345
|
|
346
|
+
def handle_binary_data(value)
|
347
|
+
return '[Binary Data]' if (value.respond_to?('is_binary_data?') && value.is_binary_data?)
|
348
|
+
return '[Invalid encoding]' if (value.respond_to?('valid_encoding?') && !value.valid_encoding?)
|
349
|
+
value
|
350
|
+
end
|
351
|
+
|
352
|
+
def current_thread_attr(context)
|
353
|
+
if context.thread == Thread.current
|
354
|
+
'current="yes"'
|
355
|
+
else
|
356
|
+
''
|
357
|
+
end
|
358
|
+
end
|
359
|
+
|
346
360
|
instance_methods.each do |m|
|
347
361
|
if m.to_s.index('print_') == 0
|
348
362
|
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.23
|
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
|
+
date: 2014-11-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -86,9 +86,9 @@ 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:
|
91
|
+
version: '0'
|
92
92
|
requirements: []
|
93
93
|
rubyforge_project: debug-commons
|
94
94
|
rubygems_version: 2.2.2
|