首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >当用于分析时,透析器将正确的.plt文件视为无效。

当用于分析时,透析器将正确的.plt文件视为无效。
EN

Stack Overflow用户
提问于 2014-06-03 16:30:02
回答 1查看 282关注 0票数 0

我使用以下命令为ejabberd和标准库构建了.plt文件:

代码语言:javascript
运行
复制
$ dialyzer --build_plt --apps kernel stdlib erts mnesia eunit -o ./dialyzer/ejabberd.plt /path/to/ejabberd/repository/ebin/*.beam

对生成文件的手动检查表明该文件是有效的:

代码语言:javascript
运行
复制
$ dialyzer --check_plt dialyzer/ejabberd.plt 
  Checking whether the PLT /home/citxx/.dialyzer_plt is up-to-date... yes
done (passed successfully)

但是,当我试图使用这个.plt文件检查我的源代码时,会发生以下错误:

代码语言:javascript
运行
复制
$ dialyzer --plts dialyzer/ejabberd.plt ebin/*.beam
  Checking whether the PLT dialyzer/ejabberd.plt is up-to-date...
dialyzer: The file: dialyzer/ejabberd.plt is not a valid PLT file
Use the options:
   --build_plt   to build a new PLT; or
   --add_to_plt  to add to an existing PLT

For example, use a command like the following:
   dialyzer --build_plt --apps erts kernel stdlib mnesia
Note that building a PLT such as the above may take 20 mins or so

If you later need information about other applications, say crypto,
you can extend the PLT by the command:
  dialyzer --add_to_plt --apps crypto
For applications that are not in Erlang/OTP use an absolute file name.

如果plt文件中没有包含标准应用程序,也会发生同样的情况。

这种行为的原因是什么?

UPD。我使用的是ejabberd 14.05和erlang 17.0。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2014-06-03 17:37:49

有两件事:

  • -o选项并不使透析器将PLT写入给定的文件,而是使分析结果。查看该文件,您将看到它是一个文本文件。您想要的选项是--output_plt
  • --check_plt不使用PLT文件名。请注意,它说明/home/citxx/.dialyzer_plt是有效的,而不是您引用的文件。您需要将其与--plt--plts参数组合起来,如下所示: 透析器--check_plt --plts透析器/ejabberd.plt
票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/24020330

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档