ruby-debug vs. breakpoint

T

TomRossi7

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
 
M

Martin Krauskopf

TomRossi7 said:
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#breakpointer

Regards,
m.
 
J

James Edward Gray II

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
 
T

thomas.macklin

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#breakpointer

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top