<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Helvetica,sans-serif;" dir="ltr">
<p style="margin-top:0;margin-bottom:0">Hi Ben,</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0">Thanks again for the guidance! As I understand it, you made a few points:</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0"></p>
<ol style="margin-bottom: 0px; margin-top: 0px;">
<li><span style="font-size: 12pt;">Overwriting the entire rt.jar might be easier than just overwriting a few classes (<a href="https://jreframeworker.com" class="OWAAutoLink" id="LPlnk84846" previewremoved="true">https://jreframeworker.com</a>) has an example
 that does that.</span>
<div id="LPBorder_GT_15412815429200.36671867718583195" style="margin-bottom: 20px; overflow: auto; width: 100%; text-indent: 0px;">
<table id="LPContainer_15412815429160.7800576739323379" role="presentation" cellspacing="0" style="width: 90%; background-color: rgb(255, 255, 255); position: relative; overflow: auto; padding-top: 20px; padding-bottom: 20px; margin-top: 20px; border-top: 1px dotted rgb(200, 200, 200); border-bottom: 1px dotted rgb(200, 200, 200);">
<tbody>
<tr valign="top" style="border-spacing: 0px;">
<td id="TextCell_15412815429180.5835551182687146" colspan="2" style="vertical-align: top; position: relative; padding: 0px; display: table-cell;">
<div id="LPRemovePreviewContainer_15412815429180.9602123377103298"></div>
<div id="LPTitle_15412815429180.20399681736430875" style="top: 0px; color: rgb(0, 37, 76); font-weight: 400; font-size: 21px; font-family: wf_segoe-ui_light, "Segoe UI Light", "Segoe WP Light", "Segoe UI", "Segoe WP", Tahoma, Arial, sans-serif; line-height: 21px;">
<a id="LPUrlAnchor_15412815429190.4541415221169611" href="https://jreframeworker.com/" target="_blank" style="text-decoration: none;">JReFrameworker – Making Java Bytecode Manipulations Easier</a></div>
<div id="LPMetadata_15412815429190.7110018089943615" style="margin: 10px 0px 16px; color: rgb(102, 102, 102); font-weight: 400; font-family: wf_segoe-ui_normal, "Segoe UI", "Segoe WP", Tahoma, Arial, sans-serif; font-size: 14px; line-height: 14px;">
jreframeworker.com</div>
<div id="LPDescription_15412815429200.11254666572297545" style="display: block; color: rgb(102, 102, 102); font-weight: 400; font-family: wf_segoe-ui_normal, "Segoe UI", "Segoe WP", Tahoma, Arial, sans-serif; font-size: 14px; line-height: 20px; max-height: 100px; overflow: hidden;">
JReFrameworker. This project aims to extend previous works by Erez Metula by introducing JReFrameworker, a tool to produce MCR capabilities aimed at the Java Runtime Environment in a user-friendly way.. JReFrameworker is a bytecode manipulation tool that allows
 a user to write annotated Java source that is automatically merged or inserted into the runtime.</div>
</td>
</tr>
</tbody>
</table>
</div>
<br>
</li><li><span style="font-size: 12pt;"> Soot might have issue transforming Java 8 rt.jar but Java 7 should work.</span><br>
</li></ol>
<br>
<p></p>
<p style="margin-top:0;margin-bottom:0">Thank you very much for your information. Really appreciate it! I'll let you know if I successfully achieve that.</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0">Tong</p>
</div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Ben Holland <benjholla@gmail.com><br>
<b>Sent:</b> Saturday, November 3, 2018 5:33:07 PM<br>
<b>To:</b> Zhou, Tong<br>
<b>Cc:</b> soot-list@cs.mcgill.ca<br>
<b>Subject:</b> Re: [Soot-list] Interpreter for Soot & How to profile edge count for whole program</font>
<div> </div>
</div>
<div>
<div dir="ltr">
<div dir="ltr">Oh, I missed your point about library classes. Yea I would just make the "library" class an "application" class. I've used 
<span style="color:rgb(36,39,41); font-family:Consolas,Menlo,Monaco,"Lucida Console","Liberation Mono","DejaVu Sans Mono","Bitstream Vera Sans Mono","Courier New",monospace,sans-serif; font-size:13px; white-space:pre-wrap; background-color:rgb(239,240,241)">
-Xbootclasspath</span> before as well. It's more of an implementation hack at the end of the day. You might also be able to do some package namespace collision hacks too if you are interested in just a few classes. I'm not totally sure how Soot will respond
 in these cases though. It's not hard to have soot produce/transform jimple for the rt.jar method, so you could create a new jar and replace it in your runtime directory or use xbootclasspath. I did something similar for my <a href="https://jreframeworker.com">https://jreframeworker.com</a>
 tool (doesn't use Soot, just ASM, but same idea). 
<div><br>
</div>
<div>P.S. I noticed that while Soot supports making Jimple for Java 8 the output Jimple had some runtime issues when it came to lambdas. My group made a fix for it and I think even submitted something upstream to Soot but I'm not sure what the status of that
 is. For proof of concept stuff you might want to stick to Java 7 especially when dealing with core JDK level classes.</div>
</div>
</div>
<br>
<div class="x_gmail_quote">
<div dir="ltr">On Sat, Nov 3, 2018 at 4:25 PM Zhou, Tong <<a href="mailto:tz@gatech.edu" target="_blank">tz@gatech.edu</a>> wrote:<br>
</div>
<blockquote class="x_gmail_quote" style="margin:0 0 0 .8ex; border-left:1px #ccc solid; padding-left:1ex">
<div dir="ltr">
<div id="x_m_-4220352197570021276m_-296574278831353559divtagdefaultwrapper" dir="ltr" style="font-size:12pt; color:#000000; font-family:Calibri,Helvetica,sans-serif">
<p style="margin-top:0; margin-bottom:0">Hi Ben,</p>
<p style="margin-top:0; margin-bottom:0"><br>
</p>
<p style="margin-top:0; margin-bottom:0">Thanks for your help! However that doesn't seem to work with the library classes. Although it's easy to also instrument the library classes  but so far I don't know how to instruct the JVM to use my custom library class
 instead of its default stuff. I am going to try something like <span style="color:rgb(36,39,41); font-family:Consolas,Menlo,Monaco,"Lucida Console","Liberation Mono","DejaVu Sans Mono","Bitstream Vera Sans Mono","Courier New",monospace,sans-serif; font-size:13px; white-space:pre-wrap; background-color:rgb(239,240,241)">-Xbootclasspath/p:</span> , that
 might be able to overwrite the bootloaded classes. Thanks a lot!</p>
<p style="margin-top:0; margin-bottom:0"><br>
</p>
<p style="margin-top:0; margin-bottom:0">-Tong</p>
</div>
<hr style="display:inline-block; width:98%">
<div id="x_m_-4220352197570021276m_-296574278831353559divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>From:</b> Ben Holland <<a href="mailto:benjholla@gmail.com" target="_blank">benjholla@gmail.com</a>><br>
<b>Sent:</b> Saturday, November 3, 2018 4:52:26 PM<br>
<b>To:</b> Zhou, Tong<br>
<b>Cc:</b> <a href="mailto:soot-list@cs.mcgill.ca" target="_blank">soot-list@cs.mcgill.ca</a><br>
<b>Subject:</b> Re: [Soot-list] Interpreter for Soot & How to profile edge count for whole program</font>
<div> </div>
</div>
<div>
<div dir="ltr">
<div dir="ltr">I've built something like this before using Soot and another tool called Atlas. The code is public, but not very clean/reliable at this time and it's not using an official branch of Soot. Anyway, the idea is relatively simple. Soot lets you insert
 statements before/after statements. You can use this to insert counters before each statement in your control flow graph. A similar example for counting GOTOs is included with Soot: <a href="https://github.com/Sable/soot/wiki/Adding-profiling-instructions-to-applications" target="_blank">https://github.com/Sable/soot/wiki/Adding-profiling-instructions-to-applications</a>.
 Each edge in a control flow graph is a transition from one node to another in the control flow graph, so if you were to track the sequence that nodes were visited you could easily correlate that to an edge and keep counters for each edge. The trick will be
 to implement it so it's not tracking too much at a time. You only need to the node which node was the previous node to infer the edge, so you should only have to track one item at a time, otherwise, you will be adding a lot of overhead in your instrumentation.</div>
</div>
<br>
<div class="x_m_-4220352197570021276m_-296574278831353559x_gmail_quote">
<div dir="ltr">On Sat, Nov 3, 2018 at 2:30 PM Zhou, Tong <<a href="mailto:tz@gatech.edu" target="_blank">tz@gatech.edu</a>> wrote:<br>
</div>
<blockquote class="x_m_-4220352197570021276m_-296574278831353559x_gmail_quote" style="margin:0 0 0 .8ex; border-left:1px #ccc solid; padding-left:1ex">
<div dir="ltr">
<div id="x_m_-4220352197570021276m_-296574278831353559x_m_5022641995296760732divtagdefaultwrapper" dir="ltr" style="font-size:12pt; color:#000000; font-family:Calibri,Helvetica,sans-serif">
<p style="margin-top:0; margin-bottom:0">Hi,</p>
<p style="margin-top:0; margin-bottom:0"><br>
</p>
<p style="margin-top:0; margin-bottom:0">Is there any existing project that builds an interpreter on top of Jimple or Shimple? I am currently trying to profile the dynamical basic block counts of a program using an instrumentation-based approach (insert code
 that increments a counter) but couldn't find a way instrument the library classes (java.lang.xxx etc). So I was thinking if there's such an interpreter that works on Soot's IR, certain profiling would be quite easy to do in such an interpreter. If no such
 thing exists, can someone shed some light on how to profile <span style="font-family:Calibri,Helvetica,sans-serif,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols; font-size:16px">the </span><span style="font-family:Calibri,Helvetica,sans-serif,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols; font-size:16px">dynamical
 basic block counts of an entire program including libraries?</span> Thanks a lot! Any comment is appreciated.</p>
<p style="margin-top:0; margin-bottom:0"><br>
</p>
<p style="margin-top:0; margin-bottom:0">Tong</p>
</div>
</div>
_______________________________________________<br>
Soot-list mailing list<br>
<a href="mailto:Soot-list@CS.McGill.CA" target="_blank">Soot-list@CS.McGill.CA</a><br>
<a href="https://mailman.CS.McGill.CA/mailman/listinfo/soot-list" rel="noreferrer" target="_blank">https://mailman.CS.McGill.CA/mailman/listinfo/soot-list</a><br>
</blockquote>
</div>
</div>
</div>
</blockquote>
</div>
</div>
</body>
</html>