[erlang-questions] Erlang tracing

Lukas Larsson lukas@REDACTED
Mon Sep 21 14:11:55 CEST 2015


On Mon, Sep 21, 2015 at 1:25 PM, Magnus Henoch <magnus@REDACTED>
wrote:

> I had a vaguely related idea the other day.  When you trace a function
> that takes an anonymous function as an argument, it's printed like this:
>
> 8> lists:all(foo:foo(3), [1, 2]).
> (<0.33.0>) call lists:all(#Fun<foo.0.99124727>,[1,2])
> (<0.33.0>) returned from lists:all/2 -> false
>
> That tells you that anonymous function number 0 in module foo is passed as
> an argument.  It would be convenient to have the 0 be the line number where
> the anonymous function is defined instead, so you can quickly figure out
> exactly which function is being passed, in case your module creates several
> different ones.
>
>
That is more of a formatting thing, as io:format does the same thing. I'll
try to keep it in mind though. Adding {line,No} tuple to the return of
erlang:fun_info should be simple enough and from there io_lib:format can do
what it wants. Just hope we don't step on any backwards compatibility toes.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20150921/f92d4c48/attachment.htm>


More information about the erlang-questions mailing list