thorin-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2006-Oct-02 23:06 UTC
Local Variables vs. Instance Variables inside breakpointer
Hi, I have a quick question about breakpoints. I am testing a class method inside a model in development mode and when I get to the breakpoint, I can''t seem to inspect any of the local variables inside the method. Here is what the code looks like: class User self.register(params,options) @user = User.new(params[:user]) user = User.new(params[:user]) if options # do stuff breakpoint else # do other stuff end end end I can inspect the instance variable just fine, but if I try to inspect the ''user'' local variable or params or options I get the following exception: ameError: undefined local variable or method `user'' for User:Class from (druby://localhost:42531) /opt/local/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/base.rb:1129:in `method_missing'' from (druby://localhost:42531) (irb):1:in `breakpoint'' I noticed the same thing happens in unit tests as well. Any ideas? I am using rails 1.1.6 and ruby 1.8.5 Thanks, Curtis --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
thorin-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2006-Oct-03 00:09 UTC
Re: Local Variables vs. Instance Variables inside breakpointer
I worked around this by upgrading to using ruby-debug within my rails app. It''s quite nice for someone who likes gdb! Still wondering why breakpoint didn''t happen to work otherwise though. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
Wiliam Langshaw
2006-Nov-09 16:14 UTC
Re: Local Variables vs. Instance Variables inside breakpointer
I am experiencing the same issue as you, I can see instance but not local variables. However, it only acts this way on two different machines. On one machine with Rails installed via the Gem install I CAN see local variables but on another machine with a Rails install done via the SysAdmin(s) I can NOT see local variables (one could almost imagine the situation being reversed - a custom install of Rails *would* have local variable visibility because it might be the version you ended up using - ruby-debug). But this isnt the case. Did you make any further progress on this w/o having to resort to ruby-debug? thanks. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Michael Schuerig
2006-Nov-09 17:39 UTC
Re: Local Variables vs. Instance Variables inside breakpointer
On Thursday 09 November 2006 17:14, Wiliam Langshaw wrote:> Did you make any further progress on this w/o having to resort to > ruby-debug?breakpoint(er) relies on Binding.of_caller which was broken by Ruby 1.8.5. Without this method, there''s no (easy, fast) way to access the local variables of the caller. Michael -- Michael Schuerig mailto:michael-q5aiKMLteq4b1SvskN2V4Q@public.gmane.org http://www.schuerig.de/michael/ --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---