Bug #4931
closeddebug.rbでvarコマンドを実行するとTypeErrorで落ちる
Description
=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 `'
1.9からKernel#global_variablesなどがシンボルの配列を返すようになったのに
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
-
endfor v in ary.map{|s| s.to_s} stdout.printf " %s => %s\n", v, eval(v, binding).inspect end
=end
Updated by nahi (Hiroshi Nakamura) over 13 years ago
- Status changed from Open to Assigned
- Assignee set to nahi (Hiroshi Nakamura)
- Target version set to 1.9.3
Updated by nahi (Hiroshi Nakamura) over 13 years ago
- Status changed from Assigned to Closed
ありがとうございました。r32271で修正しました。なんと、1.9以後誰もつかってなかったんですねvarコマンド。。。orz