[erlang-questions] Intrusive function intercept
Thu Oct 10 21:47:55 CEST 2013
The 'int' module in the debugger application might be able to help here. It performs the instrumentation (re-compiles your module from debug_info with breakpoints and so on) and manages the execution of instrumented code for you.
I think that using 'int' as the basis for building a production system is crazy, but it'd be interesting to try out.
 ALWAYS compile with debug_info.
 Why is that not the default? I have never not wanted it.
On 2013-10-10, at 02:13 , Richard Carlsson <> wrote:
> On 2013-10-10 10:54 , Tyron Zerafa wrote:
>> Yes, we can change the code of the /test/ function and use messages;
>> however I was wondering whether there is another approach. Our idea is
>> to build a resource access control system which authorizes access to
>> resources. We came up with the following implementation options:
>> 1) change the Erlang/OTP libraries - ruled out (not an option)
>> 2) perform checks before each access - will have to change our current
>> code and add these checks
>> 3) using monitoring as described in the previous post - monitoring
>> process performs checks and only allow processes to proceed if they've
>> got the correct privilieges
> If you're not afraid of getting down and dirty, there's another possibility that doesn't require any source code changes, and which guarantees that you check all resource accesses: rewrite the BEAM bytecode of modules at load time, inserting checks automatically.
More information about the erlang-questions