[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

ruby-debug vs. breakpoint

TomRossi7

8/20/2007 9:22:00 PM

Okay, so it looks like getting the ole "breakpoint" working isn't
going to happen. Everyone seems to just push for making the switch
over to "ruby-debug". I've decided to go with the flow, but have to
say that I feel like I'm giving up a lot. The nice thing about a
breakpoint was it dropped you into the IRB where you could interact
with your code by entering in code that is immediately executed
bringing back the results. With ruby-debug, this doesn't seem
possible. Why aren't more people upset about the switch? Am I
missing something?

Thanks,
Tom

3 Answers

Martin Krauskopf

8/21/2007 12:12:00 PM

0

James Gray

8/21/2007 3:17:00 PM

0

On Aug 20, 2007, at 4:25 PM, TomRossi7 wrote:

> Okay, so it looks like getting the ole "breakpoint" working isn't
> going to happen. Everyone seems to just push for making the switch
> over to "ruby-debug". I've decided to go with the flow, but have to
> say that I feel like I'm giving up a lot. The nice thing about a
> breakpoint was it dropped you into the IRB where you could interact
> with your code by entering in code that is immediately executed
> bringing back the results. With ruby-debug, this doesn't seem
> possible. Why aren't more people upset about the switch? Am I
> missing something?

You can type irb at a ruby-debug prompt to drop into a breakpoint
style session.

James Edward Gray II


Tom M

8/21/2007 3:22:00 PM

0

On Aug 21, 8:11 am, Martin Krauskopf <martin.krausk...@sun.com> wrote:
> TomRossi7 wrote:
> > Okay, so it looks like getting the ole "breakpoint" working isn't
> > going to happen. Everyone seems to just push for making the switch
> > over to "ruby-debug". I've decided to go with the flow, but have to
> > say that I feel like I'm giving up a lot. The nice thing about a
> > breakpoint was it dropped you into the IRB where you could interact
> > with your code by entering in code that is immediately executed
> > bringing back the results. With ruby-debug, this doesn't seem
> > possible. Why aren't more people upset about the switch? Am I
> > missing something?
>
> Just require 'ruby-debug' and you have the same functionality as you had
> with breakpoint library.
>
> You might use either 'debugger' call or old 'breakpoint' call (aliased
> since ruby-debug 0.9.3) in your code.
>
> If you do not want to write 'eval <expr>' (or just 'e <expr>') you might
> you 'set autoeval'. Then just write <expr> in your code and it is
> evaluated automatically.
>
> breakpointer was deprecated also in Rails:
>
> http://debug-commons.rubyforge.org/misc/ruby-debugging.html#br...
>
> Regards,
> m.


One thing that I've found is that you can't use rdebug in a test/unit
test. If the breakpoint is in a class that is invoked within an
assertion, it's caught. I toyed with implementing a tool to allow me
to break within a unit test, but wasn't sure it would be worth the
work.