Guys,
we have been discussing a possible debugging architecture for XMLVM.
There is currently no way to debug a program that was created with XMLVM
in Apple's emulator or on an actual device. It is possible to debug on
the Java side using XMLVM's emulation library for Cocoa Touch. However,
this has two major disadvantages: problems often only materialize when
you deploy your application on the actual device and it also requires us
to keep pace with our own emulation library. We are getting more and
more patches where people create new Java wrappers for Cocoa Touch API,
but don't have the time and resources to provide an implementation for
our Java-based emulation library. This approach does not scale.
To solve both problems, we consider to focus our resources in a
debugging architecture. Java supports remote debugging:
http://java.sun.com/javase/technologies/core/toolsapis/jpda/index.jsp
In particular, there is the so-called Java Debug Wire Protocol (JDWP):
http://java.sun.com/j2se/1.5.0/docs/guide/jpda/jdwp-spec.html
It defines an on-the-wire protocol between debugger and debugee (the
application to be debugged). So, here is the idea we have been toying
with: write a JDWP protocol engine in Java, cross-compile it to
Objective-C, and deploy it (together with the application to be
debugged) on the device. It should then be possible to connect via any
standard Java Debugger to the application running on the device.
Once we achieve that goal, it would enable us to do source-level
debugging on the actual device and we no longer need to maintain our
Java emulation library (since we would just leverage Apple's own emulator).
We think that this is the way to go. Leaves us only with *a lot* of very
tricky code. To implement the JDWP is no small feat. Anyone out there
who has some experience with this? I have been poking around to see if
there might already be a Java-based implementation of the JDWP, but I
couldn't find one. Anyone?
Arno
|