2014-01-17 43 views
2

克服一些麻烦安装后我试图单模上使用Erlang的调试器:erlang debug_info选项 - 模块内还是编译期间?

我包含在源文件-compile([debug_info]).选项编译:

1> c(test_module).

如预期这不起作用:后运行

2> debugger:start().

监视窗口出现了,然后我点击

Module->Interpret...->test_module.erl

,并得到错误

"Error when interpreting: test_module.erl: No debug_info in BEAM file".

删除-compile([debug_info]).线和改变

1> c(test_module).

1> c(test_module, [debug_info]).

解决了这个问题。

是什么设置编译选项这两种方式之间的区别,为什么一个工程和其他不?

+0

[使用-compile在Erlang模块中请求调试\ _info](http://stackoverflow.com/questions/6830271/requesting-debug-info-in-an-erlang-module-using-compile) –

回答

0

根据该文档,这两种方式应该是等价的:

注意,除了包含路径({我,迪尔})也 可以在文件中给出了-compile所有选项([选项,...])。属性。

(从Erlang -- compile doc

检查this question获取更多信息。

+0

根据该问题中的注释,文件debug_info编译选项在评论时不起作用。这里值得承认,而不是将不准确的文档引用为真实。 – bschlueter

+0

报告的行为是一个错误。有人在这里看到了问题,也可能是这样报道的。应该没有区别。 – aronisstav

+0

我只是说你在回答中引用的文档是错误的(不管它们是否是正确的),因此你的回答是错误的,或者至少是不完整的。 – bschlueter