Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set tl and ml for calculating self.to_s #109

Merged
merged 1 commit into from
Aug 1, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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