[erlang-questions] Linking enif_* functions to an executable file
Mon Apr 28 19:58:47 CEST 2014
This reminds me of an enhancement I'd love to see. Right now, there's some sort of naming convention around beam as I list the contents of the erts bin directory and see both a beam and a beam.smp executable. IIRC when you compile a different type, sometimes you get another executable, sometimes you get the same executables with the given features enabled. Also, cerl is not currently installed.
What if there was a cleaner way to create these, and have some or all of them installed, then switch easily. So for instance, instead of TYPE=debug, what if you could do
% ./configure --enable-debug-support
and then when you built it would create 2 executables
Then erl could have an argument that allowed you to enable debug, like
% erl -type debug
Then suppose this was extended for all TYPE targets (and of course, flavor would work as it does now, resulting in a second set of executables with .smp in their name).
This would allow you to have several different beam executables installed on a system and switch between them when you need to (for instance if I want to check lock usage with the lcnt vm, I currently need to rebuild, or spend some time up front building several packages, one for each type, whereas if I felt I might need it I could enable when I build the initial package).
Anyway, just an idea, not sure how many others might want this sort of setup,
On Apr 28, 2014, at 5:51 AM, Sverker Eriksson <sverker.eriksson@REDACTED> wrote:
> On 04/27/2014 06:00 AM, mayamatakeshi wrote:
>> All, thanks for the suggestions.
>> I tried valgrind and still could not make gdb to stop on the segfault.
>> I believe this is an issue with old gdb as this is a machine running CentOS
>> 3.9 (required by a proprietary library that will not work with most recent
>> distros). I am trying to install a more recent version of gdb but they keep
>> failing to build.
>> Til I solve this, I will recourse to debug with printf.
> I also recommend to use a debug emulator during NIF development.
> A lot of runtime assertions for earlier error detection and no compiler optimizations for nicer core dumps.
> cd $ERL_TOP/erts/emulator
> make TYPE=debug smp plain
> $ERL_TOP/bin/cerl -debug
> /Sverker, Erlang/OTP
> erlang-questions mailing list
More information about the erlang-questions