From: Jay Cotton Date: 2004-07-20T23:50:35+09:00 Subject: Re: Ruby Debugger options: v[ar] g[lobal] ... On Tue, 20 Jul 2004 20:32:05 +0900, Robert Klemme wrote > "Yukihiro Matsumoto" schrieb im Newsbeitrag > news:1090312949.825866.21834.nullmailer@picachu.netlab.jp... > > Hi, > > > > In message "Ruby Debugger options: v[ar] g[lobal] ..." > > on 04/07/18, "jay" writes: > > > > |The "display variables" commands, however, aren't doing what I > expect... The documentation lists > > |them like so: > > | > > | v[ar] g[lobal] show global variables > > | v[ar] l[ocal] show local variables > > | > > |...but when I type 'v g', I get the error message: > > | > > | 1undefined local variable or method `g' for main:Object > > > > I can't reproduce your problem. More information please. > > How you compiled/installed your Ruby, the version, etc. > > Does this help? > > 13:26:35 [source]: uname -a > CYGWIN_NT-5.0 bond 1.5.7(0.109/3/2) 2004-01-30 19:32 i686 unknown unknown > Cygwin > 13:26:53 [source]: ruby --version > ruby 1.8.1 (2003-12-25) [i386-cygwin] > > 13:26:57 [source]: ruby -rdebug -e '$foo="x";bar="y";1000.times {|i| > puts i }' Debug.rb Emacs support available. > > -e:1:$foo="x";bar="y";1000.times {|i| puts i } > (rdb:1) $foo > nil > (rdb:1) s > -e:1:$foo="x";bar="y";1000.times {|i| puts i } > (rdb:1) $foo > "x" > (rdb:1) v foo > -e:1:(eval):1undefined local variable or method `foo' for main:Object > (rdb:1) v g foo > (eval):1: warning: parenthesize argument(s) for future version > -e:1:(eval):1undefined local variable or method `foo' for main:Object > (rdb:1) bar > nil > (rdb:1) v bar > -e:1:(eval):1undefined method `v' for main:Object > (rdb:1) step > -e:1:$foo="x";bar="y";1000.times {|i| puts i } > (rdb:1) bar > "y" > (rdb:1) v bar > -e:1:(eval):1undefined method `v' for main:Object > (rdb:1) q > Really quit? (y/n) y > > Dunno whether this is related to readline built in or not. > > Regards > > robert Here is my own version of the above: ra88it:~ jcotton$ uname -a Darwin ra88it.local 7.4.0 Darwin Kernel Version 7.4.0: Wed May 12 16:58:24 PDT 2004; root:xnu/ xnu-517.7.7.obj~7/RELEASE_PPC Power Macintosh powerpc ra88it:~ jcotton$ /usr/local/bin/ruby --version ruby 1.8.1 (2003-12-25) [powerpc-darwin] ra88it:~ jcotton$ /usr/local/bin/ruby -rdebug -e '$foo="x";bar="y";1000.times {|i| puts i }' Debug.rb Emacs support available. -e:1: (rdb:1) $foo nil (rdb:1) s -e:1: (rdb:1) $foo "x" (rdb:1) v foo -e:1:(eval):1undefined local variable or method `foo' for main:Object (rdb:1) v g foo (eval):1: warning: parenthesize argument(s) for future version -e:1:(eval):1undefined local variable or method `foo' for main:Object (rdb:1) bar nil (rdb:1) v bar -e:1:(eval):1undefined method `v' for main:Object (rdb:1) step -e:1: (rdb:1) bar "y" (rdb:1) v bar -e:1:(eval):1undefined method `v' for main:Object (rdb:1) q Really quit? (y/n) y ra88it:~ jcotton$ Note: I have readline support built in to this version as well as the binary version that I installed in a different location this morning. The binary version does not have this debugger problem, however. Thanks, Jay