[erlang-questions] Obtaining current frame bindings ?
Sébastien Tandel
sebastien.tandel@REDACTED
Mon Jun 25 15:04:48 CEST 2012
Hi all,
I have written a simple fault injection server in order to test my code.
I can inject exception, sleep and other some minor perturbations into my
code (at some chosen places, let's call them test points) at runtime and
it's configured thanks to a simple configuration file written in json.
These perturbations are injected after meeting some conditions. For
example, right now, it's based on a counter per test point (if enabled). It
this counter reaches zero, there is an action triggered (exception, sleep,
...).
If this mechanism already provides me lot of testing case, I would like
though extend it to be able to write conditions which are code injection
like, for example, "if N == [].".
I'm able to use correctly erl_scan and erl_parse to obtain the ast.
However, when calling erl_eval:exprs(), I need the bindings of the current
function in which this code runs and I've not been able to find out a way
to obtain these bindings.
Does anyone know whether it's possible? And if it is, how can I obtain it?
:)
Regards,
Sebastien Tandel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20120625/389d7427/attachment.htm>
More information about the erlang-questions
mailing list