How to exit the debugger without leaving the IRB session?

This is a long-standing source of frustration, but maybe I'm missing something. If I am in the middle of debugging and I want to exit the debugger and return to the IRB or the Rails Console, quit will not work since it will exit the IRB. "finish" also seems to have the same effect as later on. Using “delete” to delete breakpoints, and then trying to “continue” or “complete” does not work.

Any ideas?

+5
source share
2 answers

This SO question has some good suggestions. This applies in particular to debugging inside loops. One of the best solutions is to set a breakpoint outside the loop, then use irb to set it inside the loop and clean it manually whenever you want.

It basically boils down to a little thought about where you set breakpoints.

In addition, you can not do anything.

+2
source

At least in beebug you can do this:

eval return

Which has the pure effect of evaluating the return statement from the current function. This works sometimes, depending on how the call stack looks.

, .... , , , .

:

byebug unless $continue

, ,

$continue = true
c

.

+2

All Articles