tag:blogger.com,1999:blog-77185178135452037602024-02-20T23:21:03.766-08:00Del-Alt-CtrlDelhttp://www.blogger.com/profile/18263589361673145166noreply@blogger.comBlogger26125tag:blogger.com,1999:blog-7718517813545203760.post-80755762261193996432011-09-05T23:24:00.000-07:002011-09-05T23:24:26.545-07:00When Rigor becomes Rigor MortisI've worked in the field of computer science and software engineering research off-and-on for almost ten years: first, as a software developer and research associate and then, in the last 3 years, as a masters student. In that time, I've been able to work on a number of very interesting and innovative projects. That is what I think is a great advantage of academia. At least in theory, academics are meant to be free to investigate new ideas, new theories, and new technologies without the obligation to provide a product that will generate profit.<br />
<br />
However, in the time that I've been involved in academia, I've learned enough to become a little critical of it as well. There is a well-known mantra that in academia one must, "publish or perish." If you don't run studies and publish papers, then you won’t make it as an academic. Since grants and fellowships are awarded based, in part, on the curriculum vitae of an academic, if the publications dry up, then the funding will as well. So there is a kind of “market value” that is put on research. It is based on what can be published, and it is adjudicated by conference chairs and journal editors.<br />
<br />
I've reviewed my own fair share of papers. One thing that I and other researchers look for is rigor in research. Science needs rigor. It is important that a paper does not claim more than it can actually demonstrate. That means that the researchers have to work hard to design, implement, and run experiments. And they have to be careful about what they claim.<br />
It’s my belief that modest claims in research are good claims. I think that in computer science and software engineering, we often research scenarios that are far too complex, with far too many variables to make large claims. Unfortunately, it is difficult to publish modest claims. They don’t seem exciting enough. It seems that I see a lot of reviews that want papers that demonstrate how a new technique or technology is better than all other predecessors or that helps all people in all situations. The average researcher just isn't up to the task. It is an impossible one.<br />
<br />
It requires experiments that are too large and take too long. To make such strong claims, one needs to produce experiments that have statistical significance. When you are working with a new technology, that means that you need to pull from a large pool of unbiased, randomly selected participants that you can ask to try the technology, so that you can measure their usage of it, ask them about their reaction to it, and try to form some kind of generalizations and a theory about why the technology does or doesn’t work. The problem is that most researchers don’t have access to a large pool of participants, and the participants almost never can be randomly selected.<br />
<br />
Even if these criteria can be met, the problem of gathering and analyzing data from these kinds of scenarios can become almost insurmountable. For my thesis, I, my supervisor, and several others designed and performed a study that involved ten participants in total. With only ten participants, it took us several months to transcribe and review the videos, analyze logged data from the application, etc., etc. If we had as many participants as we needed to gain statistical significance, it would have taken us years to complete the research.<br />
<br />
In such a fast-moving realm as computer science and software engineering, this kind of long turn-around time is very frustrating. It makes research seem to lag behind the innovations of commercial and Open Source projects. It also makes it difficult to do future research. Since the results lag behind the results of production software, it is difficult to convince professionals to participate in experiments. It is a large cost (in terms of time and money) for what they see as a small reward. This will make it more difficult in the future to perform academic experiments that are able to make strong claims.<br />
<br />
It might be time for academics to re-evaluate the goals of computer science and software engineering research. What kinds of problems are they trying to solve, and what is really important? From my perspective, my own research has been a success. I started my masters not as an academic, but as a software developer. I had problems in my day-to-day programming that needed solving. My masters work gave me the opportunity to work with some excellent and smart people and come up with a workable solution. I was able to produce the Diver tool and hand it to the Eclipse community, which has always been a community that fosters innovation and excellent technical solutions.<br />
<br />
The results of the work, however, have been difficult to publish. In spite of the recognition that Diver got by being named a finalist for "Best Developer Tool of the Year," the results of our research have yet to be published outside of my masters thesis. I get the distinct feeling that I can make a bigger impact by working toward building real solutions for real developers than I can by trying to convince conference chairs that the solutions are worth-while.<br />
So, I’m leaving the Diver project in the capable hands of the CHISEL group at the University of Victoria, and moving onto a new chapter in my life. I've been offered a job at Microsoft and I start tomorrow. It has been great working at the University of Victoria. There are some really smart, creative, and inspiring people there. It has also been great working within the Eclipse community. I truly believe that the work done with Eclipse has changed the way that people develop software. The community is great and so are the products.<br />
<br />
In the end, I'm really just interested in designing and implementing good solutions to real-world problems. Microsoft has offered me what seems to be an exciting opportunity to do just that. As an added bonus, it pays better than the wage of a masters student :-). So, this will be my last post to Planet Eclipse. Thank you everyone for your support over the years and I wish you all the greatest blessings.<br />
<br />
The Diver project is still available on <a href="http://diver.sourceforge.net">Sourceforge</a>. If you like, you can find my masters thesis <a href="https://dspace.library.uvic.ca:8443/bitstream/handle/1828/3444/Myers_Del_MSc_2011.pdf?sequence=6">here</a>.Delhttp://www.blogger.com/profile/18263589361673145166noreply@blogger.com7tag:blogger.com,1999:blog-7718517813545203760.post-89113762332322850302011-08-08T17:13:00.000-07:002011-08-08T17:13:59.841-07:00New Version of Diver Available<div class="separator" style="clear: both; text-align: center;"><a href="http://diver.sf.net/"><img border="0" src="http://diver.sf.net/images/logo-small.png" /></a></div><br />
So, I just defended my Masters thesis today, and I figured that I would celebrate by releasing a new version of my thesis project Dynamic Interactive Views for Reverse Engineering. It's a tool that allows you to dynamically trace the execution of your software, and focus in on particular features and bugs to help you analyze and understand it.<br />
<div><br />
</div><div>First of all, I'm going to apologize for not being very active around here since EclipseCon. I've been too swamped with finishing off my thesis. But, in the last little while, I've been able to work on Diver and make some updates. Unfortunately, since I am finished my Masters now, I won't be personally releasing new versions Diver anymore. But, it is remaining with the <a href="http://www.thechiselgroup.org/">CHISEL</a> group at the <a href="http://www.uvic.ca/">University of Victoria</a>, and it will hopefully pass to other capable hands. More about that, though, in a future post.</div><div><br />
</div><div>Anyway, there are a couple of enhancements to Diver, including the ability to trace your JUnit tests, and the ability to view sequence diagrams that are generated directly from source code without the need to create an execution trace. More information can be found on the <a href="http://diver.sf.net/new.html">Diver web page</a>.<br />
<br />
You can install Diver using the <a href="http://marketplace.eclipse.org/">Eclipse Marketplace</a>, or by following the instructions on the <a href="http://diver.sf.net/download.html">Diver web page</a>.</div>Delhttp://www.blogger.com/profile/18263589361673145166noreply@blogger.com5tag:blogger.com,1999:blog-7718517813545203760.post-834353328320066502011-03-25T09:07:00.000-07:002011-03-25T09:12:13.508-07:00Reflections on EclipseConThanks to everyone at EclipseCon this past week for making it a great experience. <a href="http://jaxenter.com/eclipsecon-top-three-technologies-35390.html">JaxEnter</a> asked me to write a short reflection about my experiences. I don't want to steal traffic from them, so you can see the article by following the link above :-).<br />
<br />
The article is technology-centric. It was difficult for me to choose from among the many great things that are going on with Eclipse since it is such a vibrant and innovative community. The technologies in the article have heavy support from the top-level projects, so they will be interesting to follow. Also, in reality, they only reflect my own interests and experience and I could not have possibly seen everything going on at EclipseCon. That isn't to diminish any of the other great technologies that are built on Eclipse. There are a tonne of them that have become so integrated into my daily work, that I barely even notice them anymore. That's a real compliment, I think.<br />
<br />
The best thing, really, though is the community. I have to admit that it was a little difficult to get to talk to people before I gave my talk on Wednesday. After that, though, I had a few great conversations. I'd like to make a shout-out to the guys over at Ericsson. For the past while, we have been working on the same set of problems, with support by the same funders. We had to go all the way to California for EclipseCon before we had heard about each other, though. It's a funny world.<br />
<br />
Oh well, time to head back home. Good-bye cold, rainy California. I'll be going back to the rain and palm trees of Victoria :-).Delhttp://www.blogger.com/profile/18263589361673145166noreply@blogger.com1tag:blogger.com,1999:blog-7718517813545203760.post-55995996726188355112011-03-14T17:54:00.000-07:002011-03-14T17:54:50.040-07:00Tracing Web Apps Using Diver<div class="separator" style="clear: both; text-align: center;"><a href="http://diver.sf.net/"><img border="0" src="http://diver.sf.net/images/logo-small.png" /></a></div><br />
Diver is a tool designed to help Java Developers understand how unfamiliar, or long-forgotten, software works. It lets developers easily trace the actions of Java Software and analyze it using an advanced Sequence Diagram View and some workbench filters that help focus on the software artifacts associated with particular features of the software.<br />
<br />
With more and more applications moving to the Web, I've been asked a number of times, "Can Diver trace web apps?" I've always told people that it is possible to do, but I haven't given detailed instructions on how to do it. This post will hopefully remedy that.<br />
<br />
First, a few notes. The version of Diver used to illustrate the points in this post is 0.3.1. It isn't an official release yet because there is still some testing to be done. I've had to do some tweaking to Diver, though, to make tracing web apps a little easier. So, you can get your copy of Diver 0.3.1 by pointing p2 to <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">http://diver.svn.sourceforge.net/svnroot/diver/Development</span>. Another thing: Diver only traces Java, not JavaScript. So, Diver can't be used to help get at any JavaScript errors that are running in the browser. It can, however, trace Java apps that have been deployed on a Java-enabled web server such as Jetty, Tomcat, or JBoss. That includes code invoked from JSPs. In this post, I'll be using JBoss 5.0.1GA. There is no particular reason for that. I've used Diver to trace applications deployed in Jetty as well.<br />
<br />
<span class="Apple-style-span" style="font-size: large;">Install And Deploy Your Web App</span><br />
<br />
The focus of this post is on tracing web apps, not on setting up web servers. So, I assume that you have your server ready to go. It's probably best, though, that you run on a small test server on your localhost rather than on a deployment machine. That just keeps things compact and easier to manage.<br />
<br />
Diver works best if you have the source code for that app. It isn't strictly necessary, but it makes the tools that Diver offers a lot more powerful. At the very least, you have to be able to deploy your app into your own web server. You can just build and deploy your web app the way you normally would. For example, in JBoss, this would typically involve copying a WAR file into the <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">jboss_root/server/server_name/deploy</span> directory. When you are tracing your app, Diver will actually be tracing the copy that has been deployed on your server, not the version that is in your workspace. So, after you make any changes to your code, be sure to rebuild and redeploy before running your trace. Then, Diver will be able to match the calls to various methods/classes in the deployed WAR to those classes in your workspace, making it a lot easier to find things.<br />
<div><br />
</div><div><span class="Apple-style-span" style="font-size: large;">Preparing for Launch</span></div><br />
When tracing a Java Web App, what we are really doing is capturing specific events that happen inside a Java web server instance. So, the application we will be tracing is the Java Web Server. Ideally, Diver would be able to interact with the <a href="http://www.eclipse.org/webtools/">Eclipse Web Tools Platform</a> so that you could just fire up a trace of a web server launch. Unfortunately, I haven't gotten that far yet. Fortunately, though, programs like JBoss are really just Java applications, so we can use the <i>Java Application Trace</i> functionality of Diver to grab a trace, but it will take a little set up first.<br />
<div><br />
</div><div>The Diver <i>Java Application Trace</i> is just an extension of the JDT <i>Java Application Launch</i>. The JDT requires that the applications it launches are visible in the workspace, so Diver requires the same. That doesn't mean, though, that you have to have all of the JBoss source to get started. You can launch directly from your installed JBoss instance. To get JBoss to run, you just need to make the right jar files visible. This is how you do that.</div><div><br />
</div><div>I suggest that you make the appropriate jars visible in their own project. You could, possibly, create dependencies to JBoss or Jetty, or what-have-you, in your web app's project, but that could cause build problems or runtime errors if your web app needs its jars to be isolated from the server. I just create a small Java Project called <i>JBoss</i>:</div><div><br />
</div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg3YU__Zv5BbpveWKZazGtE0TRZuFgwZbU10dz9NNAUrbv-dvqio0ZXFIVwBCIeqigU1Wn-mr4g5UWEFhapoKhNAbZUhrxnl6yvQsIxqM3VmMwJgqGKNo0Wgyx9H_73jcJ79uRZg7Odw1Wo/s1600/jboss_project.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg3YU__Zv5BbpveWKZazGtE0TRZuFgwZbU10dz9NNAUrbv-dvqio0ZXFIVwBCIeqigU1Wn-mr4g5UWEFhapoKhNAbZUhrxnl6yvQsIxqM3VmMwJgqGKNo0Wgyx9H_73jcJ79uRZg7Odw1Wo/s320/jboss_project.png" width="272" /></a></div><div><br />
</div><div>Once the project is created, you need to make the JBoss launch jar visible. To do that, just select the JBoss project in the <i>Package Explorer</i> or the <i>Navigator</i> and choose <i>File>Properties</i> <<i>Alt+Enter</i>> from the menu. Jump over to the <i>Libraries</i> tab of the <i>Java Build Path</i> settings page, and select <i>Add External Jars</i>:</div><div><br />
</div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEis0oflg2SfBBCIYGbOZfpQLliGw5gFdhGYiqYAe7w8nruYeMIY_dCQViq7igyApOB-gwcegqcGga3D8dU4zVPkq2CmdHlZiydc9P5kEBbP0BFSzCflBzRBiCmLpoS0MFugTNWcstcrflIJ/s1600/jboss_build_path.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="168" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEis0oflg2SfBBCIYGbOZfpQLliGw5gFdhGYiqYAe7w8nruYeMIY_dCQViq7igyApOB-gwcegqcGga3D8dU4zVPkq2CmdHlZiydc9P5kEBbP0BFSzCflBzRBiCmLpoS0MFugTNWcstcrflIJ/s320/jboss_build_path.png" width="320" /></a></div><div><br />
</div><div>The jar that you are looking for is <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">run.jar</span><span class="Apple-style-span" style="font-family: inherit;">. It's just the JBoss launcher. On my computer, it is found in </span><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">C:\jboss-5.0.1.GA\bin</span><span class="Apple-style-span" style="font-family: inherit;">:</span></div><div><span class="Apple-style-span" style="font-family: inherit;"><br />
</span></div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgA5qJGt3nJ9HvBi51YjMsy7K4I_t-8OkLyZFtEr7o3E-ASEOUwW5fUud1QtpCMklp7Kikhj962z8nnB0OyldMxiHkmkhGrj9XfqclRQjj-mB3Xi8W633PCNjxI3sbuseMmGrnNjPFItzME/s1600/jboss_jar.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="155" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgA5qJGt3nJ9HvBi51YjMsy7K4I_t-8OkLyZFtEr7o3E-ASEOUwW5fUud1QtpCMklp7Kikhj962z8nnB0OyldMxiHkmkhGrj9XfqclRQjj-mB3Xi8W633PCNjxI3sbuseMmGrnNjPFItzME/s320/jboss_jar.png" width="320" /></a></div><div><br />
</div><div>That's all that you need for preparation. Now, we can get onto the launch.</div><div><br />
</div><div><span class="Apple-style-span" style="font-size: large;">Setting Up The Trace</span></div><br />
<div>Now that the JBoss launcher is visible to Eclipse, we can get onto running it to gather a trace of our web app. Open up your <i>Run</i> or <i>Debug Configurations</i> dialog, and create a new <i>Java Application Trace</i>. In the <i>Main </i>tab, set the Project to the one we created earlier. The Main class that we will use is just <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">org.jboss.Main</span>. Simple enough:</div><div><br />
</div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjAw6x3hZce_cwKiH2c0jFDY1Hh3uWEZR_sV_YqtsIZxJJZ48N4Juim-bBb5cA6fNWD0U9zaMp5Gk84Vrvs3wXDmJbyfWD2fpgzCoH4bN95yFwz16yzq7yZUq1OpRZBk2u9df969dWwVJVz/s1600/jboss_launch.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="201" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjAw6x3hZce_cwKiH2c0jFDY1Hh3uWEZR_sV_YqtsIZxJJZ48N4Juim-bBb5cA6fNWD0U9zaMp5Gk84Vrvs3wXDmJbyfWD2fpgzCoH4bN95yFwz16yzq7yZUq1OpRZBk2u9df969dWwVJVz/s320/jboss_launch.png" width="320" /></a></div><div><br />
</div><div>Your web server will likely require a number of arguments to be passed both into the program and into the VM. Go to the <i>Arguments</i> tab. JBoss requires the following arguments:</div><div><br />
</div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhM4RBgKjnXUSJk1G8aXf6ES7HQFhUHOC_wMe_3hBYqrPwMkPeA0zxyKqpNpEiVoHgPv0QUA-4UVQUd-Xz-u9kcHEQAtAWDyTO_d-bvXfAEA7rXgJE1DFG4b4NHpVAdSu9T0ueQe_ckk6wo/s1600/jboss_arguments.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="194" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhM4RBgKjnXUSJk1G8aXf6ES7HQFhUHOC_wMe_3hBYqrPwMkPeA0zxyKqpNpEiVoHgPv0QUA-4UVQUd-Xz-u9kcHEQAtAWDyTO_d-bvXfAEA7rXgJE1DFG4b4NHpVAdSu9T0ueQe_ckk6wo/s320/jboss_arguments.png" width="320" /></a></div><br />
<b>Program Arguments:</b><br />
<div><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">-c <server></span> where <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><server</span><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">></span> is the name of the configured server that you deployed your web app into. I typically just use default one supplied by JBoss, so my program arguments are -<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">c default</span>.</div><div><br />
</div><div><b>VM Arguments:</b></div><div><br />
</div><div><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">-Xshare:off -Dprogram.name=run.bat -server </span></div><div><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">-Dorg.jboss.resolver.warning=true </span></div><div><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">-Dsun.rmi.dgc.client.gcInterval=3600000 </span></div><div><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">-Dsun.rmi.dgc.server.gcInterval=3600000 -Xms128m -Xmx512m </span></div><div><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">-XX:MaxPermSize=256m</span></div><div><br />
</div><div><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">-Xshare:off</span> is a Sun/Oracle specific VM argument that is there for Diver's sake. It tells the VM that this launch will not share its classes with anyone (the Java VM allows different processes to share the same loaded classes unless this flag is set). If you aren't using the Sun/Oracle VM, get rid of this argument. The other ones are there for JBoss. The really important ones (I think) are <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">-Dprogram.name=run.bat</span> (or <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">run.sh</span> if you are running on Linux) and <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">-server</span>. You can set the heap and Perm Gen sizes according to your liking.</div><div><br />
</div><div><b>Working Directory:</b></div><div><br />
</div><div><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">/jboss_home/bin</span>. On my computer, this is just <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">C:\jboss-5.0.1.GA\bin</span>. This has to be set so that JBoss can know where it is running from and resolve all of its own resources.</div><div><br />
</div><div>If you are wondering how I discovered what all of these arguments should be, I did it by inspecting the <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">run.bat</span> script that is used to launch JBoss. The script just sets a bunch of default variables, and I used those. Another thing that you should be aware of is that you need to have your <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">JAVA_HOME</span> environment variable set to a valid JDK. A normal JRE might work, but (depending on the version of your server) it may not be able to compile JSPs unless you have the JDK. I'm sure you already knew that, but I'm just throwing it out there for good measure.</div><div><br />
</div><div><br />
<span class="Apple-style-span" style="font-size: large;">Tweaking The Trace</span></div><div><br />
</div><div>That is all you technically need to do to get started. Now, you can just select the <i>Run</i> button and start gathering information like you normally would with Diver (see the <a href="http://diver.sourceforge.net/docs/Diver.html">Diver documentation</a>). But there are a few things that you can do to tweak the trace and make sure it is efficient. Web apps can be slow as it is. Tracing them introduces i/o overhead that we would like to minimize. Go over to the <i>Java Trace</i> tab of your configuration, and set it up to look something like this:</div><div><br />
</div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgVgRQNlGkMwunLk69OzuicrU4Pskqj-qrNE8ZZRmGXlpAg8Pz_X-H2EPKvVMkEYrLcn7yqppfWH0B9TcbfPK8DCIUpXeGGKZawn54SK_nwvBPTLIb5lr_NzHTW_gkPjXmsKuolAIPbIQKo/s1600/java_trace_setup.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="194" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgVgRQNlGkMwunLk69OzuicrU4Pskqj-qrNE8ZZRmGXlpAg8Pz_X-H2EPKvVMkEYrLcn7yqppfWH0B9TcbfPK8DCIUpXeGGKZawn54SK_nwvBPTLIb5lr_NzHTW_gkPjXmsKuolAIPbIQKo/s320/java_trace_setup.png" width="320" /></a></div><div><br />
First of all, you are likely only interested in the things that your web-app is doing, so I suggest selecting the <i>Set Filter Manually</i> option, and adding only the packages that are a part of your web app to the <b>Inclusion Filters</b> area. By Default, Diver will analyze the trace and only watch for methods defined in the project that is named in the <i>Main</i> tab of the launch configuration. In this launch, there is nothing but the JBoss launching jar, so the analysis would end up being mostly useless unless you set the filters manually.</div><div><br />
</div><div>I also suggest making sure <i>Pause On Start</i> and <i>Apply Filters at Runtime</i> are checked. <i>Pause On Start</i> is the default, and it just means that none of the start-up process of the program will be traced. You can define what actually gets recorded in real-time using the Eclipse <i>Debug View</i> as described in the <a href="http://diver.sourceforge.net/docs/Diver.html#ControllingTheTrace">Diver documentation</a>.</div><div><br />
</div><div>Older versions of Diver (0.2 and earlier) recorded absolutely every method call, and "rejected" data based on the defined filters during a separate analysis step. Since version 3.0, Diver allows you to reject that data before it gets stored, which can speed up your traces and your analysis by many, many times. Make sure <i>Apply Filters at Runtime</i> is checked to enable this speed up.</div><div><br />
</div><div><span class="Apple-style-span" style="font-size: large;">Get Going</span></div><div><br />
</div><div>There you go, that is all you need to get a trace of a web app using Diver. Now, you can record and compare traces to focus in on specific bugs or features in your app and use Diver's sequence diagram to analyze what is going on. The <a href="http://diver.sourceforge.net/docs/Diver.html">Diver documenation</a>, and the <a href="http://diver.sourceforge.net/tutorials.html">video tutorials</a> tell you how to do all that fun stuff:</div><div><br />
</div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiA1qOCsFiRgxtUIQ0sf21FP6ZmrouPbjNOdvj9RcXWvvolkxwIQlitsOj986SnwpgrQ8q8XGR7OmVyvN-W9kGizafw8tK_3Sm5hIFnQLXgE7VL1uGr1Zx3aFNZ_tbpYl4pD4sXlViVsPnV/s1600/sequence.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="136" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiA1qOCsFiRgxtUIQ0sf21FP6ZmrouPbjNOdvj9RcXWvvolkxwIQlitsOj986SnwpgrQ8q8XGR7OmVyvN-W9kGizafw8tK_3Sm5hIFnQLXgE7VL1uGr1Zx3aFNZ_tbpYl4pD4sXlViVsPnV/s320/sequence.png" width="320" /></a></div><div><br />
</div><div>There is just one more small bit of housekeeping that you might want to be aware of. Launching a web server in this way doesn't give you a clean, interactive way to shut it down. You can always just use the "Stop" button in the <i>Debug View</i> to force it to quit, but that could leave your server in an undefined state. I suggest opening up a console, and using your web server's shutdown command. For JBoss, all you have to do is type <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">shutdown -S</span>.<br />
<br />
That's all for now. If you are out at EclipseCon, make sure to come to my talk where I'll be presenting Diver and how it helps users of Eclipse understand their software. Happy coding!</div>Delhttp://www.blogger.com/profile/18263589361673145166noreply@blogger.com14tag:blogger.com,1999:blog-7718517813545203760.post-9761732248591603212011-03-01T11:29:00.000-08:002011-03-01T11:29:14.581-08:00Diver is a finalist for an Eclipse Community Award<div class="separator" style="clear: both; text-align: center;"><a href="http://diver.sf.net/"><img border="0" src="http://diver.sf.net/images/logo-small.png" /></a></div><br />
I've been swamped with work lately, so I'm afraid that I haven't been able to devote much time to blogging. But I got news today that my <a href="http://diver.sf.net/">Diver</a> tool has been selected as a finalist for the <i>Best Developer Tool</i> category along side the excellent <a href="http://pydev.org/">Pydev</a> environment for the Python language. Diver has really been my baby for the past couple of years. I've been working hard on trying to solve the problems associated with understanding software. I hope that Diver can help developers in that respect (I know it helps me :-) ). Even so, it is a great honour to be selected as a finalist from among more than 40 other <a href="http://marketplace.eclipse.org/nominations/best-developer-tool">excellent solutions</a>. Eclipse has such a vibrant developer community. There is a solution out there for almost every problem.<br />
<br />
If you are going to EclipseCon, be sure to check out my <a href="http://www.eclipsecon.org/2011/sessions/?page=sessions&id=2099">talk</a> to find out more about Diver and how to incorporate reverse engineering into your everyday work to improve your understanding of software.Delhttp://www.blogger.com/profile/18263589361673145166noreply@blogger.com1tag:blogger.com,1999:blog-7718517813545203760.post-82164590554393363822010-12-21T10:45:00.000-08:002010-12-21T10:45:10.746-08:00See you at EclipseCon!I felt like I won an award this morning when I found this in my email:<br />
<br />
<br />
<pre wrap="">Dear Del Myers,
We are pleased to accept your proposal "Put It In Reverse: Using Eclipse to
Understand Code that has Already Been Written" for EclipseCon 2011.
The Program Committee received many excellent submissions, and we're
very happy to include "Put It In Reverse: Using Eclipse to Understand Code
that has Already Been Written" in that select set.
Thank you for helping to make EclipseCon 2011 the best one yet!</pre><br />
I'm certain that EclipseCon will be excellent, and I hope to do my part in making it that way. So, everyone come and check out my talk if you have the time: <a href="https://www.eclipsecon.org/submissions/2011/view_talk.php?id=2099">https://www.eclipsecon.org/submissions/2011/view_talk.php?id=2099</a>Delhttp://www.blogger.com/profile/18263589361673145166noreply@blogger.com1tag:blogger.com,1999:blog-7718517813545203760.post-31581736338635899952010-12-07T12:44:00.000-08:002010-12-07T12:44:31.333-08:00Interview about Diver<div class="separator" style="clear: both; text-align: center;"><a href="http://diver.sf.net/"><img border="0" src="http://diver.sf.net/images/logo-small.png" /></a></div><br />
The online magazine JaxEnter.COM recently interviewed me about my tool Dynamic Interactive Views for Reverse Engineering (Diver), which is an open source tool for bringing reverse engineering processes into the hands of us ordinary developers. Wondering what this tool has to offer? Check out the interview: <a href="http://jaxenter.com/diver-interview-32838.html">http://jaxenter.com/diver-interview-32838.html</a>Delhttp://www.blogger.com/profile/18263589361673145166noreply@blogger.com1tag:blogger.com,1999:blog-7718517813545203760.post-6177443685456260332010-11-25T12:38:00.000-08:002010-11-25T12:41:23.392-08:00Diver version 0.3.0<div class="separator" style="clear: both; text-align: center;"><a href="http://diver.sf.net/"><img border="0" src="http://diver.sf.net/images/logo-small.png" /></a></div><br />
<br />
Last night, I released version 0.3.0 of Diver. It has been a while since I've written here. I've been busy with other work that had to be done. So, for those who may no longer be familiar with Diver, I will take a moment to step back and let you know what it is all about.<br />
<br />
Diver stands for Dynamic Interactive Views for Reverse Engineering. The basic of Diver is to make some reverse engineering tools and techniques easily accessible to us Java developers who use Eclipse. Some really common problems that I have had in maintaining software are trying to figure out answers to questions like, "Why did that happen?", "Where is that implemented?" and, "How does that work?" Diver offers tools to help you answer those kinds of questions. The techniques realized in Diver use execution traces of your running Java software so that you can get a picture of what is <i>really</i> going on at runtime rather than having to guess at what <i>might</i> be happening based on class hierarchies or keyword and reference searches. It isn't meant to replace your current debugging and investigation techniques. It is meant to offer you a few extra tools to augment your current work practices. Diver has its own website: <a href="http://diver.sf.net/">http://diver.sf.net</a>. You can go there to find out more.<br />
<br />
Now, onto the cool new features of Diver 0.3.0. Some highlights are on Diver's <a href="http://diver.sf.net/new.html">New and Noteworthy</a> page, but these are the ones that I'm most excited about:<br />
<br />
<b>More Efficient Tracing</b><br />
<b><br />
</b><br />
I've put a lot of effort into cutting back trace sizes and reducing the amount of time that it takes to analyze the traces for use in Diver. Previous versions recorded everything (every single method call) that was executed during the run of your program and applied custom package and class filters during a separate analysis step. In Diver 0.3.0, it is possible to apply those filters up-front so that you can control which methods get called during execution. This can make your target program more responsive and greatly reduce the amount of time that it takes to do the second analysis step. The Diver <a href="http://diver.sourceforge.net/docs/Diver.html#SettingUptheTrace">documentation</a> gives more information about how to set this up.<br />
<br />
<b>Compare Traces Using the Sequence Diagram</b><br />
<b><br />
</b><br />
Diver has always offered a cool feature which allows you to compare the difference between traces. It offers a filter on the Eclipse package explorer which allows you to locate method calls unique to a particular trace (or to a particular thread of execution within that trace). That filter has never been applied to the sequence diagram viewer offered by Diver, however. Any solution just seemed to inefficient to be able to apply to the massive amounts of data that the sequence diagram has to be able to display. Well, I've figured out a way to do it which seems to be quick enough for my own usage, so hopefully it will be for you as well. It is now possible to see which method calls are unique to a particular trace directly within the sequence diagram:<br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhqwyCkgEA1QbbcTmrN6d-Q5lT_f6wcHmXeKAmrxZ32J_qH7VGJQY0Cq4KyKdiTyKWlreC5jbJOU6ZeRBjrnVae_qiBzo8Z60UgkD3E55GrVJlc7-tnmPUiRl2PzyqXCvjCtJ8ZnhkUXO-t/s1600/sequence-filter1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhqwyCkgEA1QbbcTmrN6d-Q5lT_f6wcHmXeKAmrxZ32J_qH7VGJQY0Cq4KyKdiTyKWlreC5jbJOU6ZeRBjrnVae_qiBzo8Z60UgkD3E55GrVJlc7-tnmPUiRl2PzyqXCvjCtJ8ZnhkUXO-t/s320/sequence-filter1.png" width="288" /></a></div><br />
Methods that are not unique to the trace can either be shown in grey, or hidden completely:<br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhRbkzOIXJe08pujfmJoTAY32hd0JjscDulb0orQIOyorM0jdgusCMXkjOXVcdWXUi15Skpp3UvRxZM7BWGB3-YWALuKfxZyC0UiFVan0TTiSGp7OJTit1XQjKc4yEfuSRZ2xfgmTniK5qK/s1600/sequence-filter2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhRbkzOIXJe08pujfmJoTAY32hd0JjscDulb0orQIOyorM0jdgusCMXkjOXVcdWXUi15Skpp3UvRxZM7BWGB3-YWALuKfxZyC0UiFVan0TTiSGp7OJTit1XQjKc4yEfuSRZ2xfgmTniK5qK/s320/sequence-filter2.png" width="231" /></a></div><br />
This feature (and several others) are highlighted in the following <a href="http://www.youtube.com/watch?v=FzMl4Zu2tps&feature=player_embedded">video</a>. It is a pretty good video for just giving you an overview of what Diver has to offer as well:<br />
<br />
<div class="separator" style="clear: both; text-align: center;"><object height="280" width="350"><param name="movie" value="http://www.youtube.com/v/FzMl4Zu2tps?fs=1&hl=en_US&rel=0"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/FzMl4Zu2tps?fs=1&hl=en_US&rel=0" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="350" height="280"></embed></object></div><br />
If you want to install Diver, the p2 site is here: <a href="http://diver.svn.sourceforge.net/svnroot/diver/Release">http://diver.svn.sourceforge.net/svnroot/diver/Release</a>. Or, if you are using Eclipse 3.6, you can use the totally awesome <a href="http://delaltctrl.blogspot.com/2010/06/awesomeness-in-helios.html">Eclipse Marketplace</a> to install it directly. Just do a search for the keyword: Diver.Delhttp://www.blogger.com/profile/18263589361673145166noreply@blogger.com4tag:blogger.com,1999:blog-7718517813545203760.post-9719297404592277662010-06-25T15:11:00.000-07:002010-06-25T15:14:55.401-07:00Diver in linuxSome people may be having difficulty with Diver in various distributions of linux. You may be getting the following message when trying to launch a trace.<br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj2wi0nq-HAAFJokfWRmzqiGrQjI3BLccRZS6R33yECyei8ozbGh5-bOz8RECuEzTwm_-aTYLhl4n4E_m4ftKcFL2ydZVuBL65QKjrycgx7niPEbbKQXy4-gkHdmN8M9snLda0ncA1nwiot/s1600/linux-error.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="325" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj2wi0nq-HAAFJokfWRmzqiGrQjI3BLccRZS6R33yECyei8ozbGh5-bOz8RECuEzTwm_-aTYLhl4n4E_m4ftKcFL2ydZVuBL65QKjrycgx7niPEbbKQXy4-gkHdmN8M9snLda0ncA1nwiot/s400/linux-error.png" width="400" /></a></div><br />
And you may see this in the console:<br />
<br />
<code><br />
Error occurred during initialization of VM<br />
Could not find agent library in absolute path: /[path-to-plugin]/libsketch_linux32.so<br />
</code><br />
<br />
Now, you may be surprised to find out that these errors may have nothing to do with open ports or whether or not the file listed exists. This is not Diver's fault. The client can't find an open port because the Java virtual machine couldn't start and open one. The Virtual machine couldn't start not because the listed library is missing but because you might not have some of the dependencies installed on your system. Unfortunately, the Java VM sometimes gives some pretty uninformative error messages.<br />
<br />
Diver depends on the C++ boost libraries to do socket communication and multi-threading. It also uses boost to do multi-platform file system manipulation. Many distributions of linux come with boost installed. Some do not. If you have a debian-based version of linux, installing the required boost libraries is easy:<br />
<br />
<code>$ sudo apt-get install libboost-iostreams1.40.0 libboost-date-time1.40.0 libboost-filesystem1.40.0 libboost-system1.40.0 libboost-thread1.40.0</code><br />
<br />
If you are running a redhat distro, you should be able to use a similar <code>yum</code> command. I hope that this all works for everyone.Delhttp://www.blogger.com/profile/18263589361673145166noreply@blogger.com8tag:blogger.com,1999:blog-7718517813545203760.post-17548398491150508722010-06-18T12:00:00.000-07:002010-06-18T12:02:38.690-07:00Awesomeness in HeliosThere was a recent post by Wayne about how <a href="http://dev.eclipse.org/blogs/wayne/2010/06/17/eclipse-is-an-ide-platform/">Eclipse is an IDE Platform</a>. For all practical purposes, that is the way that I use it. But what is really awesome about Eclipse as an IDE platform is that it is an IDE platform that just keeps improving.<br />
<br />
I have to admit that I honestly don't keep up with the latest improvements to the Eclipse IDE. The reason is simply practical. I work on making tools for doing research on IDEs. I would like my current project, <a href="http://diver.sf.net">Diver</a> to be as compatible as is reasonable so that I can decrease the barrier to adoption. If I work with the "latest and greatest" version of Eclipse, I am just too tempted to use the "latest and greatest" features of Eclipse in my own tools, which means that people running the current release may not be able to work with what I am building. It's really just a matter of discipline.<br />
<br />
But now that Helios is about to be released I've started to use it and I find it totally awesome. Ian Bull has been faithful to his <a href="http://eclipsesource.com/blogs/2010/06/17/p2-api-and-the-b3-aggregator-top-eclipse-helios-feature-5/">top ten list</a> of the newest and greatest features of Eclipse. I don't know if I will do the same, but I think I might report on the great things about Eclipse as I discover them.<br />
<br />
So far, the number 1 through 10 greatest feature of Helios for me has been its new integration with the Eclipse Marketplace (and the <a href="http://eclipsesource.com/en/yoxos/">Yoxos</a> Marketplace catalog). I just recently had to change computers which meant that I also had to reinstall Eclipse. Normally, I would use Yoxos to create my own custom distribution of Eclipse, but I wanted to try Helios and all its cool new features. I use a number of 3rd party tools that aren't available in the standard Eclipse p2 repositories. For example, I work in academia which means that I write papers. I use <a href="http://www.latex-project.org/">LaTeX</a> for writing papers, which is a surprisingly process to writing software. So, I use Eclipse to write text as well as software. It used to be total pain to search for my LaTeX plug-in, add its p2 repository to my list of "Available Software Sites", and install. That is no longer the case. Now, I can just load up my Eclipse Marketplace client and do a quick search for "LaTeX":<br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgSxcfRs6KmZeG2q78zG3PNhPa7hjRN-Fdkkmi1sehb7c2EmcN6Q4qtcpnLyCIuODhfOvejHlo9vW4RTX2Dhqej0DX_mlDsKDxPn_BlBuKKHCnwKndqEFFMvF7fQ4eYB7XM8IvR2JFoQNwd/s1600/marketplace1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="256" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgSxcfRs6KmZeG2q78zG3PNhPa7hjRN-Fdkkmi1sehb7c2EmcN6Q4qtcpnLyCIuODhfOvejHlo9vW4RTX2Dhqej0DX_mlDsKDxPn_BlBuKKHCnwKndqEFFMvF7fQ4eYB7XM8IvR2JFoQNwd/s320/marketplace1.png" width="320" /></a></div><br />
And there you go. No hassle, no fuss, I just install and that's it. It's beautiful.<br />
<br />
As an aside (and a shameless plug), you can do the same thing with my project "Diver". Just load your Eclipse Marketplace client. A quick search for "reverse engineering" will point you straight to my favorite Eclipse tool ;-) : <br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEirEt6nEMybCVZYge03BfJ2p0EufdgHRk-xLyx7V1fEKtz3vA1405Etz0X306z4WkWgAscVkSYju-GzveEMcqgmR2AivXeu8tgvCQ5qNvgrDpllo8Ju-o-hMvN5POJCRpTpyrmf62TmUWaI/s1600/marketplace2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="294" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEirEt6nEMybCVZYge03BfJ2p0EufdgHRk-xLyx7V1fEKtz3vA1405Etz0X306z4WkWgAscVkSYju-GzveEMcqgmR2AivXeu8tgvCQ5qNvgrDpllo8Ju-o-hMvN5POJCRpTpyrmf62TmUWaI/s320/marketplace2.png" width="320" /></a></div>Delhttp://www.blogger.com/profile/18263589361673145166noreply@blogger.com0tag:blogger.com,1999:blog-7718517813545203760.post-38426217805484795442010-06-03T17:01:00.000-07:002010-06-03T17:01:38.549-07:00Eclipse Labs: To Migrate or Not to Migrate?I'm really happy about the recent creation of the new <a href="http://code.google.com/a/eclipselabs.org/hosting/">Eclipse Labs</a>. While I would absolutely love to have my <a href="http://diver.sf.net">Diver</a> project as an official Eclipse project in incubation, I'm afraid that the process is too heavy-weight. I work in research which often requires a very malleable programming schedule... I don't think that I would be able to hit the release targets of Eclipse. Plus the IP process can be a little long. My friend and colleague Ian Bull was able to make his Zest project an official Eclipse project (it is now part of GMF/draw2D) while he was doing his Ph.D... he did have a little programing help from some of the other members of our lab ;-). I'm a Masters student, though: the program is too short to wait for my project to be approved by the committers.<br />
<br />
So, Eclipse Labs is exactly perfect for what I need. It has the benefit of the Eclipse brand, but it doesn't carry the baggage of official Eclipse projects. It's too bad that it wasn't available six months ago when I was making Diver a tool open to the public. The best option I had at the time was SourceForge, which has been quite good, really.<br />
<br />
So, now I'm left with the question of whether or not to migrate Diver to the Eclipse Labs hosting. I would really like Diver to have a closer tie to the Eclipse brand. But, I would lose a lot of work that was put into creating the project content for Diver over at SourceForge. Most specifically, I would lose are the hard work that I put into creating the web site. Google code has its wiki, which is OK, but it isn't as rich as what I've been able to make with my web page.<br />
<br />
So: to migrate, or not to migrate? I don't know. Is there any real benefit?Delhttp://www.blogger.com/profile/18263589361673145166noreply@blogger.com3tag:blogger.com,1999:blog-7718517813545203760.post-50344405368684596182010-05-25T10:43:00.000-07:002010-05-25T10:58:19.974-07:00New version of Diver available today!Actually, it's been available for about a week, but I just haven't had time to blog about it. I've been busy with other work.<br />
<br />
For those of you who don't know, Diver is a research project of the CHISEL group at the University of Victoria. We are trying to find better ways to help programmers develop, debug, and understand their software. Diver does this by bringing some techniques from reverse engineering into your Eclipse IDE. It can generate execution traces of your software which it uses to adjust the UI of your IDE to draw your attention to the features of your software that you are looking for. Diver is the product of several years of research and development, so it is feature-rich and robust. You can find out more about Diver at our website: <a href="http://diver.sf.net">http://diver.sf.net</a><br />
<br />
OK, that's enough of the sell... I should let you know what you get with this new version of Diver.<br />
<br />
<br />
<table cellpadding="10"><tbody>
<tr valign="top"> <td><b>Faster Tracing</b></td> <td>The tracer has been optimized. Tests indicate that it is between<br />
2 and 4 times faster than version 0.1.0</td> </tr>
<tr valign="top"> <td><b>Capture Screenshots</b></td> <td>You can now save screenshots of your sequence diagram. Select<br />
the "camera" <img src="http://diver.sf.net/images/new/0.2.0/screenshot.png" /> icon,<br />
and you will be able to save an image of the main pane of the sequence<br />
diagram as a PNG, JPG, or BMP.<br />
<a href="http://diver.sf.net/images/new/0.2.0/screenshot-action.png"><img src="http://diver.sf.net/images/new/0.2.0/screenshot-action.png" width="200" /></a></td> </tr>
<tr valign="top"> <td><b>Exporting Traces</b></td> <td>Diver is now able to export a complete trace to be shared with your<br />
collegues.<br />
<a href="http://diver.sf.net/images/new/0.2.0/export2.png"><img src="http://diver.sf.net/images/new/0.2.0/export2.png" width="200" /></a> </td> </tr>
<tr valign="top"> <td><b>Importing Traces</b></td> <td>If you can export, you have to be able to import. Use the import<br />
trace wizard to open a Diver Trace (dvt) file. The file will be imported<br />
and analyzed just as if you ran the trace yourself.<br />
<a href="http://diver.sf.net/images/new/0.2.0/import2.png"><img src="http://diver.sf.net/images/new/0.2.0/import2.png" width="200" /></a> </td> </tr>
<tr valign="top"> <td><b>Filtering Empty Threads</b></td> <td>Diver keeps a record for all threads in your traces, even if no events<br />
occur in them. In previous versions, this could cause a lot of clutter<br />
in the Program Traces view. Now, you can filter empty threads and<br />
get rid of the clutter.<br />
<a href="http://diver.sf.net/images/new/0.2.0/emptythread.png"><img src="http://diver.sf.net/images/new/0.2.0/emptythread.png" width="200" /></a> </td> </tr>
<tr valign="top"> <td><b>Marking Code Executed in Jar Files</b></td> <td>In previous versions, it wasn't possible to view executed<br />
lines of code in .class files contained in Jars because of limitations<br />
in Eclipse's Resource framework. So, I used Diver to figure out how the<br />
JDT sets breakpoints in Jar files, and I was able to use what I found<br />
to add markers to Jar files for use within Diver.<br />
<a href="http://diver.sf.net/images/new/0.2.0/mark-in-class.png"><img src="http://diver.sf.net/images/new/0.2.0/mark-in-class.png" width="200" /></a> </td> </tr>
<tr valign="top"> <td><b>Toggle Combied Fragments and Loops</b></td> <td>If, for some reason (and I don't know what that would be :-) ),<br />
you don't like seeing your sequence diagram decorated with source<br />
code information, you can shut off combined fragments and loop compaction.<br />
<br />
<a href="http://diver.sf.net/images/new/0.2.0/toggle-combined-fragment.png"><img src="http://diver.sf.net/images/new/0.2.0/toggle-combined-fragment.png" width="200" /> </a></td> </tr>
<tr valign="top"> <td><b>Exceptions</b></td> <td>If a method returns due to an exception, it is now indicated in<br />
the sequence diagram.<br />
<br />
<a href="http://diver.sf.net/images/new/0.2.0/exceptions.png"><img src="http://diver.sf.net/images/new/0.2.0/exceptions.png" width="200" /></a> </td> </tr>
<tr valign="top"> <td><b>Diver Research</b></td> <td>Diver is a research project at the University of Victoria. Diver<br />
now makes it easier for you to help us with our research by logging<br />
information about how you use it. You can automatically upload these<br />
logs to our server, or you can shut off logging using the Workbench<br />
Logger preference page<br />
<br />
<a href="http://diver.sf.net/images/new/0.2.0/logging.png"><img src="http://diver.sf.net/images/new/0.2.0/logging.png" width="200" /></a> </td> </tr>
</tbody></table><br />
If you already have Diver installed, you should be able to get the new version just by updating your Eclipse. Otherwise, you can use our p2 repository site: <b>https://diver.svn.sourceforge.net/svnroot/diver/Release</b>.<br />
<br />
I hope that this new version will be useful to everyone. I've put a lot of hard work into it. It's 100% open source, so its free to you. But, please remember that Diver is a research project, so help me out with my research. Use it for a while, and then fill out our <a href="http://keg.cs.uvic.ca/limesurvey/index.php?sid=26778">survey</a>. Also, this new version of Diver has a logging feature that will keep track of some of your interactions with Diver. It's all anonymous information, and you can turn it off at any time (using the Workbench Logger) preference page. We don't get the data unless you explicitly agree to send it to us (Diver will ask you permission before uploading). But, please participate. I have to graduate sometime ;-).<br />
<br />
Anyway, happy coding!Delhttp://www.blogger.com/profile/18263589361673145166noreply@blogger.com2tag:blogger.com,1999:blog-7718517813545203760.post-38008560879176399432010-02-02T13:33:00.000-08:002010-02-02T15:47:12.978-08:00The Perils of Multi-Platform Eclipse DevelopmentWriting code for multiple platforms is a challenge. It not only increases the complexity of your code and tests, but it also increases the complexity of your build process. The build process is what I have had trouble with as of late. So, I'm logging my struggles so that I, and you, might have some place to go the next time multi-platform deployment causes headaches.<br /><br />So, here is my problem. I have a plug-in that has a little bit of platform-specific code in it. The code works on both windows and linux, and I have precompiled binaries for them. In other words, the build of the (C++) native code doesn't need to be part of my build process. I do that separately just because it is easier. Setting up cross-compilers is a nightmare, and takes more time than I have.<br /><br />So, here is what I do: I separate my native code into plug-in fragments for windows and for linux. After that, I have to go through all of my different manifests to make sure that P2 knows what to do with the the fragments. First, a <code>p2.inf</code> file has to be made for each fragment and the host plug-in, so that P2 knows the fragments are <i>installable units</i> that should be downloaded. OK, that's fine. Then, I have to the <code>feature.xml</code> for the feature that contains my plugins and fragments to make sure that I specify the supporting environments:<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEikQJB1MhaU2j8zPL51ziew3jZnGUs4RSTsToEWIZkPPKtqxIroVa6yH05rhEVbj4tj7EMvFGgLcHHYTbuhHAdX_Izaz0FiBo3Ig1LpxJ99JftcsN7lnb_q2IHkXwuu2moMJRNUhCca5Vbx/s1600-h/feature.png"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 286px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEikQJB1MhaU2j8zPL51ziew3jZnGUs4RSTsToEWIZkPPKtqxIroVa6yH05rhEVbj4tj7EMvFGgLcHHYTbuhHAdX_Izaz0FiBo3Ig1LpxJ99JftcsN7lnb_q2IHkXwuu2moMJRNUhCca5Vbx/s320/feature.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5433765556546471442" /></a><br /><br />OK, then I have to set up my fragments to make sure that the platform filters match their target environment:<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhT70XB9JBtCM4yNu1FKJpDWFqqYjVdM1lgLWW2E53Y36r35V5l0HKAQZnepiKpaoy3TV0cpTGl5Dcd3F6aizFHNWJNRtz9NFyOuozNxcoiN8BdMRL5BwOoVlcCKZhZNZAg5Vgl2zeWszwb/s1600-h/platform.png"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 234px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhT70XB9JBtCM4yNu1FKJpDWFqqYjVdM1lgLWW2E53Y36r35V5l0HKAQZnepiKpaoy3TV0cpTGl5Dcd3F6aizFHNWJNRtz9NFyOuozNxcoiN8BdMRL5BwOoVlcCKZhZNZAg5Vgl2zeWszwb/s320/platform.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5433766368687045458" /></a><br /><br />Platform filters are basically read as a functional notation, where sets of attributes are bound to operators. For example, <code>(|(osgi.arch=x86)(osgi.arch=x86_64))</code> binds the selection of the attributes (<code>osgi.arch=x86</code> and <code>osgi.arch=x86_64</code>) to the logical OR operator (<code>|</code>), so that it reads, "the osgi architecture can be either x86 or x86_64." So, I've got that down. I also had to set up the <code>Bundle-NativeCode</code> attribute in the manifest for the fragment so that my application knows where to find the binaries, but I'll get back to that later.<br /><br />OK, now one might expect that everything is ready to export. After all, the binaries don't depend on any native Eclipse fragments (they don't reference SWT or anything). So, it seems that my fragments should be able to be packaged up just like anything else.<br /><br />That's not the case however. When you run a build in PDE, and you put a platform filter on a fragment, Eclipse checks your current target platform and builds only for what you currently have. I, for example, have a machine with Windows XP on it, and that is the version of Eclipse that I downloaded. So, Eclipse will build only the windows fragment for me. There is no option to build for other platforms. If I use the <i>Export Deployable Features</i> wizard, this is what I get:<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjCX23NvHINgQBesxXpeQ6_2fG1B2tq60HtXBhCe_viHy5GZ3cbaDHU7BwvQQCpCTeFBTogwljp00dE_iEHVoNFs6kOpFdjFPM3NvLv9xDSS8Q05EqoV1RbD4n2djZpakrhmcwGu-vL5azp/s1600-h/export-single.png"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 302px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjCX23NvHINgQBesxXpeQ6_2fG1B2tq60HtXBhCe_viHy5GZ3cbaDHU7BwvQQCpCTeFBTogwljp00dE_iEHVoNFs6kOpFdjFPM3NvLv9xDSS8Q05EqoV1RbD4n2djZpakrhmcwGu-vL5azp/s320/export-single.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5433772335114058562" /></a><br /><br />Even though my fragments don't have any dependencies on any other platform-specific code and all I really need is a jar with my binaries in it, the PDE says, "No! I can't build that for you." OK, that's fine. I know that it is possible to build for multiple platforms (the SWT guys do it), so I did some searching.<br /><br />It turns out that what I need is something called the Eclipse <i>Delta Pack</i>. The Delta Pack is basically a bunch of fragments for different platforms which include native code for user interfaces and other i/o such as file manipulation. Getting the Delta Pack can transform your Eclipse workbench into a catch-all platform which targets everything that Eclipse can manage.<br /><br />The unfortunate thing is that the Delta Pack isn't that easy to find. If you go to <a href="http://download.eclipse.org">the Eclipse Download page</a>, you won't find any reference to it. You have to go down to the bottom of the page, and find the Classic Eclipse distribution. And select <i>Other Downloads</i>:<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhIVSxtbDcbKS6q3l_BKCOKVGUsOmbBVitCXe2xA7rYiypG3-jW1oIBiTL0O0fOnFLMFOtOYc_b4GpN2ys_So4OzkrhPxOMiMYAG4S_y9VjqGpA_qfKyT-wRSIMT94Lt0xdvFzpm9gQ_x-X/s1600-h/download1.png"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 300px; height: 320px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhIVSxtbDcbKS6q3l_BKCOKVGUsOmbBVitCXe2xA7rYiypG3-jW1oIBiTL0O0fOnFLMFOtOYc_b4GpN2ys_So4OzkrhPxOMiMYAG4S_y9VjqGpA_qfKyT-wRSIMT94Lt0xdvFzpm9gQ_x-X/s320/download1.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5433778159026531538" /></a><br /><br />Once there, you will want to get the release that you are targeting (probably somewhere in the 3.5.1 stream or later), and look to the left-hand menu. You will find the Delta Pack there:<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiVAEkOHMnzMN3tPmSThN87sk6HGY5WxWb_QeVLBAs5Ag2BpIDYKBFD9i8Mwqc4CIeZUsfmdZ8GZ0NY4AmBlt75Dco8YGj0LNrW0Uzjo-bVldguhh9ii0YQznkM1BQc6CgZkkpEwQKAvKQj/s1600-h/download2.png"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 298px; height: 320px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiVAEkOHMnzMN3tPmSThN87sk6HGY5WxWb_QeVLBAs5Ag2BpIDYKBFD9i8Mwqc4CIeZUsfmdZ8GZ0NY4AmBlt75Dco8YGj0LNrW0Uzjo-bVldguhh9ii0YQznkM1BQc6CgZkkpEwQKAvKQj/s320/download2.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5433778662043053122" /></a><br /><br />Or, you can follow this <a href="http://update.eclipse.org/downloads/drops/R-3.5.1-200909170800/download.php?dropFile=eclipse-3.5.1-delta-pack.zip">link</a> for the 3.5.1 drop.<br /><br />When you download the Delta Pack, you have to unpack it. Make sure that you <i>don't</i> unpack it over your current Eclipse install. That could make things go bad. Instead, unpack it somewhere else and you can tell Eclipse to add it to your target platform.<br /><br />To do that, go to your Eclipse Preferences, and find the page for <i>Target Platform</i>, select the running platform, and <i>Add</i> the Delta Pack to it as an <i>Eclipse Install</i>:<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi1M2hbszrPeTvix02TAGaSTUrASnJrQU8DLRE1FE98GgR4JYmUjT0DBJJBmPTqMkb46eOuKOb6MvYnB7oHgjlafLAc8QyOhDUovOEVMusHMLjCg75tXVa2781UG9VjkfcZ-WgO1V501iiC/s1600-h/target-platform.png"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 304px; height: 320px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi1M2hbszrPeTvix02TAGaSTUrASnJrQU8DLRE1FE98GgR4JYmUjT0DBJJBmPTqMkb46eOuKOb6MvYnB7oHgjlafLAc8QyOhDUovOEVMusHMLjCg75tXVa2781UG9VjkfcZ-WgO1V501iiC/s320/target-platform.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5433780122064158178" /></a><br /><br />After that's done, you will have a new magic option in your <i>Export Deployable Features</i> wizard called <i>Export for multiple platforms</i>. That's exactly what I was looking for! <br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhJAUxEA5CSRNAMbZixLjL5vDL4m_FSVc-WHM6H1wCAas1DxWf9RyKNBx2T5hHN_hmIEu-CI91mN4uPVt3TY7J_W3-Y1YSHpOd71266j23mb_-C4z490i2Lw8mvn7VOfejbDyx2VXuh23cp/s1600-h/export-multi.png"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 310px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhJAUxEA5CSRNAMbZixLjL5vDL4m_FSVc-WHM6H1wCAas1DxWf9RyKNBx2T5hHN_hmIEu-CI91mN4uPVt3TY7J_W3-Y1YSHpOd71266j23mb_-C4z490i2Lw8mvn7VOfejbDyx2VXuh23cp/s320/export-multi.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5433780740200546338" /></a><br /><br />So, one would think at this point that one could simply export all of the features, upload them to a P2 repository, and release the new version. Not so fast. If you are me and you do that, you get <a href="http://sourceforge.net/apps/trac/diver/ticket/23">this bug report</a>.<br /><br />It was silly of me. I shouldn't have assumed that the build would work flawlessly without testing. So, I checked my P2 repository, and low-and-behold, the Linux fragment was missing. That seemed strange. After all I <i>did</i> export for Linux. There's no rocket science here. It's just a pre-compiled binary after all.<br /><br />So, after hours of fighting with trying different combinations of platform filters, and different ways of building, there were no warnings and no errors in the build. Unfortunately, there was also no Linux fragment. It just would not get created on my windows box. I was about to go and file a bug on P2, when I decided that maybe I should just try to get the build on Linux. So, I went through all the above steps again on a fresh install of Eclipse on a Linux machine. What I expected to happen was that it would build fine on the Linux machine, but instead of not having a Linux fragment, I would be left without a windows fragment.<br /><br />That isn't what happened. I did get a windows fragment. What was missing? You guessed it: the Linux fragment! My Linux machine failed to build the Linux fragment. But, at least I got an error this time:<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjYiBMNrkOD9LMP4yaYVMcfO5DPmaiz6uLjQax9-8vw33N8UyFyqSprkopVI27046UdPJ2PVbFO_pXbkrhYPZBecAr3QcGTJQ6KmaoyM-5iCc7W6fN73Li9SwrXHn3-jGcpmcfR-2lLs9Wl/s1600-h/bundle-error.png"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 235px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjYiBMNrkOD9LMP4yaYVMcfO5DPmaiz6uLjQax9-8vw33N8UyFyqSprkopVI27046UdPJ2PVbFO_pXbkrhYPZBecAr3QcGTJQ6KmaoyM-5iCc7W6fN73Li9SwrXHn3-jGcpmcfR-2lLs9Wl/s320/bundle-error.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5433792017907235762" /></a><br /><br />It looks like there was something about my <code>Bundle-NativeCode</code> property in the Linux fragment which the PDE build system didn't like. So, I went to investigate it.<br /><br />I had used native code previously in an RCP toy application in which I was experimenting with OpenGL. When I looked up how to do it at that time, I learnt that I was supposed to use various keys such as <code>processor=</code> and <code>os=</code> to tell the plug-in when to use different compiled libraries. In fact, that is what I used in previous versions of Diver. When both the Windows and Linux binaries were in one fragment, it worked fine. But apparently, now that I had them in two fragments, that was very, very wrong:<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgl80eKPc_q1_NACvQrbkjvPdLAC2IURtqQQmX0Rcoy4yiIfUqWCjuCIN6nto_ZMandHoz6fnprbDwRitBClpbmKeGLyCsOhNcNFQAQkUPChYCdQmKEYuJB5aEF0N1tVPAbSSGQpaGS0WUa/s1600-h/native-code-wrong.png"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 183px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgl80eKPc_q1_NACvQrbkjvPdLAC2IURtqQQmX0Rcoy4yiIfUqWCjuCIN6nto_ZMandHoz6fnprbDwRitBClpbmKeGLyCsOhNcNFQAQkUPChYCdQmKEYuJB5aEF0N1tVPAbSSGQpaGS0WUa/s320/native-code-wrong.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5433793300821562882" /></a><br /><br />I didn't really know what to do, though since this is what I had read was correct, and it was previously working. In fact <i>it still works</i> for the different Windows versions. Not for Linux, though. I don't know why. So, after another hour or so on Google, I learned about the key <code>selection-filter</code> which works in the same way that the <code>Eclipse-PlatformFilter</code> does. So, I copied my platform filter into the <code>Bundle-NativeCode</code> like this:<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjspUEbGj4gPpwCD5AwV0mdyCioGV1T1AUTMQ4Q2UBrxSZL5qMwSFSRLh06jRWqUZa_yd84I-fe-nyVtDJbLPVfuYhoXwwWjOVY-TEoxLeN-RzG9B0d1RcqqfjK7DPJJRhlVEBmCX8e-PBq/s1600-h/native-code-right.png"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 204px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjspUEbGj4gPpwCD5AwV0mdyCioGV1T1AUTMQ4Q2UBrxSZL5qMwSFSRLh06jRWqUZa_yd84I-fe-nyVtDJbLPVfuYhoXwwWjOVY-TEoxLeN-RzG9B0d1RcqqfjK7DPJJRhlVEBmCX8e-PBq/s320/native-code-right.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5433794100740766306" /></a><br /><br />And it works! So, I learned a few things from this whole process:<br /><br /><ol><br /> <li><b>You Need The Delta Pack</b>. Why you need it for all multi-platform builds, I don't know. In my example, all I needed was to package up pre-compiled binaries into jar files. There doesn't need to be any dependency resolution for that, but the PDE needs the Delta Pack to do the build. That is relatively painless, so I don't mind.</li><br /> <li><b>Pay Attention to the <code>Bundle-NativeCode</code> Format.</b> Eclipse won't necessarily tell you what is wrong. It might just fail to build a fragment or two without you even noticing. The safest way to get it to work just seems to be to copy your <code>Eclipse-PlatformFilter</code> directly into the <code>Bundle-NativeCode</code> property. At least you don't have to manage multiple different syntaxes that way.</li><br /></ol><br /><br />Anyway, that is all for now. I hope this can be helpful to anyone who is doing builds for multiple platforms. It isn't an easy problem to solve, so there are bound to be pain points. This post will hopefully get you (and me) through them quickly next time.Delhttp://www.blogger.com/profile/18263589361673145166noreply@blogger.com4tag:blogger.com,1999:blog-7718517813545203760.post-28435211150979045042010-02-02T10:38:00.000-08:002010-02-02T13:00:48.949-08:00Diver 0.1.0 Released (For Real This Time)If anyone tried to download Diver 0.1.0 last week on their Linux boxes, you may have had a little trouble. It turns out that I didn't have everything set up correctly for a multi-platform build, and the Linux plugins weren't getting created. I'm going to blog about my experience in a minute, to keep it for posterity so that I can remember how to do it. Hopefully it will be useful for others as well. For now, here is a pretty picture to prove to you that things are good to go for you Linux users.<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgzZh9-T1WHRVUnZH-f1zKg-MewGL3jR2bcuyk1xN338adD-4xTmg_bvW-73lYEm9AMt_h9ChLXx4kqvNTznvFS4sShFfFK5yiWDDeOIXuLqOe4TEp9JmEBzNXwM9hGqN17xOBJBLd319U_/s1600-h/install-linux.png"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 316px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgzZh9-T1WHRVUnZH-f1zKg-MewGL3jR2bcuyk1xN338adD-4xTmg_bvW-73lYEm9AMt_h9ChLXx4kqvNTznvFS4sShFfFK5yiWDDeOIXuLqOe4TEp9JmEBzNXwM9hGqN17xOBJBLd319U_/s320/install-linux.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5433718986230695714" /></a><br /><br />If you downloaded for Windows last week, I think that you should be fine. But, there won't be any harm in updating.Delhttp://www.blogger.com/profile/18263589361673145166noreply@blogger.com2tag:blogger.com,1999:blog-7718517813545203760.post-59481973578433177172010-01-27T15:51:00.000-08:002010-01-28T11:28:11.679-08:00Diver 0.1.0 Released<p>There is a new version of Diver out, with a few new features which should make reverse engineering easier in Eclipse. A couple of highlights are the new "Notes" feature which can be accessed using Eclipse's Properties View, and the new Trace Search Page which helps you to find things in your traces. Diver is also a lot smaller in terms of its memory footprint now. For more information on what's new, check out the <a href="http://diver.sourceforge.net/new.html">New To Diver 0.1.0 Page</a>. To get Diver, just point your P2 "Available Software Sites" to <u>https://diver.svn.sourceforge.net/svnroot/diver/Release</u>. Diver works on Windows and Linux.</p><br /><br /><p>Some fancy pictures of the new features:</p><br /><br /><a href="http://diver.sourceforge.net/new.html"><br /><img width=350 src="http://diver.sf.net/images/new/0.1.0/searchpage.jpg"/><br><br /></a><br />The new Diver Trace Search<br /><br /><br /><a href="http://diver.sourceforge.net/new.html"><br /><img width=350 src="http://diver.sf.net/images/new/0.1.0/searchmethod.jpg"/><br><br /></a><br />Finding all the activations of methods that start with <code>get*</code><br /><br /><br /><a href="http://diver.sourceforge.net/new.html"><br /><img width=350 src="http://diver.sf.net/images/new/0.1.0/searchnotes.jpg"/><br><br /></a><br />Finding all personalized notes stored in a traceDelhttp://www.blogger.com/profile/18263589361673145166noreply@blogger.com0tag:blogger.com,1999:blog-7718517813545203760.post-15575711122882198822010-01-22T10:01:00.000-08:002010-01-22T10:40:54.783-08:00Diver tutorial videos available<div><br /></div><div><br /></div><div>Reverse engineering tools have traditionally suffered from a tremendous lack of adoption. There are likely several reasons for this. One is that they tend to come out of academia, and they never really get past the prototype stage. That is a shame because a lot of the ideas that have been proposed are really good ones. Another reason that they aren't often adopted is because it can be difficult to understand how to use them. The tools can be very cumbersome or they aren't very well documented.</div><div><br /></div><div>I've tried to overcome both of these issues with Diver so that people will be able to see its use and it can be widely adopted. I have to say, my motivations aren't entirely altruistic: I do have to get my thesis done :-).</div><div><br /></div><div>I've written a lot of in-depth documentation for Diver. But, let's be honest, I'm not even interested in reading all of those pages of documentation. So, for those of us with a shorter attention span, I've published several tutorial videos to get you started.</div><div><br /></div><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://diver.sf.net/tutorials.html"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 238px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEidb45SWVxqQbGfuSMA90EAB3vd_OqQsccE4yd8Es57yRGulwA9BAtegPSfJE1lTcJ9gYy-1O3cdivXeIdXdXqzCKrFnUVms8Xg-zAdFDyj1ZzM7IaswqKnsExBykc-ezRM2xFbyH7Xx1hG/s320/video.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5429626818515229618" /></a><br /><div>By the way, I made these tutorials using <a href="http://www.debugmode.com/wink/">Wink</a>. I highly recommend it for anyone who has to make a tutorial of their software. It's very easy to use and it gives you pretty well all the features that you could ask for. I searched for free screen capture software for a long while. This is the best that I could come by. If you've got any other suggestions, let me know.</div>Delhttp://www.blogger.com/profile/18263589361673145166noreply@blogger.com4tag:blogger.com,1999:blog-7718517813545203760.post-36042082332264571052010-01-21T10:46:00.000-08:002010-01-21T11:07:59.946-08:00Survey on Reverse EngineeringThough I'm really a coder at heart, I am a researcher by day. I've been working hard on the <a href="http://diver.sf.net">Diver</a> project to try and figure out ways that reverse engineering can be used to aid coders like you and me. If you've downloaded it and used it, please fill out my <a href="http://keg.cs.uvic.ca/limesurvey/index.php?sid=26778&newtest=Y&lang=en">survey</a>.<br /><br />If you haven't tried Diver yet, please <a href="http://diver.sourceforge.net/download.html">try it</a>. I'm really hopeful that it can help you Java developers out.Delhttp://www.blogger.com/profile/18263589361673145166noreply@blogger.com0tag:blogger.com,1999:blog-7718517813545203760.post-69844629761523480602009-12-18T11:06:00.001-08:002009-12-18T11:41:15.380-08:00Diver's going to Spain!A paper based on some of the innovations in Diver has been accepted to the 2010 European Conference on Software Maintenance and Reengineering. I will be presenting the paper in <a href="http://www.sait.escet.urjc.es/csmr2010/">Madrid in March</a>.<br /><br />A lot of technical and technological innovation does come from academia. You don't always see it directly in the commercial products right away, but I do believe that it has influence. Especially as software engineering and computer science graduates move into industry, bringing their research expertise with them. A lot of the things that we take for granted in our IDEs were first written up in academic conferences or journals. Take the interactive debugger that we all use all the time as an example [<a href="http://ieeexplore.ieee.org/xpls/abs_all.jsp?isnumber=35730&arnumber=1695740&count=32&index=6">Isoda, 87</a>]. I think that industry and academia really benefit from good research relationships.<br /><br />Anyway, it turns out that the way that Diver reduces the size of trace visualizations (in the sequence diagram) by cross-linking the trace with the source code is actually a new idea. So, the nice people at CSMR decided to let me write about it and give a presentation.<br /><br />The paper is called "Utilizing Debug Information to Compact Loops in Large Program Traces." (Sounds exciting doesn't it? ;-) ). Everyone knows that most of the execution of any program is really caused by an enormous amount of repetitive calls to a subset of the methods/functions/subs/whatever that are written in the code. Most of these calls occur within loops structures. That causes a big problem for visualizing traces. Most standard programs will will have millions of calls in the span of a few seconds (Hello World in Java has upwards of 100 000 calls or something rediculous like that!). That's far too big for any standard visualization.<br /><br />So, what Diver does that is unique is it recognizes that most of the repetitive calls will occur within loops that can be found in the source code of your program. So, it searches your source code (or the source code attached to your jars in Eclipse), and looks for where calls originate from. If they occur in a loop, then only one iteration of the loop is shown at a time.<br /><br />I ran some experiments on several traced programs, including Eclipse, and found that you can get upwards of an 85% reduction in the size of your visualization (depending on the program that you tracing, and on the visualization--it's particularly good for sequence diagrams) just by compacting loops in this way. That's a pretty significant reduction. The Eclipse JDK was a huge help for this, by the way. It has awesome Java indexing, and a great Java parser that made my work a lot easier.<br /><br />So, anyway, if you are in the vicinity of Madrid around March 15-18 2010, come by CSMR and say hello.Delhttp://www.blogger.com/profile/18263589361673145166noreply@blogger.com2tag:blogger.com,1999:blog-7718517813545203760.post-39745083680152336072009-12-02T09:34:00.000-08:002009-12-02T09:57:54.554-08:00Diver now available on Linux!I've had a number of requests to get Diver running on Linux. So, I've spent the past few days trying to get it done. I think that I've had success, but it needs more testing.<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgmv9UTtPiD9cUpx8PKB2vaUuzyMgsNO5PBhdwJTQdfmJwRWIZrsF23fRb2WBwfBf843tG979M5XjaGlAig6DbZ6stl2HtB0Ek3fuR_fCeFCwmJbC61nDkUJMc-j7MWiZEhB0YyfNLLm-VS/s1600-h/diver-linux.png"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 214px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgmv9UTtPiD9cUpx8PKB2vaUuzyMgsNO5PBhdwJTQdfmJwRWIZrsF23fRb2WBwfBf843tG979M5XjaGlAig6DbZ6stl2HtB0Ek3fuR_fCeFCwmJbC61nDkUJMc-j7MWiZEhB0YyfNLLm-VS/s320/diver-linux.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5410695073558031410" /></a><br /><br />I've tested it on a Linux machine here at the university. The above screen shot was taken by X-forwarding Eclipse to my local XP machine using Cygwin/X. The native code is compiled to 32bit, so it should be compatible with pretty much any Linux machine. All the code is statically linked, so you don't need to have any libraries installed.<br /><br />It hasn't been released to the "stable" stream (whatever that means in research ;-) ). You can install it from the "developer" stream using P2: https://diver.svn.sourceforge.net/svnroot/diver/Development. I haven't done integration tests on Windows yet.<br /><br />Right now, both the Windows version and the Linux version are held in the same plug in fragment. I know it would be better to include only one of them for each platform. I'm a little confused about how to set up my features to do this though. Does anyone have any tips?Delhttp://www.blogger.com/profile/18263589361673145166noreply@blogger.com3tag:blogger.com,1999:blog-7718517813545203760.post-42949759626633777672009-11-30T15:03:00.000-08:002009-11-30T15:17:10.773-08:00MANIFEST.MF: Apparently, you are just supposed to know thisI came across a funny error today while I was working with a plug-in fragment in Eclipse. I had a fragment that contained several resources for use in a host plug-in. All of a sudden, my host plugin was no longer able to find the resources from the fragment. I couldn't figure out why. Then I stumbled across some information about MANIFEST.MF files in Java jar collections. Apparently, there is a limit to the length that a line can be in a MANIFEST.MF file. If a line is more than 72 characters long, then it must be broken into more than one line. You can do so by breaking it on the 72nd character and continuing the next line with a space. My MANIFEST.MF file had one such line. So, changing the line from (imagine that there is no word wrap):<br /><br /><code><br />Eclipse-Variable-Example: Here is my really long manifest line that is more than 72 characters<br /></code><br /><br />To:<br /><br /><code><br />Eclipse-Variable-Example: Here is my really long manifest <br /> line that is more than 72 characters<br /></code><br /><br />Made it work. I knew that you <u>could</u> break lines, but I didn't know that you<br /><u>had</u> to break them. Now I know.<br /><br />But this leaves me questioning: the standard says that you should break the line on the 72nd character. Does that mean that my example should have really looked like this:<br /><br /><code><br />Eclipse-Variable-Example: Here is my really long manifest line that is m<br /> ore than 72 characters<br /></code><br /><br />? That just seems like a weird way of doing it.Delhttp://www.blogger.com/profile/18263589361673145166noreply@blogger.com2tag:blogger.com,1999:blog-7718517813545203760.post-42881345077908411222009-11-24T15:24:00.001-08:002009-11-24T17:25:41.474-08:00A Use Case for Reverse Engineering<div style="text-align: left;"><span class="Apple-style-span" style="font-family: verdana; ">OK, so I'm going to try and motivate some of what I do with an example application. Here is the problem that I'm looking at. A few weeks ago, I had to put a little bit of code in an application to open up a web browser in Eclipse and display a web page. I had remembered doing exactly that many years ago, back during the transition from Eclipse 2.x to Eclipse 3.x when the browser became a standard component. I remembered it being really simple, but I couldn't remember for the life of me how to actually do it. I feel a little ashamed of that because it's something I should have known, but I didn't. So, I had to figure it out.</span></div><div><span class="Apple-style-span" style="font-family:verdana;"><br /></span></div><div><span class="Apple-style-span" style=" ;font-family:verdana;">At this point, the entry might go long. So read if you are interested. Just quit otherwise.</span></div><div><span class="Apple-style-span" style="font-family:verdana;"><br /></span></div><div><span class="Apple-style-span" style="font-family:verdana;">Anyway, I started in the documentation. I did a search for "Browser". My problem is that I have so many plug-ins installed in Eclipse that help search is starting to get a little bit useless. I ended up with over 100 pages of documentation that had something to do with a browser, but I couldn't find what I was looking for. So, I decided to go to the Eclipse code.</span></div><div><span class="Apple-style-span" style="font-family:verdana;"><br /></span></div><div><span class="Apple-style-span" style="font-family:verdana;">So, I knew that if I browser was going to be opened, one had to be created. I was interested in using the internal browser, so I just went to the </span><span class="Apple-style-span" style="font-family:'courier new';">Browser </span><span class="Apple-style-span" style="font-family:verdana;">widget, and set a breakpoint in the constructor to see who creates it. I started up a run-time workbench which had a project in the workspace containing an HTML file, and I opened it up. My breakpoint was hit, and I got this stack trace:</span></div><div><span class="Apple-style-span" style="font-family:verdana;"><br /></span></div><div><span class="Apple-style-span" style="font-family:verdana;"><br /></span></div><div><span class="Apple-style-span" style="font-family:verdana;"><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh3LgNzpKm5Cc8nFcE9o7ADhuWtAq3Tr72hL952PGqU-vAsaZ84jnDO7mMRLYcEeANybU8g1SNrdSQE4qWDFZm_GOn4L7s8PUsc_uzMNim6_yeC-Hdye-4SJTX_ArJC5p4wEoMp60ViDdCD/s1600/Browser-stack-trace.png"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 219px; height: 320px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh3LgNzpKm5Cc8nFcE9o7ADhuWtAq3Tr72hL952PGqU-vAsaZ84jnDO7mMRLYcEeANybU8g1SNrdSQE4qWDFZm_GOn4L7s8PUsc_uzMNim6_yeC-Hdye-4SJTX_ArJC5p4wEoMp60ViDdCD/s320/Browser-stack-trace.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5407819757556473794" /></a><br /></span></div><div><span class="Apple-style-span" style="font-family:verdana;">So, I started looking through the classes that were in there. What should I use? </span><span class="Apple-style-span" style="font-family:'courier new';">WebBrowserEditor</span><span class="Apple-style-span" style="font-family:verdana;">? No, it's internal. </span><span class="Apple-style-span" style="font-family:'courier new';">WebBrowserEditorInput</span><span class="Apple-style-span" style="font-family:verdana;">? Don't tell me that I have to construct an editor input, and pass it to the workbench just to get a web browser to open. No, I can't anyway since it is internal. I know that there is an easier way.</span></div><div><span class="Apple-style-span" style="font-family:verdana;"><br /></span></div><div><span class="Apple-style-span" style="font-family:verdana;">Anyway: long story short, I went down a rabbit trail of following inheritance hierarchies, and searching for references of different classes to see where they are created and accessed. I didn't have any real success, so I gave up on that train. I decided to give my <a href="http://diver.sf.net/">Diver</a> tool a try and see where it would take me. Note that this is a recreation of the event, and a number of the details are likely different.</span></div><div><span class="Apple-style-span" style="font-family:verdana;"><br /></span></div><div><span class="Apple-style-span" style="font-family:verdana;">So, to use Diver, I could just launch Eclipse in debug mode like I did before, but I did it using an Eclipse Trace Launch, supplied by Diver, as illustrated here:</span></div><div><span class="Apple-style-span" style="font-family:verdana;"><br /></span></div><div><span class="Apple-style-span" style="font-family:verdana;"><span class="Apple-style-span" style=" color: rgb(0, 0, 238); -webkit-text-decorations-in-effect: underline; font-family:Georgia, serif;"><img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj-wm7-4OD-EuK6A6yBIHkQThGKgLuayYJCpSHim0j5YceuVN7MDDhUWc9y5VomIIRTkjrUYHGoYZeH1r7BDC1b6g4pSiOZP_R1CDXXdcvzLtghmzTcuWSJ5QE2mLd3OHM1qXptF0YeqLfc/s320/Browser-start-trace.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5407827710864467554" style="display: block; margin-top: 0px; margin-right: auto; margin-bottom: 10px; margin-left: auto; text-align: center; cursor: pointer; width: 320px; height: 198px; " /></span></span></div><div style="text-align: left;"><span class="Apple-style-span" style="font-family:verdana;"><br /></span></div><div style="text-align: left;"><span class="Apple-style-span" style="font-family:verdana;">There is a little more set up to do though. By default, Diver is set up to watch for code that I've written (i.e. the files in my source folders). But, I'm interested in Eclipse code, so I've got to change that. It can be changed in the <i>Java Trace</i> tab. I just guessed that the code that I was interested in was probably in a ui package, so I added </span><span class="Apple-style-span" style="font-family:'courier new';">org.eclipse.ui.* </span><span class="Apple-style-span" style="font-family:verdana;">so that it would be included. Everything else will be ignored unless a class in an </span><span class="Apple-style-span" style="font-family:'courier new';">org.eclipse.ui</span><span class="Apple-style-span" style="font-family:verdana;"> package is accessed somewhere along the call chain:</span></div><div style="text-align: left;"><span class="Apple-style-span" style="font-family:verdana;"><br /></span></div><div style="text-align: left;"><span class="Apple-style-span" style="font-family:verdana;"><span class="Apple-style-span" style=" color: rgb(0, 0, 238); -webkit-text-decorations-in-effect: underline; font-family:Georgia, serif;"><img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgTSkBwAXxwZTaujPBaVmKshGDIMPTXlje35IrMLyufEpYxP9e0Uh-cSwikxobzPohqV0VIFDbym9zsXW_ChISBxdAyuhmejPP46du901loEb9MAxJdpmdO2SgnJd4Tf82i-5tLhxLZlcjh/s320/Browser-trace-setup.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5407830529681789698" style="display: block; margin-top: 0px; margin-right: auto; margin-bottom: 10px; margin-left: auto; text-align: center; cursor: pointer; width: 320px; height: 216px; " /></span></span></div><div style="text-align: left;"><span class="Apple-style-span" style="font-family:verdana;">Then, I just launched Eclipse like I normally would. I followed the same process as I did for my debug session, but instead of just stopping at the breakpoint, Diver is going to log all of the interactions that Eclipse makes around the time that I open the browser. I did that by using a little "play" button found in the Debug View: </span><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhL0VzT1OORH3tHy5Ff-JwDZMrFBqAH4FZlTj1bmPzHEsDVVifWiX2uObx74BWIrnlaAPwV46ucVRtPDtm1uULt3ZtOv03Xeq6AxHpmLgseiJ843gdkMw8-jm8ZozeBsSioSq8T27n7eDG5/s1600/play_icon.png"><span class="Apple-style-span" style="font-family:verdana;"><img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhL0VzT1OORH3tHy5Ff-JwDZMrFBqAH4FZlTj1bmPzHEsDVVifWiX2uObx74BWIrnlaAPwV46ucVRtPDtm1uULt3ZtOv03Xeq6AxHpmLgseiJ843gdkMw8-jm8ZozeBsSioSq8T27n7eDG5/s320/play_icon.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5407832056374790530" style="cursor: pointer; width: 16px; height: 16px; " /></span></a><span class="Apple-style-span" style="font-family:verdana;">. Again, I opened the browser, and as soon as it started to show up, I paused the trace (<span class="Apple-style-span" style=" ;font-family:Georgia, serif;"><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiJHvX6GjQJPDXk1UldY-PF9Hx-wud_xzbDdcuXYxvR6I8zGY2a2mtvUTBPHX4BmvIdOTkxH4bHevWZX57wlkLGFanKd8JJ0_eT1h30TB3O_BIRNFajjoKCzSBGapebSbBDH2ojVuwVT0V8/s1600/pause_icon.png"><img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiJHvX6GjQJPDXk1UldY-PF9Hx-wud_xzbDdcuXYxvR6I8zGY2a2mtvUTBPHX4BmvIdOTkxH4bHevWZX57wlkLGFanKd8JJ0_eT1h30TB3O_BIRNFajjoKCzSBGapebSbBDH2ojVuwVT0V8/s320/pause_icon.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5407832506114276210" style="cursor: pointer; width: 16px; height: 16px; " /></a><span class="Apple-style-span" style=" ;font-family:verdana;">), and quit Eclipse.</span></span></span></div><div style="text-align: left;"><span class="Apple-style-span" style="font-family:verdana;"><br /></span></div><div style="text-align: left;"><span class="Apple-style-span" style="font-family:verdana;">Now, it took a little while for Diver to analyze the data that it just captured. This is necessary to make Diver more zippy later on, so it's worth the wait. There were over 4 000 000 events that were logged. It didn't take too terribly long, though, and I did have other stuff to do.</span></div><div style="text-align: left;"><span class="Apple-style-span" style="font-family:verdana;"><br /></span></div><div style="text-align: left;"><span class="Apple-style-span" style="font-family:verdana;">Anyway, once that was done, I could see my trace in the <i>Program Traces</i> view:</span></div><div style="text-align: left;"><span class="Apple-style-span" style="font-family:verdana;"><br /></span></div><div style="text-align: center;"><span class="Apple-style-span" style="font-family:verdana;"><span class="Apple-style-span" style=" ;font-family:Georgia, serif;"><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhO26T7U1pEqsSH61peTMkmhYaLrIbT02ZTtq_S_YDdxyoq6bioV5u6GSkVdprtSqfa-r9FjZwpq-Yc7orvsyaRDOYsnXuYMtLJEKW7bDOHHN9qlaj1ExnBZ1ZGZQqjL2V37XJmwT1cnukm/s1600/Browser-threads.png"><img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhO26T7U1pEqsSH61peTMkmhYaLrIbT02ZTtq_S_YDdxyoq6bioV5u6GSkVdprtSqfa-r9FjZwpq-Yc7orvsyaRDOYsnXuYMtLJEKW7bDOHHN9qlaj1ExnBZ1ZGZQqjL2V37XJmwT1cnukm/s320/Browser-threads.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5407834257312394738" style="cursor: pointer; width: 258px; height: 320px; " /></a></span></span></div><div style="text-align: center;"><span class="Apple-style-span" style="font-family:verdana;"><br /></span></div><div style="text-align: left;"><span class="Apple-style-span" style="font-family:verdana;">This view shows all of the threads that were running while I was performing the trace. Double-clicking on one of them will open up a sequence diagram view that I could explore to figure out what the thread is doing. But, there were too many to try. So, I tried a different route. Notice the green dots? They mean that the trace associated with those threads is the "Active Trace" in Eclipse. It's kind of like Mylyn's tasks. If you activate a trace, then Diver will enable different features that will filter your package explorer to show you only the classes and methods that were used during the trace. I activated the trace that I just made, and went to the <i>Package Explorer</i>.</span></div><div style="text-align: left;"><span class="Apple-style-span" style="font-family:verdana;"><br /></span></div><div style="text-align: left;"><span class="Apple-style-span" style="font-family:verdana;">Again, I figured that what I was looking for probably happened around the same time that a </span><span class="Apple-style-span" style="font-family:'courier new';">Browser</span><span class="Apple-style-span" style="font-family:verdana;"> instance was created. The problem with using the debugger before was that I couldn't see everything that happened around that time: I could only see the things that occurred within the call chain to the construction of the instance. So, this time I used Diver to show me the context in which the browser was instantiated. I found it in the Package Explorer, right-clicked and selected "reveal in > main". What this did was it opened up a sequence diagram of the Main thread, and located the first method that was called on the </span><span class="Apple-style-span" style="font-family:'courier new';">Browser</span><span class="Apple-style-span" style="font-family:verdana;"> class:</span></div><div style="text-align: left;"><span class="Apple-style-span" style="font-family:verdana;"><br /></span></div><div style="text-align: left;"><span class="Apple-style-span" style="font-family:verdana;"><br /></span></div><div style="text-align: left;"><span class="Apple-style-span" style="font-family:verdana;"><span class="Apple-style-span" style=" ;font-family:Georgia, serif;"><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgSCbz2HR-sS_9DAf9drX01PxUicTahgaQxk_-8JGINtMbhjZcAsxnfenBg3dP_f0VVKmW6B3TIXyPwc6mn2yDJxeD230MOZOBC7zfvxT7SlirMOEdcYcQHD_LyQJxoWoWJvODrRVfPrvUn/s1600/Browser-reveal.png"><img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgSCbz2HR-sS_9DAf9drX01PxUicTahgaQxk_-8JGINtMbhjZcAsxnfenBg3dP_f0VVKmW6B3TIXyPwc6mn2yDJxeD230MOZOBC7zfvxT7SlirMOEdcYcQHD_LyQJxoWoWJvODrRVfPrvUn/s320/Browser-reveal.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5407834742118321858" style="display: block; margin-top: 0px; margin-right: auto; margin-bottom: 10px; margin-left: auto; text-align: center; cursor: pointer; width: 279px; height: 320px; " /></a><span class="Apple-style-span" style="font-family:verdana;">Here lies another problem, though: the sequence diagram is really big. Here's a zoomed-out view of it:</span></span></span></div><div style="text-align: left;"><span class="Apple-style-span" style="font-family:verdana;"><br /></span></div><div style="text-align: left;"><span class="Apple-style-span" style="font-family:verdana;"><br /></span></div><div style="text-align: left;"><span class="Apple-style-span" style="font-family:verdana;"><span class="Apple-style-span" style=" color: rgb(0, 0, 238); -webkit-text-decorations-in-effect: underline; font-family:Georgia, serif;"><img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiIAoRGJGqG4A9xlaVda0n4Zbq6SY-TO8reUrspQdjz8pv4_iWLYTQLFqed3-gyXBalvyfcId1P2b-OYJTquFof_hXdRJqNYvx-5adT-aUvjnYo7t-xW0KRoRrakNApLeujVE0R9ppTkble/s320/Browser-sequence-outline.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5407834750879914690" style="display: block; margin-top: 0px; margin-right: auto; margin-bottom: 10px; margin-left: auto; text-align: center; cursor: pointer; width: 320px; height: 272px; " /></span></span></div><div style="text-align: left;"><span class="Apple-style-span" style="font-family:verdana;"><br /></span></div><div style="text-align: left;"><span class="Apple-style-span" style="font-family:verdana;"><br /></span></div><div style="text-align: left;"><span class="Apple-style-span" style="font-family:verdana;"><span class="Apple-style-span" style=" ;font-family:Georgia, serif;"><span class="Apple-style-span" style="font-family:verdana;">I don't really want to look at it all. There are a couple of things that helped me out. First, there is a timeline on the sequence diagram:</span></span></span></div><div style="text-align: left;"><span class="Apple-style-span" style="font-family:verdana;"><br /></span></div><div style="text-align: left;"><span class="Apple-style-span" style="font-family:verdana;"><br /></span></div><div style="text-align: left;"><span class="Apple-style-span" style="font-family:verdana;"><span class="Apple-style-span" style=" color: rgb(0, 0, 238); -webkit-text-decorations-in-effect: underline; font-family:Georgia, serif;"><img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg254qa808F0wWO3x3pgyYYg280WR64M2d8Lf1-wEzgT8WnpBi4JlljTacQrB666IxqtpX-34_JvPBDfHWc7fcgWR_KqmkYPd13pIyUdT9djraICz4ahUlj1nERiR01jRpAd9JGgdyHfkEy/s320/Browser-timeline.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5407834752731522642" style="display: block; margin-top: 0px; margin-right: auto; margin-bottom: 10px; margin-left: auto; text-align: center; cursor: pointer; width: 320px; height: 10px; " /></span></span></div><div style="text-align: center;"><span class="Apple-style-span" style="color:#0000EE;"><br /></span></div><div style="text-align: left;"><span class="Apple-style-span" style="font-family:verdana;">The blue vertical bars are all the invocations of methods on the </span><span class="Apple-style-span" style="font-family:'courier new';">Browser</span><span class="Apple-style-span" style="font-family:verdana;"> class. The first one is the constructor call, so I adjusted the range on the timeline (the darker area around the first invocation) to just surround the constructor call a little bit. This filtered the sequence diagram to show only invocations that occur within that range of time. The other thing that helped me is the fact that the sequence diagram can collapse lifelines based on the packages that classes are contained in. For example, we can see here that the </span><span class="Apple-style-span" style="font-family:'courier new';">org.eclipse.swt.widgets</span><span class="Apple-style-span" style="font-family:verdana;"> package contains five classes that I'm not really interested in, so I can collapse it:</span></div><div style="text-align: left;"><span class="Apple-style-span" style="font-family:verdana;"><br /></span></div><div style="text-align: left;"><span class="Apple-style-span" style="font-family:verdana;"><br /></span></div><div style="text-align: left;"><span class="Apple-style-span" style="font-family:verdana;"><span class="Apple-style-span" style=" ;font-family:Georgia, serif;"><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEirxkgQRhbtOx0TO2x5bk-o632V0qrL2-Us7fk5x4KtpPKQ2pTqRlB3sbdY1xTjaSuLoyq-Q2YZzQKG-xWJZYoxDx7gc3uph5Lu_R5p6dkDfxnOy_4Px9Cid21Vpsd2yqQxtKX9BhGNwoza/s1600/Browser-package.png"><img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEirxkgQRhbtOx0TO2x5bk-o632V0qrL2-Us7fk5x4KtpPKQ2pTqRlB3sbdY1xTjaSuLoyq-Q2YZzQKG-xWJZYoxDx7gc3uph5Lu_R5p6dkDfxnOy_4Px9Cid21Vpsd2yqQxtKX9BhGNwoza/s320/Browser-package.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5407839358402895634" style="display: block; margin-top: 0px; margin-right: auto; margin-bottom: 10px; margin-left: auto; text-align: center; cursor: pointer; width: 320px; height: 180px; " /></a></span></span></div><div style="text-align: left;"><span class="Apple-style-span" style="font-family:verdana;"><br /></span></div><div style="text-align: left;"><span class="Apple-style-span" style="font-family:verdana;">I collapsed a bunch of other uninteresting packages like </span><span class="Apple-style-span" style="font-family:'courier new';">java.*</span><span class="Apple-style-span" style="font-family:verdana;"> and </span><span class="Apple-style-span" style="font-family:'courier new';">sun.*</span><span class="Apple-style-span" style="font-family:verdana;"> and </span><span class="Apple-style-span" style="font-family:'courier new';">org.eclipse.core.*</span><span class="Apple-style-span" style="font-family:verdana;">, etc., and got a much smaller diagram that I could start </span><span class="Apple-style-span" style="font-family:verdana;">browsing. In a little while, I found another class that looked to be of interest: <span class="Apple-style-span" style="font-family:'courier new';">WorkbenchBrowserSupport.</span> A method called</span><span class="Apple-style-span" style="font-family:verdana;"> <span class="Apple-style-span" style="font-family:'courier new';">createBrowser</span> is called on it <i>after</i> the browser is actually instantiated. That's why I couldn't find it in the debugger:</span></div><div style="text-align: left;"><span class="Apple-style-span" style="font-family:verdana;"><br /></span></div><div style="text-align: left;"><span class="Apple-style-span" style="font-family:verdana;"><br /></span></div><div style="text-align: left;"><span class="Apple-style-span" style="font-family:verdana;"><span class="Apple-style-span" style=" color: rgb(0, 0, 238); -webkit-text-decorations-in-effect: underline; font-family:Georgia, serif;"><img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg5myJrmvkLO-IWJucNeuj6PTIlu0X-3MkevBgjUKMr-oLBVB4ZBtD6xlOabR1nHcVZv_oefB_j0ea0mb8fEbQf4oqkJNfFMhZ_8ejWfCi0pkQ57z17Vu2ll62voeyfrCxiFht4H7eobym-/s320/Browser-sequence-diagram.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5407839361925892994" style="display: block; margin-top: 0px; margin-right: auto; margin-bottom: 10px; margin-left: auto; text-align: center; cursor: pointer; width: 320px; height: 282px; " /></span></span></div><div style="text-align: center;"><span class="Apple-style-span" style="color:#0000EE;"><span class="Apple-style-span" style="font-family:verdana;"><br /></span></span></div><div style="text-align: left;"><span class="Apple-style-span" style="font-family:verdana;">Now, what I want to know is how to get a </span><span class="Apple-style-span" style="font-family:'courier new';">WorkbenchBrowserSupport</span><span class="Apple-style-span" style="font-family:verdana;">, so I scanned up the lifeline, and I found this (cleaned up a little to make it look nicer):</span></div><div style="text-align: left;"><span class="Apple-style-span" style="font-family:verdana;"><br /></span></div><div style="text-align: left;"><span class="Apple-style-span" style="font-family:verdana;"><br /></span></div><div style="text-align: left;"><span class="Apple-style-span" style="font-family:verdana;"><span class="Apple-style-span" style=" color: rgb(0, 0, 238); -webkit-text-decorations-in-effect: underline; font-family:Georgia, serif;"><img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiZPZlds-AvHzc_uNTs_6kXLixpFIlaG0rcrQ1_ad4etYbGZvMAOf10yoUw9m5cxaqn6fJWGMsnbL3ZdjRwWqbLHf1VQQxbJovfg10gzW-6vEJZZlmNVp4ERnOp8F2TxSNd811Uhb5C8SYW/s320/Browser-sequence-diagram-clean.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5407839368272997826" style="display: block; margin-top: 0px; margin-right: auto; margin-bottom: 10px; margin-left: auto; text-align: center; cursor: pointer; width: 320px; height: 192px; " /></span></span></div><div style="text-align: left;"><span class="Apple-style-span" style="font-family:verdana;"><br /></span></div><div style="text-align: left;"><span class="Apple-style-span" style="font-family:verdana;">At this point, I thought to myself, "Of course! You get the browser support by calling </span><span class="Apple-style-span" style="font-family:'courier new';">IWorkbench.getBrowserSupport()</span><span class="Apple-style-span" style="font-family:verdana;">! I should have known that!" And I'm a little embarrassed to say that I didn't. But, my problem was solved at any rate. I just had to get an instance of the workbench (from </span><span class="Apple-style-span" style="font-family:'courier new';">PlatformUI</span><span class="Apple-style-span" style="font-family:verdana;">), get the browser support, and create a browser. Done and done.</span></div><div style="text-align: left;"><span class="Apple-style-span" style="font-family:verdana;"><br /></span></div><div style="text-align: left;"><span class="Apple-style-span" style="font-family:verdana;">Now, this isn't to say that I solved a problem that couldn't be solved using other Eclipse tools. I'm sure that if I were willing to spend some time with the Java Search dialog, I could have found the reference to </span><span class="Apple-style-span" style="font-family:'courier new';">createBrowser</span><span class="Apple-style-span" style="font-family:verdana;"> eventually. But, I always get those search queries wrong and I come up empty. I'm just inept at using Java Search. So, here I had an alternative using some of the reverse engineering support of Diver.</span></div><div style="text-align: left;"><span class="Apple-style-span" style="font-family:verdana;"><br /></span></div><div style="text-align: left;"><span class="Apple-style-span" style="font-family:verdana;">I hope that this post motivated some of the neat things that can be done with a little bit of extra tool support. You can go ahead and try it if you like. It's all free.</span></div><div style="text-align: left;"><span class="Apple-style-span" style="font-family:verdana;"><br /></span></div><div style="text-align: left;"><span class="Apple-style-span" style="font-family:verdana;">That's it for now. I'll see you next time.</span></div><div><span class="Apple-style-span" style="font-family:verdana;"></span><span class="Apple-style-span" style="font-family:verdana;"> </span></div>Delhttp://www.blogger.com/profile/18263589361673145166noreply@blogger.com13tag:blogger.com,1999:blog-7718517813545203760.post-9011011465201416522009-11-23T16:06:00.000-08:002009-11-23T16:10:29.847-08:00Hey, I've landed!I just noticed that I've made it onto the Planet! I'm glad to be here, and I'm excited to meet you all! :-)<div><br /></div><div>In case you've just joined me, this blog is going to be about reverse engineering in Eclipse. I am a researcher at the University of Victoria, figuring out how to make reverse engineering more accessible to the average coder. So, I'll be talking about some of my research experience to. I hope you enjoy it!</div>Delhttp://www.blogger.com/profile/18263589361673145166noreply@blogger.com1tag:blogger.com,1999:blog-7718517813545203760.post-29547148314231981652009-11-23T13:42:00.001-08:002009-11-23T14:18:29.948-08:00What is Reverse Engineering?<span class="Apple-style-span" style="font-size:medium;">OK, so I've said that this blog is going to be about reverse engineering in Eclipse. That leads to the question: "What, exactly, is reverse engineering?"* The answer might be broader than a lot of people think.</span><div><span class="Apple-style-span" style="font-size:medium;"><br /></span></div><div><span class="Apple-style-span" style="font-size:medium;">A lot of people think that reverse engineering has to do with taking prebuilt software, running a decompilation process over it, and trying to copy the original software for personal gain. That can be some of reverse engineering, but it isn't the bulk of it. Academic literature on reverse engineering actually has very little to do with that.</span></div><div><span class="Apple-style-span" style="font-size:medium;"><br /></span></div><div><span class="Apple-style-span" style="font-size:medium;">The reality is that most developers do some kind of reverse engineering all the time. Whenever we think to ourselves, "I wonder how/why the program did that?" we are asking a reverse engineering question. We are trying to figure out from a previously engineered system the reasons that it was written the way it was, and why it does what it does.</span></div><div><span class="Apple-style-span" style="font-size:medium;"><br /></span></div><div><span class="Apple-style-span" style="font-size:medium;">I think that this has become a lot more common place with the boom of Open Source Software and great tools like Eclipse. Personally, if I want to find out what a piece of code like </span><span class="Apple-style-span" style="font-family:'courier new';"><span class="Apple-style-span" style="font-size:medium;">StringBuilder.append()</span></span><span class="Apple-style-span" style="font-size:medium;"><span class="Apple-style-span" style="font-family:georgia;"> </span><span class="Apple-style-span" style="font-family:arial;">does, I'm just as likely to simply press </span></span><i><span class="Apple-style-span" style="font-size:medium;"><span class="Apple-style-span" style="font-family:arial;">F3</span></span></i><span class="Apple-style-span" style="font-size:medium;"><span class="Apple-style-span" style="font-family:arial;"> in Eclipse and go read the code as I am to go off and read the API documentation. If I want to understand how to use class </span></span><span class="Apple-style-span" style="font-size:medium;"><span class="Apple-style-span" style="font-family:arial;">X</span></span><span class="Apple-style-span" style="font-size:medium;"><span class="Apple-style-span" style="font-family:arial;"> in my software, I'm just as likely to use </span></span><i><span class="Apple-style-span" style="font-size:medium;"><span class="Apple-style-span" style="font-family:arial;">Ctrl-Shift-G</span></span></i><span class="Apple-style-span" style="font-size:medium;"><span class="Apple-style-span" style="font-family:arial;"> and search for references for how other people have done it, as I am to search through mailing lists or, again, go to the documentation.</span></span></div><div><span class="Apple-style-span" style="font-size:medium;"><span class="Apple-style-span" style="font-family:arial;"><br /></span></span></div><div><span class="Apple-style-span" style="font-size:medium;"><span class="Apple-style-span" style="font-family:arial;">These are all microcosms of reverse engineering, and we developers do them all the time. But there are still some pain-points, and things that could be improved. One big thing is that we have gotten used to using debuggers to set breakpoints and step through problem code. But what do you do if you don't know where the problem code is, and so you can't set a breakpoint? That's where some more advanced techniques can come in handy. I'll dedicate my next post to one possible technique in Eclipse.</span></span><span class="Apple-style-span" style="font-family:arial;"><br /></span><div><span class="Apple-style-span" style="font-family:georgia;"><br /></span></div><div><br /></div><div><br /></div><div><br /></div><div><br /></div><div><br /></div><div><br /></div><div><br /></div><div><br /></div><div><br /></div><div><br /></div><div><br /></div><div>---</div><div>*Personal point of interest: many people would have said here "That <i>begs</i> the question...". I just thought that I'd add an "educational" note about that, because it is something that kind of gets to me when I read it. I did a minor degree in philosophy, and <i>begging the question</i> is actually a logical fallacy in which a person tries to prove a proposition by making reference to the original assumptions. There is a common example that shows up when people try to market products:</div><div><br /></div><div>1. The best products are the ones that most people buy.</div><div>2. How can you be sure that they are the best?</div><div>3. Because the most people have bought them, of course!</div><div><br /></div><div>Step 3 assumes the axiom is statement 1, and so does not actually answer the question in statement 2. Statement 2 was questioning the validity of 1, and 3 tried to answer 2 by resorting to the assumption (1) which was in question (2). Hence <i>begging the question</i>. </div><div><br /></div><div>So, in reality when people say "That begs the question", they really mean "That leads to the question". I just wanted to educate the masses.</div></div>Delhttp://www.blogger.com/profile/18263589361673145166noreply@blogger.com1tag:blogger.com,1999:blog-7718517813545203760.post-87719183464010651222009-11-23T11:06:00.001-08:002009-11-23T11:27:53.000-08:00So here is what this blog is really aboutWow, I haven't really kept up with the whole blogging thing here. I just noticed that my last post was in March. I plan on trying to do better than that from now on.<div><br /></div><div>Anyway, maybe I need to take this blog in a new direction, or in any direction really. So, here is my plan. I'm going to start blogging about my work with Eclipse more. I'm a masters student at the university of Victoria. I've been working for the past year on problems related to reverse engineering. The inspiration has really come from the fact that I worked for a while as a programmer, writing Java software. Everyone knows how much time is spent in debugging software, and just scanning over source code trying to figure out how things work. So, I got the opportunity in my research group here--the <a href="http://www.thechiselgroup.org">CHISEL lab</a>--to do some work on figuring out how to make that sort of process easier.</div><div><br /></div><div>You may have heard a little bit about the CHISEL group. It's the group that <a href="http://www.ianbull.com">Ian Bull</a> graduated from. We do quite a lot of work in Eclipse because it is such a nice free and open platform. Ian worked on the <a href="http://www.eclipse.org/gef/zest/">Zest</a> project as part of his Phd. work. I was actually lucky enough to help him a little bit in the coding and design of that project--we are very cooperative in our group.</div><div><br /></div><div>Anyway, long story short, I've been working on my own project in Eclipse called <a href="http://diver.sf.net">Diver</a>. It stands for Dynamic Interactive Views for Reverse Engineering (I know, the last two letters are reversed--I was trying to be clever). It's a set of views that makes use of Eclipse's powerful Java Development Tools, and makes it easy to apply some reverse engineering techniques to day-to-day programming tasks. I think that Eclipse is the perfect environment to get this kind of work running in because it is built on such a good plug-in platform. It has been quite easy, in the whole scheme of things, to get my ideas integrated into the Eclipse platform, and to make use of the many powerful components that have already been implemented. For example, to do some of my Java reverse engineering, I didn't have to implement my own parsers and indexers into source code: I could just use the JDT. It's been a great way to get started.</div><div><br /></div><div>So, here is where this blog is going to go: I'm going to start talking a bit more about my project and about how reverse engineering can be done in Eclipse in general, and about some of the challenges that I came across while trying to implement my solution. Hopefully it will be helpful to people out in the Eclipse community.</div>Delhttp://www.blogger.com/profile/18263589361673145166noreply@blogger.com7tag:blogger.com,1999:blog-7718517813545203760.post-81083410789555823222009-03-23T11:04:00.000-07:002009-03-23T11:12:36.906-07:00Linking boost libraries to DLLs in mingwSo, I've recently needed to use the <a href="http://www.boost.org">boost</a> libraries to create a DLL for use with the JVMTI. I know that it seems like a strange thing to have to do, but the long and the short of it is that I needed portable thread and socket libraries. So, I couldn't just depend on the header file linkage (like you would have with boost's smart pointers). I needed to link the compiled boost libraries to my DLL.<div><br /></div><div>Now, here comes a problem: JVMTI won't automatically load dynamic libraries that are required by your agent. The obvious solution is to try to statically link boost to the agent DLL. I didn't think that this would be a problem. But, I'm using mingw for my C++ work (it has good support with Eclipse's CDT, which I use because this is JVMTI, and Eclipse is my Java environment). I spent a good day trying to figure it out.</div><div><br /></div><div>Here is the trick: when you build your boost libraries using bjam, it defaults to naming the static libraries as ".lib" becuase you are using windows. However, mingw is a port of gcc, which expects ".a" libraries. So, g++ won't link to the .lib's. The solution is to simply go into your build directory, and rename all of the .lib files to .a files. And viola, you get linkage. It's crazy, but true. Hopefully this can save some other people some pain.<br /></div><div><br /></div><div><br /></div>Delhttp://www.blogger.com/profile/18263589361673145166noreply@blogger.com0