Using ‘IEx.pry’ lets you block an operation and access its bindings. Unlike pdb
and pry
in Ruby, it’s not a full-fledged debugger but it’s a quick way to look into your execution.
Running the above code in iex will now block at the specified line. You can continue with respawn
.
An alternative method of debugging which gives you a full fledged debugger is to use the Erlang :debugger
.
After we call our function, we can see our process with break status in the debugger. We can add a new breakpoint in the monitor window, inspect the code, see the variables and navigate it in steps.
Additional reading: