Friday, March 02, 2007

Ruby's broken breakpoint workaround

I was messing around with different installations of ruby, and I was aghast when breakpoint stopped working. Having a debugger for imperative programing is one of the fundamental tools in a programmer's tool box. Well, one option is to use the ruby-debug gem, which I have yet to try out.

But I did find that it was because Binding.of_caller() was rewritten (or something) for 1.8.5. In any case, something changed. So if you want a breakpoint and it was broken somehow, try this:

Breakpoint.breakpoint(nil, binding)

No comments:

Post a Comment