classpath-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[cp-patches] [RFA/JDWP] VirtualMachineCommandSet.java


From: Aaron Luchko
Subject: [cp-patches] [RFA/JDWP] VirtualMachineCommandSet.java
Date: Tue, 12 Jul 2005 14:56:14 -0400

Ok this is a touch more complicated but not too bad, there's also a
couple possibly minor issues. This implements the VirtualMachine
CommandSet
http://java.sun.com/j2se/1.5.0/docs/guide/jpda/jdwp/jdwp-protocol.html#JDWP_VirtualMachine

The VERSION command is the first one that is a bit of an interpretation
http://java.sun.com/j2se/1.5.0/docs/guide/jpda/jdwp/jdwp-protocol.html#JDWP_VirtualMachine_Version
All the fields are pretty direct except for the first one.
"description: Text information on the VM version"
Sun along with IBM and BEA (they all actually return the exact same
response for this command) return
"Java Debug Wire Protocol (Reference Implementation) version 1.4?JVM
Debug Interface version 1.3?JVM version 1.4.2_06 (Java HotSpot(TM)
Client VM' mixed mode)"

Which seems pretty generic/non-standard so I just did 

Properties props = System.getProperties();

// The description field is pretty loosely defined
String description = "JVM version " + props.getProperty("java.vm.name")
                     + " " + props.getProperty("java.vm.version") + " "
                     + props.getProperty("java.version");

which for my rpm installed gcj gave,
"JVM version GNU libgcj 4.0.0 20050622 (Red Hat 4.0.0-13) 1.4.2"

The next issue, the commands 
AllThreads and TopLevelThreadGroups
http://java.sun.com/j2se/1.5.0/docs/guide/jpda/jdwp/jdwp-protocol.html#JDWP_VirtualMachine_Version

Rely on two things:
1. There can only be 1 top level thread group.
2. The aforesaid top level group can be attained via recursively going
group.getParent().

If those assumptions are incorrect then things could get more
complicated.

There's also the theoretical concern if these are true of a user run
program being able to find our Jdwp threads via the same way I do
executeAllTheads().

release/holdEvents
http://java.sun.com/j2se/1.5.0/docs/guide/jpda/jdwp/jdwp-protocol.html#JDWP_VirtualMachine_HoldEvents
should be fine being left on the back burner until later.

thanks,
Aaron

2005-07-12  Aaron Luchko  <address@hidden>

        * gnu/classpath/jdwp/processor/VirtualMachineCommandSet.java:
        New file.

Attachment: jdwpVirtualMachine.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]