From: Zouplaz Date: 2007-10-17T05:50:01+09:00 Subject: Re: How to breakpoint ruby code ? le 16/10/2007 15:28, Rick DeNatale nous a dit: > On 10/16/07, Zouplaz wrote: >> Hello, I would like to know how I can have my ruby code stopped and an >> irb invoqued which would allow me to have full access to the current >> context. >> >> I've tried this : >> >> require 'rubygems' >> require_gem 'ruby-breakpoint' >> > .. >> Seems I'm on the very wrong way as I presume that >> debugging/breakpointing is certainly a very common task with Ruby. > > There's a much better replacement for breakpoint: > > http://www.datanoise.com/ruby-debug/ > > Seems a good tool but unfortunately didn't worked... The 'debugger' statement producing no effect at all. But, I re-installed ruby-breakpoint and thanks to this article (http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/213319) I have been able to breakpoint again in the code by adding require 'breakpoint185' after require 'breakpoint' Without that the first require I get a message "Breakpoints are not currently working with Ruby 1.8.5" So, it seems to work - And my last question is : h1 = Hash.new @h2 = Hash.new breakpoint under debugger, @h2 exist but h1 does not. Quite annoying to loose the local vars - Is it a normal behaviour for a ruby debugger ? Should have worked like that with ruby 1.8.4 ?