1. 程式人生 > >系統技術非業餘研究 » How to Build a Debug Enabled Erlang RunTime System

系統技術非業餘研究 » 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.