在Erlang模块中使用-compile请求debug_info [英] Requesting debug_info in an Erlang module using -compile

查看:340
本文介绍了在Erlang模块中使用-compile请求debug_info的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想强制Erlang编译器在编译时为特定模块生成调试信息,而无需向编译命令添加 debug_info 参数。我尝试添加

I want to force the Erlang compiler to generate debug info for specific modules whenever I compile them, without having to add the debug_info argument to the compilation command. I tried adding

-compile([debug_info]).

到模块文件,但运行 c(my_module)没有在光束文件中包含调试信息。

to the module file, but running c(my_module) did not include the debug info in the beam file.

有没有办法这样做,或调试信息不​​能从模块源文件本身添加?

Is there a way to do this, or debug information can not be added from the module source file itself?

推荐答案

使用 -compile 指令,而不包含围绕选项:

Use the -compile directive without the enclosing list around the option:

-compile(debug_info).

这篇关于在Erlang模块中使用-compile请求debug_info的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆