Issue #4931 has been updated by Hiroshi Nakamura.

Status changed from Assigned to Closed

????????????????????????障????????r32271??т信罩c????障????????????????1.9篁ュ??茯違????ゃ????c??????c???????с?????var??潟????潟???????????orz
----------------------------------------
Bug #4931: debug.rb???var??潟????潟?????絎?茵??????????TypeError??ц?純?<??
http://redmine.ruby-lang.org/issues/4931

Author: Kazuki Tsujimoto
Status: Closed
Priority: Normal
Assignee: Hiroshi Nakamura
Category: lib
Target version: 1.9.3
ruby -v: ruby 1.9.3dev (2011-06-26 trunk 32235) [x86_64-linux]


=begin
莨紙??с?????

debug.rb??????若????????var??潟????潟?????絎?茵???????????紊?????????????純?<?障?????

 $ ./ruby -Ilib -rdebug -e '0'
 Debug.rb
 Emacs support available.
 
 -e:1:0
 (rdb:1) var g
 /home/k_tsj/work/ruby-trunk/lib/debug.rb:150:in `eval': can't convert Symbol into String (TypeError)
         from /home/k_tsj/work/ruby-trunk/lib/debug.rb:150:in `block in var_list'
         from /home/k_tsj/work/ruby-trunk/lib/debug.rb:149:in `each'
         from /home/k_tsj/work/ruby-trunk/lib/debug.rb:149:in `var_list'
         from /home/k_tsj/work/ruby-trunk/lib/debug.rb:157:in `debug_variable_info'
         from /home/k_tsj/work/ruby-trunk/lib/debug.rb:478:in `block in debug_command'
         from /home/k_tsj/work/ruby-trunk/lib/debug.rb:240:in `catch'
         from /home/k_tsj/work/ruby-trunk/lib/debug.rb:240:in `debug_command'
         from /home/k_tsj/work/ruby-trunk/lib/debug.rb:691:in `trace_func'
         from /home/k_tsj/work/ruby-trunk/lib/debug.rb:905:in `block in <class:DEBUGGER__>'
         from -e:1:in `<main>'

1.9??????Kernel#global_variables???????激?潟?????????????菴??????????????c??????
debug.rb???絲上????с??????????????????????с?????

???????????с?????

 diff --git a/lib/debug.rb b/lib/debug.rb
 index 4fb9d50..87a1826 100644
 --- a/lib/debug.rb
 +++ b/lib/debug.rb
 @@ -146,7 +146,7 @@ class DEBUGGER__
  
      def var_list(ary, binding)
        ary.sort!
 -      for v in ary
 +      for v in ary.map{|s| s.to_s}
          stdout.printf "  %s => %s\n", v, eval(v, binding).inspect
        end
      end
=end



-- 
http://redmine.ruby-lang.org