Tracing Erlang Functions - Short forms
- by Roberto Aloi
As you might know, it's now possible to trace Erlang functions by using the short form:
dbg:tpl(Module, Function, x).
Instead of the usual:
dbg:tpl(Module, Function, dbg:fun2ms(fun(_) -> exception_trace() end)).
I'm actually wondering if a similar short form is available for return_trace(). Something like:
dbg:tpl(Module, Function, r).
Instead of:
dbg:tpl(Module, Function, dbg:fun2ms(fun(_) -> return_trace() end)).
The source code in the dbg module seems to suggest not:
new_pattern_table() ->
PT = ets:new(dbg_tab, [ordered_set, public]),
ets:insert(PT,
{x,
term_to_binary([{'_',[],[{exception_trace}]}])}),
ets:insert(PT,
{exception_trace,
term_to_binary(x)}),
PT.
But I might be wrong. Do you know of any?