Skip to content

Commit

Permalink
set tl and ml for calculating self.to_s
Browse files Browse the repository at this point in the history
  • Loading branch information
ViugiNick authored and valich committed Aug 1, 2017
1 parent 03a6101 commit da5c619
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion lib/ruby-debug-ide/commands/variables.rb
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,8 @@ def execute
locals = @state.context.frame_locals(@state.frame_pos)
_self = @state.context.frame_self(@state.frame_pos)
begin
locals['self'] = _self unless "main" == _self.to_s
_self_str = exec_with_allocation_control(_self, ENV['DEBUGGER_MEMORY_LIMIT'].to_i, ENV['INSPECT_TIME_LIMIT'].to_i, :to_s, false)
locals['self'] = _self unless "main" == _self_str
rescue => ex
locals['self'] = "<Cannot evaluate self>"
$stderr << "Cannot evaluate self\n#{ex.class.name}: #{ex.message}\n #{ex.backtrace.join("\n ")}"
Expand Down
2 changes: 1 addition & 1 deletion lib/ruby-debug-ide/xml_printer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ def print_variable(name, value, kind)
value_str = if (defined?(JRUBY_VERSION) || ENV['DEBUGGER_MEMORY_LIMIT'].to_i <= 0)
value.to_s || 'nil' rescue "<#to_s method raised exception: #{$!}>"
else
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: #{$!}>"
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: #{$!}>"
end

unless value_str.is_a?(String)
Expand Down

0 comments on commit da5c619

Please sign in to comment.