<p>The parse transform is already written for you, see <a href="http://www.erlang.org/documentation/doc-5.2/lib/stdlib-1.11.0/doc/html/ms_transform.html">http://www.erlang.org/documentation/doc-5.2/lib/stdlib-1.11.0/doc/html/ms_transform.html</a></p>
<p>/Kenneth , Erlang/OTP Ericsson</p>
<div class="gmail_quote">Den 6 nov 2012 15:33 skrev "Attila Rajmund Nohl" <<a href="mailto:attila.r.nohl@gmail.com">attila.r.nohl@gmail.com</a>>:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hello!<br>
<br>
I can trace a function call with specific arguments with a command like this:<br>
<br>
dbg:tpl(foo, bar, dbg:fun2ms(fun([baz,_]) -> return_trace(),<br>
exception_trace() end)).<br>
<br>
However, it's a long to type, I'd like to have a wrapper around it.<br>
The naive solution doesn't even compile:<br>
<br>
-module(d).<br>
<br>
-export([mfa/3]).<br>
<br>
mfa(M, F, A) -><br>
dbg:tpl(M, F, dbg:fun2ms(fun(Args) when Args==A -> return_trace(),<br>
exception_trace() end)).<br>
<br>
because there are no return_trace() and exception_trace() functions in<br>
the module. Even if it'd compile, I couldn't call it like this:<br>
<br>
d:mfa(foo, bar, [baz, _]).<br>
<br>
because the _ variable is not bound. Is there a simple workaround or<br>
shall I start to read up on parse_transforms?<br>
_______________________________________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br>
<a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
</blockquote></div>