Switch branches/tags
Nothing to show
Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
..
Failed to load latest commit information.
ramtools
shoelace
.gitignore
InMemory.java
JDI2JSON.java
JSONTracingThread.java
LICENSE
MEMORY-NOTES
README
TODO
VMCommander.java
expected-output.txt
test-input.txt
test-with-stdlib.txt

README

traceprinter: a Java package to print traces of Java programs
David Pritchard (daveagp@gmail.com), created May 2013

The contents of this directory are released under the GNU Affero 
General Public License, versions 3 or later. See LICENSE or visit:
http://www.gnu.org/licenses/agpl.html

This project would not be possible without the package
com.sun.tools.example.trace, written by Robert Field. 
http://www.docjar.com/docs/api/com/sun/tools/example/trace/package-index.html
The traceprinter package was initially created from that package. 

Try the visualizer this was built for: 
      http://cscircles.cemc.uwaterloo.ca/java-visualize/

===
NEWS

A big update on June 11 2013 makes everything compile and execute in memory,
so no writing to the file system is needed, and no considerations for
simultaneous users are necessary.

===
WHAT DOES THIS PACKAGE DO AND WHAT DOES IT CONTAIN?

traceprinter.InMemory: the main class. It takes java file source code 
                       from standard input. Then it outputs a text (JSON)
                       version of what the program didwhen executed.

The output format is described here:
  https://github.com/pgbovine/OnlinePythonTutor/blob/master/v3/docs/opt-trace-format.md
This allows us to use the javascript frontend from OnlinePythonTutor
to visualize Java instead of Python. 

traceprinter.ramtools: compiles the java files to bytecode in memory.

Then, InMemory uses the JDI to start a debuggee JVM, load the bytecode into
it, and then execute it.

traceprinter.VMCommander: drives injection and execution into debuggee.

traceprinter.shoelace: contains all fixed code run by the debugee JVM.

traceprinter.JSONTracingThread: event handling loop.

traceprinter.JDI2JSON: used to convert everything to text output.
 
===
FLOW OF EXECUTION

InMemory will get things started, and passes the ball briefly to 
JSONTracingThread. But once the debuggee takes it first step, the
VMCommander drives the execution of the debuggee VM. Again, the
code it causes to run, will drive the event loop in JSONTracingThread
some more, which in turn uses JDI2JSON to output things nicely.