<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">A quick follow up:<div class=""><br class=""></div><div class="">my code did not trigger because I misspelled the manifest attribute name (DiSL-Transformers).</div><div class=""><br class=""></div><div class="">The correct manifest attribute name is:</div><div class=""><div style="margin: 0px; font-size: 11px; font-family: Monaco; color: rgb(57, 51, 255);" class=""><span class="Apple-tab-span" style="white-space:pre">     </span>DiSL-Transformer</div><div class=""><br class="webkit-block-placeholder"></div><div class="">Best</div><div class=""><br class=""></div><div class="">— Alessio</div><div class=""><br class=""></div><div apple-content-edited="true" class="">
<div class="">Alessio Gambi, Ph.D.</div><div class=""><a href="mailto:gambi@st.cs.uni-saarland.de" class="">gambi@st.cs.uni-saarland.de</a></div><div class=""><br class=""></div><br class="Apple-interchange-newline">

</div>
<br class=""><div><blockquote type="cite" class=""><div class="">On 19 Apr 2017, at 12:13, Alessio Gambi <<a href="mailto:gambi@st.cs.uni-saarland.de" class="">gambi@st.cs.uni-saarland.de</a>> wrote:</div><br class="Apple-interchange-newline"><div class="">Hi DiSL-ers,<br class=""><br class="">following Lubomir advice I implemented the  ch.usi.dag.disl.Transformer into a class, then specified its fully qualified<br class="">name in the DiSL-Transformers attribute in the manifest of the instumentation jar [1].<br class=""><br class="">However, I suspect that DiSL in not picking this up. I say I suspect because I do not how to verify that my Transformer is instantiated<br class="">and used. I put a couple of System.out statements in the Transformer code but did not see them out the console, but I might be looking at the wrong console ;)<br class=""><br class="">I invoke my test application (one of the examples provided in the DiSL distribution) using the disl.py script.<br class=""><br class="">Note that I see the DiSL snippets being triggered…<br class=""><br class="">Any advice  ?<br class=""><br class="">Best<br class=""><br class="">— Alessio<br class=""><br class=""><br class="">[1] Manifest<br class="">Manifest-Version: 1.0<br class="">DiSL-Classes: de.unisaarland.instrumentation.disl.ConflictDetection<br class="">DiSL-Transformers: de.unisaarland.instrumentation.RWDependencyClassFileTransformer<br class=""><br class="">Alessio Gambi, Ph.D.<br class=""><a href="mailto:gambi@st.cs.uni-saarland.de" class="">gambi@st.cs.uni-saarland.de</a><br class=""><br class=""><br class=""><br class=""><blockquote type="cite" class="">On 18 Apr 2017, at 16:07, Lubomír Bulej <lubomir.bulej@d3s.mff.cuni.cz> wrote:<br class=""><br class="">Dear Alessio,<br class=""><br class="">DiSL itself was not meant to modify classes in this way, but it would<br class="">certainly work if you give it classes that are already modified in this way.<br class=""><br class=""><br class="">If you want to do everything at load time, you can also give DiSL a<br class="">transformer class, and DiSL will use it to pre-transform class before starting<br class="">to instrument it.<br class=""><br class="">You should implement the ch.usi.dag.disl.Transformer interface, and set the<br class="">DiSL-Transformers attribute in the manifest of the jar file with<br class="">instrumentation classes (the jar file with snippets which the DiSL server<br class="">uses) to the fully qualified class name of your transformer class.<br class=""><br class="">We generally use exactly the pattern you describe, because you don't want to<br class="">do a lot of work in the snippets (they are inlined as bytecode) and it can<br class="">blow up the size of the methods significantly. So we usually call an analysis<br class="">method from the snippets and include the event data as parameters, possibly<br class="">with a bit of state stored in thread-local and synthetic local variables (the<br class="">synthetic locals allow embedding small amounts of state information in stack<br class="">frames).<br class=""><br class="">Let me know if it helps...<br class=""><br class=""><br class="">Best regards,<br class="">Lubomir<br class=""><br class=""><br class="">On 18/04/17 15:14, Alessio Gambi wrote:<br class=""><blockquote type="cite" class="">Hi DiSL-ers<br class=""><br class="">I was wondering if I can dynamically add private fields and getters/setters to classes using DiSL.<br class=""><br class="">The reason for that is I want to implement a (special) taint analysis that stores taint information directly inside<br class="">the objects and partially analyze them locally. In other terms, I do not like to implement the following pattern:<br class=""><br class="">observe event -> publish the event to an event handler -> do the complete analysis inside the event handler<br class=""><br class="">I already have the code which adds the fields to the classes… would DiSL work it I pass to it code which is<br class="">already instrumented?<br class=""><br class="">Any thoughts?<br class=""><br class="">Best<br class=""><br class="">— Alessio<br class=""><br class=""><br class=""><br class="">Alessio Gambi, Ph.D.<br class="">gambi@st.cs.uni-saarland.de<br class=""><br class=""></blockquote></blockquote><br class=""></div></blockquote></div><br class=""></div></body></html>