app/frame.rb in rb8-trepanning-0.1.5 vs app/frame.rb in rb8-trepanning-0.1.6

- old
+ new

@@ -10,11 +10,11 @@ @stack_size = @context.stack_size reset end def reset - @binding = @klass = @file = @line = + @binding = @klass = @file = @line = @local_variables = @method_name = @thread = nil end def index=(new_value) if new_value > 0 && new_value < @stack_size @@ -40,23 +40,23 @@ locals = local_variables if opts[:callstyle] != :short && klass if opts[:callstyle] == :tracked arg_info = @context.frame_args_info(@index) end - call_str << "#{klass}." + call_str << "#{klass}." end call_str << method_name if args.any? call_str << "(" args.each_with_index do |name, i| - case opts[:callstyle] + case opts[:callstyle] when :short call_str += "%s, " % [name] when :last klass = locals[name].class if klass.inspect.size > 20+3 - klass = klass.inspect[0..20]+"..." + klass = klass.inspect[0..20]+"..." end call_str += "%s#%s, " % [name, klass] when :tracked if arg_info && arg_info.size > i call_str += "#{name}: #{arg_info[i].inspect}, " @@ -68,11 +68,11 @@ # Strip off trailing ', ' if any but add stuff for later trunc call_str[-2..-1] = ",...XX" break end end - call_str[-2..-1] = ")" # Strip off trailing ', ' if any + call_str[-2..-1] = ")" # Strip off trailing ', ' if any end end return call_str end @@ -147,15 +147,15 @@ require 'rubygems' require 'ruby-debug-base'; Debugger.start def foo(str, num) x = 1 context = Debugger.current_context - Debugger.skip do + Debugger.skip do 0.upto(Debugger.current_context.stack_size-1) do |i| frame = Trepan::Frame.new(context) frame.index = i - puts "Frame #{i}: #{frame.file}, line #{frame.line}, " + - "class #{frame.klass}, thread: #{frame.thread}, " + + puts "Frame #{i}: #{frame.file}, line #{frame.line}, " + + "class #{frame.klass}, thread: #{frame.thread}, " + "method: #{frame.method_name}" p frame.local_variables puts frame.describe(:maxwidth => 80, :callstyle=>:tracked) puts '-' * 30 end