I successfully started a dubugging session using the "breakpoint()" function and "script/breakpointer". Anyway I didn''t find the way to do anything else: see the stack frame, set new breakpoints. Every command I tried gives me "undefined local variable or method <mycommand>". Where can I find a list of commands? I tried http://www.ruby-doc.org/docs/ProgrammingRuby/html/irb.html and http://www.ruby-doc.org/docs/ProgrammingRuby/html/trouble.html but none of the commands work! And: is there any visual debugger I could use?
On 27-sep-2005, at 14:11, Leonardo Francalanci wrote:> I successfully started a dubugging session using the "breakpoint()" > function and "script/breakpointer". Anyway I didn''t find the way to > do anything else: see the stack frame, set new breakpoints. Every > command I tried gives me "undefined local variable or method > <mycommand>". Where can I find a list of commands? I tried http:// > www.ruby-doc.org/docs/ProgrammingRuby/html/irb.html and http:// > www.ruby-doc.org/docs/ProgrammingRuby/html/trouble.html but none of > the commands work! > And: is there any visual debugger I could use?try just typing "methods". -- Julian "Julik" Tarkhanov
> try just typing "methods".Done. Looks like it prints the list of methods I can call. But: what if I want to see the stack? What if I want to step ahead? In other words: are there some docs about it????
On 9/27/05, Leonardo Francalanci <Leonardo.Francalanci-C8ozdTPzUPZl57MIdRCFDg@public.gmane.org> wrote:> But: what if I want to see the stack? What if I want to step ahead? In > other words: are there some docs about it????The docs I''ve come across have been a bit dodgy. But, here''s what''s worked for me: I tend to use the breakpointer script by setting a breakpoint at the beginning of a problem method and issuing each successive line of code individually at the irb prompt. This gives you instant feedback when a line succeeds or fails and if it fails, the chance to revise and reissue the syntax while keeping the context of the previous successful commands. HTH, Stephen Caudill
[stupid gmail hiding the subject line! sorry for the dupe] I asked myself this question today while debugging a test. How the heck do I connect to a breakpointer session from a unit test? Stephen''s suggestion is a good workaround (type successive lines), but I haven''t heard anyone address the question: how do you get a REAL Ruby debugging session going in a Rails test! Breakpoint during a test drops you into an IRB session -- not a DRB debugger session!!! The breakpointer session just sits there. Don''t get me wrong, I''ve been finding IRB incredibly useful in my unit tests when I can''t figure out a failure just by looking at the code, but the question remains, how to debug? I agree that the documentation on Rails debugging is *dodgy*. Obie Fernandez> ---------- Forwarded message ---------- > From: Stephen Caudill <scaudill-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > To: rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > Date: Tue, 27 Sep 2005 13:28:54 -0400 > Subject: Re: [Rails] debugging: how? > On 9/27/05, Leonardo Francalanci <Leonardo.Francalanci-C8ozdTPzUPZl57MIdRCFDg@public.gmane.org> wrote: > > > But: what if I want to see the stack? What if I want to step ahead? In > > other words: are there some docs about it???? > > The docs I''ve come across have been a bit dodgy. But, here''s what''s > worked for me: > > I tend to use the breakpointer script by setting a breakpoint at the > beginning of a problem method and issuing each successive line of code > individually at the irb prompt. This gives you instant feedback when > a line succeeds or fails and if it fails, the chance to revise and > reissue the syntax while keeping the context of the previous > successful commands. > > HTH, > Stephen Caudill >
It''s not free, but Arachno Ruby allows you to set breakpoints at which stage you can inspect the stack and step through your code. Freeride (a free Ruby editor) also has some basic similar features though i haven''t gotten it to work. On 9/27/05, Obie Fernandez <obiefernandez-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > [stupid gmail hiding the subject line! sorry for the dupe] > > I asked myself this question today while debugging a test. How the > heck do I connect to a breakpointer session from a unit test? > > Stephen''s suggestion is a good workaround (type successive lines), but > I haven''t heard anyone address the question: how do you get a REAL > Ruby debugging session going in a Rails test! Breakpoint during a > test drops you into an IRB session -- not a DRB debugger session!!! > The breakpointer session just sits there. > > Don''t get me wrong, I''ve been finding IRB incredibly useful in my unit > tests when I can''t figure out a failure just by looking at the code, > but the question remains, how to debug? > > I agree that the documentation on Rails debugging is *dodgy*. > > Obie Fernandez > > > ---------- Forwarded message ---------- > > From: Stephen Caudill <scaudill-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > > To: rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > Date: Tue, 27 Sep 2005 13:28:54 -0400 > > Subject: Re: [Rails] debugging: how? > > On 9/27/05, Leonardo Francalanci <Leonardo.Francalanci-C8ozdTPzUPZl57MIdRCFDg@public.gmane.org> > wrote: > > > > > But: what if I want to see the stack? What if I want to step ahead? In > > > other words: are there some docs about it???? > > > > The docs I''ve come across have been a bit dodgy. But, here''s what''s > > worked for me: > > > > I tend to use the breakpointer script by setting a breakpoint at the > > beginning of a problem method and issuing each successive line of code > > individually at the irb prompt. This gives you instant feedback when > > a line succeeds or fails and if it fails, the chance to revise and > > reissue the syntax while keeping the context of the previous > > successful commands. > > > > HTH, > > Stephen Caudill > > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-- "Impossible is nothing." _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
Whoops, I aske the wrong question. But before getting off on that tangent, it isn''t enough to add that BREAKPOINT_SERVER_PORT constant. You also have to invoke Breakpointer.activate_drb somewhere in your codebase. Then you can do the remote window IRB debugging -- but it doesn''t really make sense in the context of running a unit test. So keeping in mind that Breakpointer is that special IRB session used for debugging, what I was wondering is how to get an *actual Ruby Debugger session* going -- haven''t tried, but I''m guessing would involve using ''-r debug'' opts on the ruby cmdline. Meaning I would probably have to hack a new version of testrb together. [shrug] Obie On 9/28/05, Alexey Verkhovsky <alex-vV7tgcE2N9Nhl2p70BpVqQ@public.gmane.org> wrote:> Obie Fernandez wrote: > > >I asked myself this question today while debugging a test. How the > >heck do I connect to a breakpointer session from a unit test? > > > > > Add this to environment/test.rb : > > # The breakpoint server port that script/breakpointer connects to. > BREAKPOINT_SERVER_PORT = 42531 > > I wonder why the heck do you need to connect to a remote breakpointer, > when you can have an IRB session right there in the console? :) > > Alex > >
> I tend to use the breakpointer script by setting a breakpoint at the > beginning of a problem method and issuing each successive line of code > individually at the irb prompt.What?? Isn''t there any other methods? What if I want to see the stack, get into a method... It''s weird, nobody ever debugs the code without an IDE?
In article <433A5549.3020804-pXB0QmfWWqll57MIdRCFDg@public.gmane.org>, Leonardo.Francalanci- pXB0QmfWWqll57MIdRCFDg-XMD5yJDbdMReXY1tMh2IBg@public.gmane.org says...> > What?? Isn''t there any other methods? What if I want to see the stack, > get into a method... It''s weird, nobody ever debugs the code without an IDE?I came to the same conclusion... Ruby apparently has no innate debugging ability, but debug.rb provides some very limited ability through reflection. There needs to be some debugging ability with rails, preferably even better than debug.rb... I had a better debugger on a PL/I minicomputer from 1990. This is one of Rails''s weak spots, and when I get good enough, I intend to contribute something if nobody gets there first. -- Jay Levitt | Wellesley, MA | I feel calm. I feel ready. I can only Faster: jay at jay dot fm | conclude that''s because I don''t have a http://www.jay.fm | full grasp of the situation. - Mark Adler
> Ruby apparently has no innate debuggingThat''s a wrong conclusion. Look at Chapter 13 in the Pickaxe book.
In article <8bf5109305092812483bd46324-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>, obiefernandez- Re5JQEeQqe8AvxtiuMwx3w-XMD5yJDbdMReXY1tMh2IBg@public.gmane.org says...> > Ruby apparently has no innate debugging > > That''s a wrong conclusion. Look at Chapter 13 in the Pickaxe book.I said "innate". If your app has to explicitly include the debugger module, it ain''t innate. BASIC had a debugger too, if part of your BASIC program was a debugger... -- Jay Levitt | Wellesley, MA | I feel calm. I feel ready. I can only Faster: jay at jay dot fm | conclude that''s because I don''t have a http://www.jay.fm | full grasp of the situation. - Mark Adler
Jay Levitt wrote:> In article <433A5549.3020804-pXB0QmfWWqll57MIdRCFDg@public.gmane.org>, Leonardo.Francalanci- > pXB0QmfWWqll57MIdRCFDg-XMD5yJDbdMReXY1tMh2IBg@public.gmane.org says... > >>What?? Isn''t there any other methods? What if I want to see the stack, >>get into a method... It''s weird, nobody ever debugs the code without an IDE? > > > I came to the same conclusion... Ruby apparently has no innate debugging > ability, but debug.rb provides some very limited ability through > reflection. There needs to be some debugging ability with rails, > preferably even better than debug.rb... I had a better debugger on a > PL/I minicomputer from 1990. > > This is one of Rails''s weak spots, and when I get good enough, I intend > to contribute something if nobody gets there first. ><ahem> commercial announcement ahead ActiveState will be shipping Ruby support in the next release of Komodo, which includes a visual debugger that will let you debug rails apps. So far it only works by starting the webrick server inside the IDE, and it is slower than running webrick from the command-line. But you''ll get to see complex structures, change fields on the fly, set breakpoints by clicking on a line, and probably those other features you had on that 15-year-old PL/I system. -- Eric Promislow <ericp-0OmgUqZ5G+O9C01uVemLPA@public.gmane.org>
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Sep 28, 2005, at 5:09 PM, Eric Promislow wrote:> Jay Levitt wrote: >> In article <433A5549.3020804-pXB0QmfWWqll57MIdRCFDg@public.gmane.org>, Leonardo.Francalanci- >> pXB0QmfWWqll57MIdRCFDg-XMD5yJDbdMReXY1tMh2IBg@public.gmane.org says... >>> What?? Isn''t there any other methods? What if I want to see the >>> stack, get into a method... It''s weird, nobody ever debugs the >>> code without an IDE? >> I came to the same conclusion... Ruby apparently has no innate >> debugging ability, but debug.rb provides some very limited ability >> through reflection. There needs to be some debugging ability with >> rails, preferably even better than debug.rb... I had a better >> debugger on a PL/I minicomputer from 1990. This is one of Rails''s >> weak spots, and when I get good enough, I intend to contribute >> something if nobody gets there first. > > <ahem> commercial announcement ahead > > ActiveState will be shipping Ruby support in the next release of > Komodo, which > includes a visual debugger that will let you debug rails apps. So > far it > only works by starting the webrick server inside the IDE, and it is > slower than > running webrick from the command-line. But you''ll get to see > complex structures, > change fields on the fly, set breakpoints by clicking on a line, > and probably > those other features you had on that 15-year-old PL/I system.That''s great news, Eric. Is there a URL where we can find out more about ActiveState''s plans for Ruby and for Rails in particular? What platforms will be supported? Regards, jeremy -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2 (Darwin) iD8DBQFDOz5yAQHALep9HFYRAr4DAKDdSRbrEh6ALMIVkTJyzMCIwyX1zACg0KGY 11D8022KbD9j9vfdbMflB2w=QsMG -----END PGP SIGNATURE-----
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Sep 28, 2005, at 6:07 PM, Jeremy Kemper wrote:> On Sep 28, 2005, at 5:09 PM, Eric Promislow wrote: >> <ahem> commercial announcement ahead > > That''s great news, Eric. Is there a URL where we can find out more > about ActiveState''s plans for Ruby and for Rails in particular? > What platforms will be supported?My bad: http://blogs.activestate.com/ericp/2005/08/rails_debugging.html :) jeremy -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2 (Darwin) iD8DBQFDOz8bAQHALep9HFYRAqx0AJ9ALaPG4SG0HdzbjXC/TpGSI4KCUACfVniH 3tGerS6RMwb3CXhUdF53s0k=yQ8l -----END PGP SIGNATURE-----
* Jeremy Kemper <jeremy-w7CzD/W5Ocjk1uMJSBkQmQ@public.gmane.org> [2005-09-28 18:07:59 -0700]:> That''s great news, Eric. Is there a URL where we can find out more > about ActiveState''s plans for Ruby and for Rails in particular? What > platforms will be supported?What about Arachno''s IDE? It sounds like it will do pretty much the same thing and sounds as if it''s in a similar boat -- only does local debugging right now but remote debugging is planned for real-soon-now. Just my $0,02 worth as I''ve never used either ActiveState products or the above mentioned Arachno..
In article <20050929012818.GB29218-IqaenA5YbrbBqV1GO06z+tBPR1lH4CV8@public.gmane.org>, rickf- gqmXzWjnWO954TAoqtyWWQ-XMD5yJDbdMReXY1tMh2IBg@public.gmane.org says...> What about Arachno''s IDE? It sounds like it will do pretty much the > same thing and sounds as if it''s in a similar boat -- only does local > debugging right now but remote debugging is planned for real-soon-now.I tried Arachno a few months ago, but it was buggy, unstable, and very incomplete. Lothar seems like he''s got a lot of great ideas, but a one-author IDE seems like wishful thinking; a look at the Scriptolutions web site shows more completed box designs than code, so I decided not to hold my breath. Obviously, I wish him the best of luck, and would love to see Arachno progress further - especially as it''s the only platform with fast debugging! Eclipse with RDT is doing nicely - they just released 0.6 - and I love the Test::Unit, HTML, ri, and CVS/SVN integration, as well as the awesome three-way diff interface. But RIDE just released 1.0, and ActiveState sounds like it could really give RDT a run for the money! This could be an exciting quarter for IDEs. -- Jay Levitt | Wellesley, MA | I feel calm. I feel ready. I can only Faster: jay at jay dot fm | conclude that''s because I don''t have a http://www.jay.fm | full grasp of the situation. - Mark Adler
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Sep 28, 2005, at 6:28 PM, Rick F. wrote:> * Jeremy Kemper <jeremy-w7CzD/W5Ocjk1uMJSBkQmQ@public.gmane.org> [2005-09-28 18:07:59 -0700]: >> That''s great news, Eric. Is there a URL where we can find out more >> about ActiveState''s plans for Ruby and for Rails in particular? What >> platforms will be supported? > > What about Arachno''s IDE? It sounds like it will do pretty much the > same thing and sounds as if it''s in a similar boat -- only does local > debugging right now but remote debugging is planned for real-soon-now.Unfortunately a Yugo and a Ferrari also do pretty much the same thing. jeremy -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2 (Darwin) iD8DBQFDO0qkAQHALep9HFYRAowFAKDFMjazVwfU9vbrJ34I+7Ac+lRRsACdEHjJ TRjQgnpB5+w8iheTokDMWbs=ZwK+ -----END PGP SIGNATURE-----
On 9/28/05, Jay Levitt <jay-news-WxwZQdyI2t0@public.gmane.org> wrote:> > Eclipse with RDT is doing nicely - they just released 0.6 - and I love > the Test::Unit, HTML, ri, and CVS/SVN integration, as well as the > awesome three-way diff interface. But RIDE just released 1.0, and > ActiveState sounds like it could really give RDT a run for the money! > This could be an exciting quarter for IDEs.Hi Jay, I tried Eclipse briefly and went back to the Arachno demo when I didn''t see a multi-file search/replace feature. I was very surprised to find this very essential feature missing in Eclipse. Did I overlook it or is it really missing? _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
Hammed Malik wrote:> On 9/28/05, *Jay Levitt* <jay-news-WxwZQdyI2t0@public.gmane.org <mailto:jay-news-WxwZQdyI2t0@public.gmane.org>> wrote: > > > Eclipse with RDT is doing nicely - they just released 0.6 - and I love > the Test::Unit, HTML, ri, and CVS/SVN integration, as well as the > awesome three-way diff interface. But RIDE just released 1.0, and > ActiveState sounds like it could really give RDT a run for the money! > This could be an exciting quarter for IDEs. > > > Hi Jay, > > I tried Eclipse briefly and went back to the Arachno demo when I > didn''t see a multi-file search/replace feature. I was very surprised > to find this very essential feature missing in Eclipse. Did I overlook > it or is it really missing?Oh, it''s very much there. Search (Ctrl-H) has a Replace button. Besides, you can do the multiple file search, select a number of files in the search results window, right-click and say Replace selected... Alex
Till you don''t have a visual debugger, there is a constraint with greater immediacy for keeping methods short. Enough to be easily *testable* and if necessary debugable with Breakpoint. Visual debugger will only give you an illusion of control. In the end you''ll become confused over large methods, setting breakpoints here and there with mouse clicks, inspecting variables and generally waisting time. Keep those methods short, ensure proper automated test coverage and stay happy! my 0.02$, Zsombor Company - http://primalgrasp.com Thoughts - http://deezsombor.blogspot.com
> Visual debugger will only give you an illusion of control.I''m not asking for a visual debugger: I asked for commands to use in the breakpointer. I can''t even see the stack!!! I don''t think you can''t even call it debugging if you just stop somewhere in your code and can''t do anything else!!!
> I''m not asking for a visual debugger: I asked for commands to use in the breakpointer. I can''t even see the stack!!! I don''t think you can''t even call it debugging if you just stop somewhere in your code and can''t do anything else!!!#see the stack puts caller #local variable names local_variables #see obj value obj #set obj value obj = something #also interesting obj.call_some_method #instance variable names instance_variables HTH, Zsombor -- Company - http://primalgrasp.com Thoughts - http://deezsombor.blogspot.com
Ok: but is there a list of commands somewhere???> #see the stack > puts caller > > #local variable names > local_variables > > #see obj value > obj > > #set obj value > obj = something > > #also interesting > obj.call_some_method > > #instance variable names > instance_variables > > HTH, > Zsombor >
In article <433BDFFE.90301-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>, dee.zsombor- Re5JQEeQqe8AvxtiuMwx3w-XMD5yJDbdMReXY1tMh2IBg@public.gmane.org says...> > I''m not asking for a visual debugger: I asked for commands to use in the breakpointer. I can''t even see the stack!!! I don''t think you can''t even call it debugging if you just stop somewhere in your code and can''t do anything else!!! > > #see the stack > puts callerGreat. How about step in/over/around? How about change context to another frame? Show the current source line? Set new breakpoints? Conditional breakpoints, with code that can execute on each hit? Watchpoints? There''s a lot more to debugging than displaying data. And we haven''t even mentioned multi-process debugging to examine race conditions yet. -- Jay Levitt | Wellesley, MA | I feel calm. I feel ready. I can only Faster: jay at jay dot fm | conclude that''s because I don''t have a http://www.jay.fm | full grasp of the situation. - Mark Adler