
Invoke the program from the debugger as a traditional debuggers (rdbg) info locals # And you can see the updated local variables = > 8 | binding.break # Again the program stops here (rdbg) info locals # You can show local variables = > 5 | binding.break # Now you can see it stops at this line $ ruby target.rb # Run the program normally. The following example shows the demonstration of binding.break. You can also use its 2 aliases in the same way:Īfter that, run the program as usual and you will enter the debug console at breakpoints you inserted. If you can modify the source code, you can use the debugger by adding require 'debug' at the top of your program and putting binding.break method into lines where you want to stop as breakpoints like binding.pry and binding.irb. Modify source code with binding.break (similar to binding.pry or binding.irb) There are several options for (1) and (2).

catch Exception to set a breakpoint that'll be triggered when Exception is raised). move to the another line with step, to the next line with next). info to see information about the current frame). At the breakpoint, enter the debugger console.To use a debugger, roughly you will do the following steps:
#Script debugger run on the main thread how to
(The version constraint is important debug < 1.0.0 is an older,Ībandoned gem that is completely different from this product.) HOW TO USE
