Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Trace multiple functions using redbug from command line

Tags:

erlang

When tracing function calls using redbug from an Erlang shell, I can trace multiple functions at the same time by passing a list of strings to redbug:start:

redbug:start(["foo:bar -> return", "bar:baz -> return"], []).

Using redbug from the command line, I can trace a single function without problems:

redbug -setcookie s3cret mynode@localhost "foo:bar->return"

But I can't seem to find a way to trace multiple functions from the command line. Is that possible? If so, how?

like image 644
legoscia Avatar asked Nov 21 '25 22:11

legoscia


1 Answers

./priv/bin/redbug -setcookie s3cret mynode@localhost '"foo:bar->return","foo:baz->return"'

or

 ./priv/bin/redbug -setcookie s3cret mynode@localhost '["foo:bar->return","foo:baz->return"]'

You can pass comma separated list of strings, but you can't use spaces. Redbug internally surrounds input with "[" and "]" and then tries to parse that expression with erl_scan and erl_parse. If it fails, then it passes unparsed string (that is why syntax for one function is easy). If it succeeds, it calls:

redbug:start(["foo:bar->return", "foo:baz->return"], []).
like image 85
tkowal Avatar answered Nov 23 '25 14:11

tkowal



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!