Tracing Erlang Functions - Short forms
        Posted  
        
            by Roberto Aloi
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by Roberto Aloi
        
        
        
        Published on 2010-03-12T13:18:10Z
        Indexed on 
            2010/03/12
            13:37 UTC
        
        
        Read the original article
        Hit count: 311
        
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?
© Stack Overflow or respective owner