Curiosity is bliss    Archive    Feed    About    Search

Julien Couvreur's programming blog and more

Debugging Backwards in Time

 

I found this Omniscient Debugging project a long time ago (via this O'Reilly Network blog) and found it very interesting. Basically it is a black box that does an extensive trace of a running application (variable states and function calls). A GUI is provided to scroll back in time and monitor the state of the various objects and threads.

If I remember correctly a custom Java class loader is used to modify the bytecode on the fly to include the extra tracing calls. This is nice because you don't need to instrument you bytecode.
Update: the code for the Omniscient Debugger is now available. Check out the DebugifyingClassLoader and Debugify classes.

RetroVue is be a commercial Java debugger with similar capabilites. I haven't found a demo version of it, but their video is pretty nice.

Todd Proebsting mentioned such a black box recorder as a candidate Disruptive Programming Language technology in this PowerPoint presentation.
Update: In my recent video lectures frenzy I found the recording corresponding to this lecture (the page also has numerous other talks available).

Here are some of the links that are related and that I dug up when I investigated applying the same principle to the .NET platform.

Inside the JVM (with an explanation of the loader subsystem in chapter 5).

A simple introduction to the .NET Intermedia Language (IL).

A Possible Enhancement of the MSIL.

Activator class reference.

Update: Unfortunately, I just noticed that unlike the Java ClassLoader, the .NET Activator class is "sealed", so it can't be inherited from. This either has to be bypassed or some other trick needs to be found in order to modify the CLR classes as they are being loaded.

Update: It turns out this kind of bytecode manipulation is possible in .Net, using the Profiler APIs. I wrote the result of my investigations in Modifying IL at runtime (Part I) and following episodes.

______________________________________
comments powered by Disqus