Ehelper (Ehelper v0.2.7)

View Source

Elixir helpers

Summary

Functions

app()

app_of(mod \\ __MODULE__)

See Ehelper.App.get_app/1.

as_pid(pid)

dbg_backend()

Get current dbg backend

iex --dbg pry config :elixir, :dbg_callback, {MyMod, :debug_fun, [:stdio]} Application.put_env(:elixir, :dbg_callback, {Macro, :dbg, []}) if config.pry do Application.put_env(:elixir, :dbg_callback, {IEx.Pry, :dbg, []}) end

dbg_demo(url \\ "https://httpbin.org")

Test by by dbg with pry

  • $> iex -S mix

  • iex> break! H, :dbg_demo, 0

  • iex> H.dbg_demo # n to next

  • iex> break! URI, :parse, 1

  • iex> break! URI, :parse, 1

or break! URI.parse/1 or break! URI.parse("https" <> , )

  • iex> H.dbg_demo Break reached: URI.parse/1 (/home/runner/work/elixir/elixir/lib/elixir/lib/uri.ex:792)

hi()

Hi test

i()

info()

load_json!(file)

pid_from(pid)

ping()

Ping-pong test

pp(info, opts \\ [])

pretty_number(n)

pry()

try dbg pry

iex -S mix test test/lab/func_test.exs:5 --trace

debugging

#iex> 123 |> dbg(base: :binary) #iex> # 123 #=> 0b1111011

pstate(pid)

start!(app \\ :ehelper)

sup()

to_pid(pid)