Hi all, I was thinking a bit about how we could support debugging in a way that would be common to several free VMs. For an introduction to the "Java Platform Debugger Architecture" (JPDA), please refer to [1].
In particular, I am wondering whether it might be possible to implement a parser for the "Java Debug Wire Protocol" [JDWP, 2] -- in Java. The implementation would use the services of a delegate. Each VM could choose to implement the debugging delegate according to their own need. GNU Classpath would provide a JNI-based reference implementation of this debugging delegate, using the Java VM Tool Interface [JVMTI, 3]. (For those in love with acronyms, JVMTI is sort of a unification of JVMDI and JVMPI, which both have been deprecated in JDK1.5). Currently, no free VM implements JVMTI, so that would mean some work for the VM people. However, I guess the VMs will eventually want to support JVMTI anyway (there exist free tools that use its predecessors JVMPI and JVMDI). "Exotic" (non-C) VMs like Jaos or JNode, maybe also IKVM.NET, would have to provide their own implementations of the debugging delegate. Still, the JDWP parser would be the same. To make it more fun, I wonder whether the interface to the debugging delegate could be based on JDI [4]. JDI is a client-side Java API for the JDWP protocol. Basically, the JDWP front-end would then post JDI requests to a weird JDI VirtualMachine. (Weird because it was representing the local VM, not a remote one). Mark said he doesn't see a problem with JDI being in the com.sun.jdi namespace. I think it might be nice to support JDI, even if it just was for the client side -- although this is certainly not the most pressing need we have in free Java... I have no idea what this would mean for gcj and JC. One could imagine a hack that forks out a gdb process and translates JDI invocations to gdb commands, but this seems very kludgy. Directly adding JDWP support to gdb would probably be a lot cleaner. My proposal seems like an excellent way to shoot oneself into the foot. On the other hand, it would be nice if the debugging stuff could at least partially be common between free VMs. What do people think? [1] http://java.sun.com/j2se/1.5.0/docs/guide/jpda/ [2] http://java.sun.com/j2se/1.5.0/docs/guide/jpda/jdwp-spec.html [3] http://java.sun.com/j2se/1.5.0/docs/guide/jvmti/jvmti.html [4] http://java.sun.com/j2se/1.5.0/docs/guide/jpda/jdi/ -- Sascha Sascha Brawer, [EMAIL PROTECTED], http://www.dandelis.ch/people/brawer/ _______________________________________________ Classpath mailing list [EMAIL PROTECTED] http://mail.gnu.org/mailman/listinfo/classpath

