From: Leslie Viljoen Date: 2007-05-26T05:31:15+09:00 Subject: Re: Ruby - Debugging ------=_Part_115751_31496782.1180125068942 Content-Type: text/plain; charset=WINDOWS-1252; format=flowed Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On 5/25/07, Jorge Domenico Bucaran Romano wrote: > > Yes I googled it and I have found no help. I can't believe none can > actually provide a serious explanation on this. And I say this with base > because the very short section in the Pickaxe barely touches the subject > with an extensive example that fails providing a good start. It helps > only if you have actually debugged previously. As you can see in my > humble try before the "list" command does not return the list of my > demo2.rb program which is only > > a =3D 2 > puts a > a =3D 3 > puts a > > I need help getting it started, I can get it my own later, so focus your > help on that. Thank you. > > P.S: I promise to myself that if I ever get this running I will provide > a simple tutorial on using the Ruby debugger for dummies like me. > > -- > Posted via http://www.ruby-forum.com/. Ok, I have something. I saved your little program as "test.rb". When you set the breakpoint, just use the filename, not the path. Here's my session: C:\Documents and Settings\lesliev>ruby -rdebug test.rb Debug.rb Emacs support available. c:/ruby/lib/ruby/site_ruby/1.8/ubygems.rb:10:require 'rubygems' (rdb:1) b test.rb:3 Set breakpoint 1 at test.rb:3 (rdb:1) list [5, 14] in c:/ruby/lib/ruby/site_ruby/1.8/ubygems.rb 5 # All rights reserved. 6 # See LICENSE.txt for permissions. 7 #++ 8 9 =3D> 10 require 'rubygems' (rdb:1) run c:/ruby/lib/ruby/site_ruby/1.8/ubygems.rb:10:undefined local variable or method `run' for main:Object (rdb:1) c Breakpoint 1, toplevel at test.rb:3 test.rb:3:puts a (rdb:1) list [-2, 7] in test.rb 1 2 a =3D 2 =3D> 3 puts a 4 a =3D 3 5 puts a 6 7 (rdb:1) Les --=20 If you could create a machine that copies hamburgers =97 you put one hambur= ger in and two equally good hamburgers come out the other side =97 it would be unethical not to do so and make it freely available. ------=_Part_115751_31496782.1180125068942--