dbg match spec
Ulf Wiger (AL/EAB)
ulf.wiger@REDACTED
Mon Oct 3 13:09:36 CEST 2005
Sorry Chandru, I can't figure it out either.
/Uffe
> -----Original Message-----
> From: owner-erlang-questions@REDACTED
> [mailto:owner-erlang-questions@REDACTED]On Behalf Of chandru
> Sent: den 3 oktober 2005 12:19
> To: erlang-questions@REDACTED
> Subject: dbg match spec
>
>
> Hi,
>
> If I had code like this:
>
> -module(dbg_test).
> -export([test/1]).
>
> test(N) when integer(N) ->
> io:format("Integer -> ~p~n", [N]);
> test({'A', X, Y}) ->
> io:format("A: X -> ~p, Y -> ~p~n", [X,Y]);
> test(L) ->
> io:format("L -> ~p~n", [L]).
>
> how would I write a dbg command to print out a trace when the second
> clause is matched?
>
> I've tried:
>
> dbg:tpl(dbg_test, test, 1,
> [{'$1',[{'==',{element,1,'$$'},'A'}],[call]}]).
>
> but it doesn't work. whereas this does:
>
> dbg:tpl(dbg_test, test, 1, [{'_',[],[call]}]).
>
> but it is not quite what I want...I want to single out the
> second clause.
>
> cheers
> Chandru
>
More information about the erlang-questions
mailing list