16
votes

I want to use IEx.pry to go step by step in my elixir code, like byebug in ruby or debug point in Java. I tried looking into the documentation here : https://github.com/elixir-lang/elixir/blob/4f68c4f10502e0f54a21093bb9a33957e63a9ac4/lib/iex/lib/iex.ex but did not find anything. Could anyone suggest a way to do this ?

3
Maybe you will find this useful: github.com/qhool/quaff - Patrick Oscity
@PatrickOscity, I usually work on a remote machine. Is there a way to run the quaff tool in command line only ? - VoodooChild
@VoodooChild: You can use ssh -Y when you ssh into your remote machine so any window will be redirected to your host machine. - Batou99

3 Answers

13
votes

It is not possible as pry is not a debugger. Pry simply allows you to interact with a particular context.

1
votes

I was hoping for a way to step through Elixir code via IEx.pry as well, but that's not possible. Erlang does have a debugger that you can use for Elixir code.

You can start the debugger by running: :debugger.start()

I learned about it here: http://blog.plataformatec.com.br/2016/04/debugging-techniques-in-elixir-lang/

1
votes

You can add multiple IEx.pry instructions, inspect and use continue to go to the next one