Skip to content

Instantly share code, notes, and snippets.

@binarytemple-clients
Created March 28, 2016 12:13
Show Gist options
  • Save binarytemple-clients/ce8133f2adeb4e793235 to your computer and use it in GitHub Desktop.
Save binarytemple-clients/ce8133f2adeb4e793235 to your computer and use it in GitHub Desktop.
    iex(4)> Application.start(:dbg)
    {:error, {:not_started, :runtime_tools}}
    iex(5)> Application.start(:runtime_tools)
    :ok
    iex(6)> Application.start(:dbg)
    :ok
    iex(7)> Dbg.trace(:send)
    %{counts: %{nonode@nohost: 1}, errors: %{}}
iex(8)>
** (Dbg) #PID<0.493.0> sends to #PID<0.26.0>:
    {:io_request, #PID<0.493.0>, #Reference<0.0.3.1680>, {:get_geometry, :columns}}
iex(8)>
** (Dbg) #PID<0.493.0> sends to #PID<0.26.0>:
    {:io_request, #PID<0.493.0>, #Reference<0.0.3.1681>, {:put_chars, :unicode, "\e[33m%{counts: %{nonode@nohost: 1}, errors: %{}}\e[0m\n"}}
iex(8)>
** (Dbg) #PID<0.493.0> sends to #PID<0.27.0>:
    {:evaled, #PID<0.493.0>, %IEx.State{cache: [], counter: 8, prefix: "iex"}}

Dbg.clear()

** (Dbg) unknown event:
    {:trace, #PID<0.493.0>, :send, {:code_call, #PID<0.493.0>, {:ensure_loaded, Dbg}}, :code_server}
%{counts: %{nonode@nohost: 1}, errors: %{}}

** (Dbg) #PID<0.493.0> sends to #PID<0.511.0>:
    {#PID<0.493.0>, {:p, #PID<0.493.0>, [:clear]}}
iex(10)>
nil

Working with tracing all methods in a module -

Dbg.clear
%{counts: %{nonode@nohost: 1}, errors: %{}}
iex(85)> Dbg.flush
:ok
iex(86)> Dbg.reset
:ok
iex(87)> Dbg.call(Map)
%{counts: %{nonode@nohost: 34}, errors: %{}}
iex(88)> Map.new
%{}
iex(89)> Dbg.trace([:call, :return_to])
%{counts: %{nonode@nohost: 1}, errors: %{}}

iex(91)> Map.new

** (Dbg) #PID<0.493.0> calls Map.__info__/1 with arguments:
    [:macros]

** (Dbg) #PID<0.493.0> calls Map.new/0 with arguments:
    []
%{}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment