Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Elixir `dbg` lets you inspect every step of a pipeline, set breakpoints (twitter.com/whatyouhide)
28 points by burntcaramel on July 19, 2022 | hide | past | favorite | 3 comments


I'm excited about this. The elixir debugging options have been a bit confusing to me. pry isn't really debugging, it's just a breakpoint with no ability to step through. The "debugger" recommended in the docs (:debugger.start()) is an ugly GUI application that pops out of the window. I really would like something better than IO.inspect/IO.puts (basically printf debugging), something like a regular command line debugger. As a newbee to elixir/phoenix this has been a gaping hole.


Are you aware of iex sessions (the repl)? If you start your elixir application via iex, you have a repl available alongside your running application. e.g. iex -S mix phx.server


Yes, definitely.

I've just been very confused once I am in there how to run a proper debugger. All those commands (:debugger.start()) "work" but they don't provide me with a step debugger that I'm used to (or at least don't make it obvious).

Do you use them in that way?

I just tried again to use :debugger.start() from within my IEx session, and couldn't figure out how to even load up the source code. Seems like it operates more at the erlang VM level and not at the Elixir/Phoenix level? And, pry/break seems nice, but does not let me step through, only set a breakpoint and then inspect the state then and there.

The REPL is amazing, I don't mean to downplay it!

But, I've yet to find a simple debugger for Phoenix applications, am I missing it?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: