一、构建PLT文件:
新构建
dialyzer --build_plt --apps $(APPS)
--apps参数对命令指定的应用构建PLT,缺省的PLT文件是~/.dialyzer_plt文件
如果要生成自己的plt文件,使用--output参数指定
dialyzer --build_plt --apps $(APPS) --output_plt my_abc.plt
一个例子:
dialyzer --build_plt --output_plt ~/.my_abc.plt --apps kernel stdlib sasl erts ssl tools os_mon runtime_tools c
rypto inets xmerl webtool snmp public_key mnesia eunit
添加内容
例如给已有的plt添加xmerl应用:
dialyzer --add_to_plt --apps xmerl
二、分析程序
既可以分析erl源代码,也可以对编译好的beam文件进行分析
例如对ebin下编译好的beam程序进行分析的例子:
dialyzer --plts *.plt ~/.dialyzer_plt -- ebin
参考:
http://learnyousomeerlang.com/dialyzer
新构建
dialyzer --build_plt --apps $(APPS)
--apps参数对命令指定的应用构建PLT,缺省的PLT文件是~/.dialyzer_plt文件
如果要生成自己的plt文件,使用--output参数指定
dialyzer --build_plt --apps $(APPS) --output_plt my_abc.plt
一个例子:
dialyzer --build_plt --output_plt ~/.my_abc.plt --apps kernel stdlib sasl erts ssl tools os_mon runtime_tools c
rypto inets xmerl webtool snmp public_key mnesia eunit
添加内容
例如给已有的plt添加xmerl应用:
dialyzer --add_to_plt --apps xmerl
二、分析程序
既可以分析erl源代码,也可以对编译好的beam文件进行分析
例如对ebin下编译好的beam程序进行分析的例子:
dialyzer --plts *.plt ~/.dialyzer_plt -- ebin
参考:
http://learnyousomeerlang.com/dialyzer
本文介绍如何使用Dialyzer构建PLT文件并分析Erlang程序。主要内容包括构建PLT文件的过程及命令选项说明,通过示例展示如何为特定应用构建PLT文件,以及如何利用PLT文件分析Erlang源代码或编译后的BEAM文件。
1395

被折叠的 条评论
为什么被折叠?



