[erlang-questions] tracing very large terms

Joe Armstrong erlang@REDACTED
Mon Sep 26 19:44:30 CEST 2011


On Mon, Sep 26, 2011 at 6:47 PM, Daniel Goertzen
<daniel.goertzen@REDACTED> wrote:
> I am struggling to debug functions that reference very large terms
> (thousands of lines to print).  Crash reports and trace outputs are huge and
> finding the interesting bits is hard.  This isn't a trace pattern problem;
> actual number of trace outputs is maybe a dozen or so.
> Just wondering what others do to manage this situation.  I've looked for a
> text editor that can do parenthesis folding, but no luck so far.  Ideas?

I just pretty print the the term(s) to a file then fire up emacs :-)

dump(File, Term) ->
    io:format("** dumping to ~s~n",[File]),
    {ok, S} = file:open(File, [write]),
    io:format(S, "~p.~n",[Term]),
    file:close(S).

/Joe


> Dan.
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions
>
>



More information about the erlang-questions mailing list