How to Build a Debug Enabled Erlang RunTime System
原创文章,转载请注明: 转载自系统技术非业余研究
很多朋友在问如何调试Erlang的驱动代码等等,其实otp源码下的INSTALL.md写的很清楚, 摘抄下:
How to Build a Debug Enabled Erlang RunTime System
————————————————–
After completing all the normal building steps described above a debug
enabled runtime system can be built. To do this you have to change
directory to `$ERL_TOP/erts/emulator`.
注:一定要注意这句话, 假设你现在在otp源码目录下,正常编译好了, export ERL_TOP=`pwd` 然后进入erts/emulator目录下
In this directory execute:
$ make debug FLAVOR=$FLAVOR
where `$FLAVOR` is either `plain` or `smp`. The flavor options will
produce a beam.debug and beam.smp.debug executable respectively. The
files are installed along side with the normal (opt) versions `beam.smp`
and `beam`.
To start the debug enabled runtime system execute:
$ $ERL_TOP/bin/cerl -debug
The debug enabled runtime system features lock violation checking,
assert checking and various sanity checks to help a developer ensure
correctness. Some of these features can be enabled on a normal beam
using appropriate configure options.
There are other types of runtime systems that can be built as well
using the similar steps just described.
$ make $TYPE FLAVOR=$FLAVOR
where `$TYPE` is `opt`, `gcov`, `gprof`, `debug`, `valgrind`, or `lcnt`.
These different beam types are useful for debugging and profiling
purposes.
祝玩的开心!
Post Footer automatically generated by wp-posturl plugin for wordpress.
小站来访了,贵站不错,期待和博主多多交流。