Trace a particular record with dbg:fun2ms

Kaiduan Xie kaiduanx@REDACTED
Thu Jul 9 06:25:06 CEST 2009


Hi,

Suppose I have a function which takes a record Person as parameter,
how to write the fun2ms() to trace the call for a particular value?

-record(person, {firstname, lastname}).

test(Person) ->

...

For example, I would like to trace the call where the firstname is
erlanger, how to write fun2ms?

I tried as below,

6> dbg:fun2ms(fun(#person{firstname = F, lastname = L}) when F ==
"erlanger" -> true end).
Error: dbg:fun2ms requires fun with single variable or list parameter
{error,transform_error}
7>

Thanks,

kaiduan


More information about the erlang-questions mailing list