Skip to content

Commit da5c619

Browse files
viuginick1valich
authored andcommitted
set tl and ml for calculating self.to_s
1 parent 03a6101 commit da5c619

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

lib/ruby-debug-ide/commands/variables.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,8 @@ def execute
129129
locals = @state.context.frame_locals(@state.frame_pos)
130130
_self = @state.context.frame_self(@state.frame_pos)
131131
begin
132-
locals['self'] = _self unless "main" == _self.to_s
132+
_self_str = exec_with_allocation_control(_self, ENV['DEBUGGER_MEMORY_LIMIT'].to_i, ENV['INSPECT_TIME_LIMIT'].to_i, :to_s, false)
133+
locals['self'] = _self unless "main" == _self_str
133134
rescue => ex
134135
locals['self'] = "<Cannot evaluate self>"
135136
$stderr << "Cannot evaluate self\n#{ex.class.name}: #{ex.message}\n #{ex.backtrace.join("\n ")}"

lib/ruby-debug-ide/xml_printer.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ def print_variable(name, value, kind)
220220
value_str = if (defined?(JRUBY_VERSION) || ENV['DEBUGGER_MEMORY_LIMIT'].to_i <= 0)
221221
value.to_s || 'nil' rescue "<#to_s method raised exception: #{$!}>"
222222
else
223-
exec_with_allocation_control(value, ENV['DEBUGGER_MEMORY_LIMIT'].to_i, ENV['INSPECT_TIME_LIMIT'].to_i, :to_s, false) || 'nil' rescue "<#to_s method raised exception: #{$!}>"
223+
exec_with_allocation_control(value, ENV['DEBUGGER_MEMORY_LIMIT'].to_i, ENV['INSPECT_TIME_LIMIT'].to_i, :to_s, true) || 'nil' rescue "<#to_s method raised exception: #{$!}>"
224224
end
225225

226226
unless value_str.is_a?(String)

0 commit comments

Comments
 (0)